A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
parallel-communication-interface.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013. Lawrence Livermore National Security, LLC.
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Steven Smith <smith84@llnl.gov>
7
*
8
*/
9
10
/**
11
* \file
12
* \ingroup mpi
13
* Declaration of class ns3::ParallelCommunicationInterface.
14
*/
15
16
#ifndef NS3_PARALLEL_COMMUNICATION_INTERFACE_H
17
#define NS3_PARALLEL_COMMUNICATION_INTERFACE_H
18
19
#include <ns3/buffer.h>
20
#include <ns3/nstime.h>
21
#include <ns3/object.h>
22
#include <ns3/packet.h>
23
24
#include <list>
25
#include <mpi.h>
26
#include <stdint.h>
27
28
namespace
ns3
29
{
30
31
/**
32
* \ingroup mpi
33
*
34
* \brief Pure virtual base class for the interface between ns-3 and
35
* the parallel communication layer being used.
36
*
37
* This class is implemented for each of the parallel versions of
38
* SimulatorImpl to manage communication between process (ranks).
39
*
40
* This interface is called through the singleton MpiInterface class.
41
* MpiInterface has the same API as ParallelCommunicationInterface but
42
* being a singleton uses static methods to delegate to methods
43
* defined in classes that implement the
44
* ParallelCommunicationInterface. For example, SendPacket is likely
45
* to be specialized for a specific parallel SimulatorImpl.
46
*/
47
class
ParallelCommunicationInterface
48
{
49
public
:
50
/**
51
* Destructor
52
*/
53
virtual
~ParallelCommunicationInterface
()
54
{
55
}
56
57
/**
58
* \copydoc MpiInterface::Destroy
59
*/
60
virtual
void
Destroy
() = 0;
61
/**
62
* \copydoc MpiInterface::GetSystemId
63
*/
64
virtual
uint32_t
GetSystemId
() = 0;
65
/**
66
* \copydoc MpiInterface::GetSize
67
*/
68
virtual
uint32_t
GetSize
() = 0;
69
/**
70
* \copydoc MpiInterface::IsEnabled
71
*/
72
virtual
bool
IsEnabled
() = 0;
73
/**
74
* \copydoc MpiInterface::Enable(int* pargc,char*** pargv)
75
*/
76
virtual
void
Enable
(
int
* pargc,
char
*** pargv) = 0;
77
/**
78
* \copydoc MpiInterface::Enable(MPI_Comm communicator)
79
*/
80
virtual
void
Enable
(MPI_Comm communicator) = 0;
81
/**
82
* \copydoc MpiInterface::Disable
83
*/
84
virtual
void
Disable
() = 0;
85
/**
86
* \copydoc MpiInterface::SendPacket
87
*/
88
virtual
void
SendPacket
(
Ptr<Packet>
p,
const
Time
& rxTime,
uint32_t
node,
uint32_t
dev) = 0;
89
/**
90
* \copydoc MpiInterface::GetCommunicator
91
*/
92
virtual
MPI_Comm
GetCommunicator
() = 0;
93
94
private
:
95
};
96
97
}
// namespace ns3
98
99
#endif
/* NS3_PARALLEL_COMMUNICATION_INTERFACE_H */
ns3::ParallelCommunicationInterface
Pure virtual base class for the interface between ns-3 and the parallel communication layer being use...
Definition
parallel-communication-interface.h:48
ns3::ParallelCommunicationInterface::SendPacket
virtual void SendPacket(Ptr< Packet > p, const Time &rxTime, uint32_t node, uint32_t dev)=0
Send a packet to a remote node.
ns3::ParallelCommunicationInterface::Enable
virtual void Enable(int *pargc, char ***pargv)=0
Setup the parallel communication interface.
ns3::ParallelCommunicationInterface::Enable
virtual void Enable(MPI_Comm communicator)=0
Setup the parallel communication interface using the specified communicator.
ns3::ParallelCommunicationInterface::IsEnabled
virtual bool IsEnabled()=0
Returns enabled state of parallel environment.
ns3::ParallelCommunicationInterface::GetCommunicator
virtual MPI_Comm GetCommunicator()=0
Return the communicator used to run ns-3.
ns3::ParallelCommunicationInterface::GetSystemId
virtual uint32_t GetSystemId()=0
Get the id number of this rank.
ns3::ParallelCommunicationInterface::Destroy
virtual void Destroy()=0
Deletes storage used by the parallel environment.
ns3::ParallelCommunicationInterface::GetSize
virtual uint32_t GetSize()=0
Get the number of ranks used by ns-3.
ns3::ParallelCommunicationInterface::Disable
virtual void Disable()=0
Clean up the ns-3 parallel communications interface.
ns3::ParallelCommunicationInterface::~ParallelCommunicationInterface
virtual ~ParallelCommunicationInterface()
Destructor.
Definition
parallel-communication-interface.h:53
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mpi
model
parallel-communication-interface.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0