|
YAC 3.13.0
Yet Another Coupler
|
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 that yac_cmpi_handshake implements can be found here.
This algorithm can be used to collectively generate the first set of communicators in a coupled run configuration. It, for example, allows to create individual communicators 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 have provided the same group name.
The default YAC initialisation routine yac_cinit first calls the MPI handshake for MPI_COMM_WORLD and provides mpi_handshake_group_name as a single group name. Afterwards it calls yac_cinit_comm with this communicator.
yac_cinit_comm requires 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 mpi_handshake_group_name. This is required in order to avoid a deadlock.
Just like yac_cinit, the routine yac_cinit_dummy will also first call the MPI handshake algorithm. However, yac_cinit_dummy will not provide the group name mpi_handshake_group_name. Consequently, these processes are not included in YAC's 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 mpi_handshake_group_name), 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 executables:
model_a.xA_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.xBB and A_a exchange data using YACB and A_b exchange data using YACmodel_c.xCC and A_a exchange data using YACmodel_d.xDD or D_io)D and C exchange data using a Coupler-libraryD and D_io communicate using MPI point-to-point communicationmodel_e.xEio.xIOIO 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.xA_a and A_ioA_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:
CThe components of this executable require the following communicators:
model_d.xD 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.