FreeNOS
Public Types | Public Member Functions
MpiBackend Class Referenceabstract

Represents a Message Passing Interface (MPI) implementation backend. More...

#include <MpiBackend.h>

Inheritance diagram for MpiBackend:
AbstractFactory< MpiBackend > MpiHost MpiTarget

Public Types

typedef int Result
 Result code. More...
 

Public Member Functions

virtual Result initialize (int *argc, char ***argv)=0
 Initialize the backend. More...
 
virtual Result terminate ()=0
 Terminate the backend. More...
 
virtual Result getCommRank (MPI_Comm comm, int *rank)=0
 Retrieve communication rank (core id) More...
 
virtual Result getCommSize (MPI_Comm comm, int *size)=0
 Retrieve communication size (total cores) More...
 
virtual Result send (const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)=0
 Synchronous send data. More...
 
virtual Result receive (void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)=0
 Synchronous receive data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractFactory< MpiBackend >
static MpiBackendcreate ()
 Abstract function to create an instance of T. More...
 

Detailed Description

Represents a Message Passing Interface (MPI) implementation backend.

Definition at line 36 of file MpiBackend.h.

Member Typedef Documentation

◆ Result

typedef int MpiBackend::Result

Result code.

The same MPI_* values of mpi.h are used for Result values

See also
mpi.h

Definition at line 47 of file MpiBackend.h.

Member Function Documentation

◆ getCommRank()

virtual Result MpiBackend::getCommRank ( MPI_Comm  comm,
int *  rank 
)
pure virtual

Retrieve communication rank (core id)

Parameters
commCommunication reference
rankOutput the communication rank number
Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Comm_rank().

◆ getCommSize()

virtual Result MpiBackend::getCommSize ( MPI_Comm  comm,
int *  size 
)
pure virtual

Retrieve communication size (total cores)

Parameters
commCommunication reference
sizeOutput the communication size
Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Comm_size().

◆ initialize()

virtual Result MpiBackend::initialize ( int *  argc,
char ***  argv 
)
pure virtual

Initialize the backend.

Parameters
argcArgument count pointer
argvArgument values array pointer
Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Init().

◆ receive()

virtual Result MpiBackend::receive ( void *  buf,
int  count,
MPI_Datatype  datatype,
int  source,
int  tag,
MPI_Comm  comm,
MPI_Status status 
)
pure virtual

Synchronous receive data.

Parameters
bufOutput data buffer
countNumber of data items
datatypeType of data
sourceSource to receive data from (core id)
tagOptional data identifier to receive
commCommunication reference
statusOutput the MPI status
Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Recv().

◆ send()

virtual Result MpiBackend::send ( const void *  buf,
int  count,
MPI_Datatype  datatype,
int  dest,
int  tag,
MPI_Comm  comm 
)
pure virtual

Synchronous send data.

Parameters
bufInput data buffer
countNumber of data items
datatypeType of data
destDestination to send to (core id)
tagOptional data identifier to send
commCommunication reference
Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Send().

◆ terminate()

virtual Result MpiBackend::terminate ( )
pure virtual

Terminate the backend.

Returns
Result code

Implemented in MpiHost, and MpiTarget.

Referenced by MPI_Finalize().


The documentation for this class was generated from the following file: