Parallel Interface Definition

You must provide an implementation of the parallel interface to embed the SIMULIA Co-Simulation Services in parallel.

You can embed the SIMULIA Co-Simulation Services in distributed memory parallel (DMP) mode if your application is parallel and uses the Message Passing Interface (MPI).

Warning: This feature is intended for advanced users only who are familiar with MPI.

We recommend that you embed and test the SIMULIA Co-Simulation Services in serial mode first, and then progress to parallel mode once the serial implementation works.

This page discusses:

The header file SMACseDmp.h provides the interface definition for a subset of MPI used by the SIMULIA Co-Simulation Services. You must provide an implementation based on your client's MPI.

You must compile the implementation and create a dynamic library (.dll on Windows and .so on Linux). This library must be included with your client. When you initialize the SIMULIA Co-Simulation Services, you must provide the path and file name as an argument to the SMACseInitialize function (see Initialization).

Initialization and Finalization of the DMP Interface Implementation

Provide an implementation of the SMACseDmpInitialize interface. This function gets called at the start of the coupled simulation. It should duplicate your application’s MPI_COMM and initialize any parameters for your DMP interface implementations. The SMACseDmpInitialize function takes no arguments.

Provide an implementation of the SMACseDmpFinalize interface. This function gets called at the end of the coupled simulation. It should clean-up memory, if any, used by your DMP implementation. The SMACseDmpFinalize function takes no arguments.

Get the Process Rank and Number of Processes

Provide an implementation of the SMACseDmpGetRank interface. This function returns the rank of the process from which it is called. The SMACseDmpGetRank function takes no arguments.

Provide an implementation of the SMACseDmpGetNumCpus interface. This function returns the number of CPUs used by the application. The SMACseDmpGetNumCpus function takes no arguments.

Non-Blocking Point-to-Point Send and Receive

Provide an implementation of the SMACseDmpIsend interface. This function corresponds to the non-blocking point-to-point send, MPI_Isend. The SMACseDmpIsend function takes the following arguments:

iBuff
Address of send buffer.
iCount
Number of elements in send buffer.
iDatatype
Datatype enumerator.
iDest
Rank of destination.
iTag
Message tag.
oRequest
Request handle.
The SMACseDmpIsend function returns 0 if OK; otherwise, it returns 1.

Provide an implementation of the SMACseDmpIrecv interface. This function corresponds to the non-blocking point-to-point receive, MPI_Irecv. The SMACseDmpIrecvfunction takes the following arguments:

iBuff
Address of receive buffer.
iCount
Number of elements in send buffer.
iDatatype
Datatype enumerator.
iSource
Source rank.
iTag
Message tag.
oRequest
Request handle.
The SMACseDmpIrecv function returns 0 if OK; otherwise, it returns 1.

Blocking Point-to-Point Send and Receive

Provide an implementation of the SMACseDmpSend interface. This function corresponds to the blocking point-to-point send, MPI_Send. The SMACseDmpSend function takes the following arguments:

iBuff
Address of send buffer.
iCount
Number of elements in send buffer.
iDatatype
Datatype enumerator.
iDest
Rank of destination.
iTag
Message tag.
The SMACseDmpSend function returns 0 if OK; otherwise, it returns 1.

Provide an implementation of the SMACseDmpRecv interface. This function corresponds to the blocking point-to-point receive, MPI_Recv. The SMACseDmpRecv function takes the following arguments:

iBuff
Address of receive buffer.
iCount
Number of elements in send buffer.
iDatatype
Datatype enumerator.
iSource
Source rank.
iTag
Message tag.
oStat
Status.
The SMACseDmpRecv function returns 0 if OK; otherwise, it returns 1.

Additional MPI Functions for Testing Blocking and Non-Blocking Tasks

Provide an implementation of the SMACseDmpIprobe interface. This function corresponds to the non-blocking test, MPI_IProbe. The SMACseDmpIprobe function takes the following arguments:

iSource
Source rank or CSEDMP_ANY_SOURCE .
iTag
Tag value or CSEDMP_ANY_TAG .
oFlag
Equal to 1 if a message with the specified tag received.
oStat
Status.

Provide an implementation of the SMACseDmpTestall interface. This function tests for the completion of all previously initiated requests, MPI_Testall. The SMACseDmpTestall function takes the following arguments:

iCount
List length.
iReqIndxs
Array of requests.
oFlags
Equal to 1 if all requests have been completed.
oStat
Status.

Provide an implementation of the SMACseDmpWaitall interface. This function waits for the completion of all previously initiated requests, MPI_Waitall. The SMACseWaitall function takes the following arguments:

iCount
List length.
iReqIndxs
Array of requests.
oStat
Status.

Broadcast, Gather, and Reduce

Provide an implementation of the SMACseDmpBcast interface. This function broadcasts a message from the process with rank "root" to all other processes on the communicator, MPI_Bcast. The SMACseDmpBcast function takes the following arguments:

ioBuff
Buffer address.
iCount
Number of elements in send buffer.
iDatatype
Datatype enumerator.
iRoot
Rank of broadcast root.

Provide an implementation of the SMACseDmpGather interface. This function gathers data from every process on the root process. The SMACseDmpGather function takes the following arguments:

iSendBuff
Send buffer address.
iSendCount
Number of elements in send buffer.
iSendtype
Send datatype enumerator.
oRecvBuff
Starting address of the receive buffer on the root process.
iRecvCount
Number of elements in the receive buffer.
iRecvType
Receive datatype enumerator.
iRoot
Rank where the message is received.

Provide an implementation of the SMACseDmpAllGather interface. This function gathers data on all ranks. The SMACseDmpAllGather function takes the following arguments:

iSendBuff
Send buffer address.
iSendCount
Number of elements in the send buffer.
iSendtype
Send datatype enumerator.
oRecvBuff
Starting address of the receive buffer on the root process.
iRecvCount
Number of elements in the receive buffer.
iRecvType
Receive datatype enumerator.

Provide an implementation of the SMACseDmpReduce interface. This function reduces a message at the "root", MPI_Reduce. The SMACseDmpReduce function takes the following arguments:

iBuff
Send buffer address.
oBuff
Receive buffer address.
iCount
Number of elements in the send buffer.
iDatatype
Datatype enumerator.
iOp
Operation enumerator.
iRoot
Rank where message is reduced.