15#ifndef NULLMESSAGE_SIMULATOR_IMPL_H
16#define NULLMESSAGE_SIMULATOR_IMPL_H
18#include <ns3/event-impl.h>
20#include <ns3/scheduler.h>
21#include <ns3/simulator-impl.h>
30class NullMessageEvent;
31class NullMessageMpiInterface;
32class RemoteChannelBundle;
An identifier for simulation events.
Interface between ns-3 and MPI for the Null Message distributed simulation implementation.
Simulator implementation using MPI and a Null Message algorithm.
void CalculateLookAhead()
Calculate the lookahead allowable for this MPI task.
double m_schedulerTune
Null Message performance tuning parameter.
Ptr< Scheduler > m_events
The event priority queue.
void Remove(const EventId &id) override
Remove an event from the event list.
uint32_t m_currentUid
Unique id of the current event.
Time GetDelayLeft(const EventId &id) const override
Get the remaining time until this event will execute.
~NullMessageSimulatorImpl() override
Destructor.
void HandleArrivingMessagesBlocking()
Blocking receive of arriving messages.
uint32_t m_systemCount
MPI communicator size.
friend class NullMessageEvent
void Run() override
Run the simulation.
void HandleArrivingMessagesNonBlocking()
Non blocking receive of pending messages.
uint32_t m_currentContext
Execution context of the current event.
void DoDispose() override
Destructor implementation.
uint32_t GetSystemId() const override
Get the system id of this simulator.
static NullMessageSimulatorImpl * GetInstance()
Time m_safeTime
The time for which it is safe for this task to execute events without danger of out-of-order events.
bool IsExpired(const EventId &id) const override
Check if an event has already run or been cancelled.
EventId ScheduleDestroy(EventImpl *event) override
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
Time CalculateGuaranteeTime(uint32_t systemId)
static NullMessageSimulatorImpl * g_instance
Singleton instance.
void ProcessOneEvent()
Process the next event on the queue.
uint32_t m_uid
Next event unique id.
static TypeId GetTypeId()
Register this type.
uint64_t GetEventCount() const override
Get the number of events executed.
void SetScheduler(ObjectFactory schedulerFactory) override
Set the Scheduler to be used to manage the event list.
uint64_t m_currentTs
Timestamp of the current event.
Time GetMaximumSimulationTime() const override
Get the maximum representable simulation time.
void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event) override
Schedule a future event execution (in a different context).
void NullMessageEventHandler(RemoteChannelBundle *bundle)
DestroyEvents m_destroyEvents
The container of events to run at Destroy()
void Cancel(const EventId &id) override
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
EventId Schedule(const Time &delay, EventImpl *event) override
Schedule a future event execution (in the same context).
uint32_t GetContext() const override
Get the current simulation context.
Time GetSafeTime()
Get the current SafeTime; the maximum time that events can be processed based on information received...
std::list< EventId > DestroyEvents
Container type for the events to run at Simulator::Destroy().
NullMessageSimulatorImpl()
Default constructor.
int m_unscheduledEvents
Number of events that have been inserted but not yet scheduled, not counting the "destroy" events; th...
bool IsFinished() const override
Check if the simulation should finish.
void Stop() override
Tell the Simulator the calling event should be the last one executed.
uint64_t m_eventCount
The event count.
void RescheduleNullMessageEvent(Ptr< RemoteChannelBundle > bundle)
bool m_stop
Flag calling for the end of the simulation.
Time Now() const override
Return the current simulation virtual time.
void Destroy() override
Execute the events scheduled with ScheduleDestroy().
void CalculateSafeTime()
Calculate the SafeTime.
void ScheduleNullMessageEvent(Ptr< RemoteChannelBundle > bundle)
EventId ScheduleNow(EventImpl *event) override
Schedule an event to run at the current virtual time.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Collection of ns-3 channels between local and remote nodes.
Singleton for managing the RemoteChannelBundles for each process.
The SimulatorImpl base class.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.