YetAnotherCoupler 3.5.2
|
YAC provides three routines for the initialisation of YAC (only C-Versions are listed here):
And two dummy initialisation routines:
A detailed description of the MPI handshake algorithm can be found here.
This algorithm can be used to collectively generate the first set of communicators in a coupled run configuration. For example one communicator for each executable or for groups of executables.
The algorithm takes an array of group names as input and returns an array of communicators. Each of these communicators contains all processes that provided the same group name.
The default YAC initialisation routine first calls the MPI handshake for MPI_COMM_WORLD
and provides "yac"
as group name. Afterwards it calls yac_cinit_comm with this communicator.
This initialisation routine takes an MPI communicator as input. All processes in this communicator have to call a YAC initialisation routine.
If any process in MPI_COMM_WORLD
calls yac_cinit, the communicator passed to yac_cinit_comm has to be generated by the MPI handshake algorithm and the group name for this communicator has to be "yac"
. This is required in order to avoid a deadlock.
As yac_cinit, the routine yac_cinit_dummy will also first call the MPI handshake algorithm. However, it will not provide the group name "yac"
. Therefore, these processes are not included in the YAC communicator and cannot call any other YAC routines, except for yac_cfinalize. The call to yac_cfinalize is only required, if MPI was not initialised before the call to yac_cinit_dummy.
This routine is useful for processes that want to exclude themselves from the coupling by YAC.
If a process is part of a YAC communicator (generated by the MPI handshake algorithm using the group name "yac"
), it can still exclude itself from using YAC by calling yac_cinit_comm_dummy and provide this communicator.
The following is an example for a coupled run configuration:
This configuration contains four different executable:
model_a.x
A_a
, A_b
, or A_io
)A_a
and A_b
exchange data using YACA_a
and A_io
exchange data using the communication library yaxtmodel_b.x
B
B
and A_a
exchange data using YACB
and A_b
exchange data using YACmodel_c.x
C
C
and A_a
exchange data using YACmodel_d.x
D
D
or D_io
)D
and C
exchange data using a Coupler-libraryD
and D_io
communicate using MPI point-to-point communicationmodel_e.x
E
io.x
IO
IO
and C
exchange data using an IO-libraryThe generation of the MPI communicator and the initialisation of all libraries can be implemented as follows.
The components of this executable require the following communicators:
model_a.x
A_a
and A_io
A_a
, A_b
, or A_io
respectivelyThe component of this executable requires the following communicator:
B
(The communicator yac_comm
is not required, because all communication with model_a.x
is done through YAC.)
The component of this executable requires the following communicator:
C
The components of this executable require the following communicators:
model_d.x
D
or D_io
respectivelyThe components of this executable does not require any communicators.
The component of this executable requires the following communicator:
Alternatively, if libio
supports the same handshake algorithm, no additional communicator has to be generated.