Back to OASIS4 home

Routine prismdrv_init_appl (id_err)
Subroutine "PRISMDrv_Init_appl" sets the computational context of the different applications in MPI1 such as the communicators, and spawn these applications in MPI2 and set the context.

scheme

MPI1
Duplicate MPI_COMM_WORLD to create the global communicator : comm_drv_global
Duplicate the global communicator to Get the transformer comm : comm_drv_trans
Get protocol version for communication between the coupler and the models (applications)
Number of applications and components is distributed to all processes. The data is sent by the root of the coupler processes.

Number of processes per application is distributed to all process
Broadcast names of applications
Broadcast names of components
Broadcast the number of components of all applications
Broadcast the rank sets for all the components
Broadcast redirect stdout info for all applications
Define the local communicators => prismdrv_def_mpi_comm
Determine the local application rank in the local communicator comm_drv_local constructed in prismdvr_def_mpi_comm (has already been defined in prismdrv_init, but it was the global rank)

ALLOCATE(Drv_Procs(il_size), stat = id_err)
      DO ib = 0, il_size - 1
!       if rank does not belong to a driver process
        IF ((ib < PRISMdrv_root) .OR. ((PRISMdrv_root + ig_driver_nb_pes) <= ib)) THEN
          IF ( Drv_Procs(ib+1)%comps_per_rank > 0 ) THEN
             ALLOCATE(Drv_Procs(ib+1)%comp_name(Drv_Procs(ib+1)%comps_per_rank))
             ALLOCATE(Drv_Procs(ib+1)%global_rank(Drv_Procs(ib+1)%comps_per_rank))
             ALLOCATE(Drv_Procs(ib+1)%global_comp_id(Drv_Procs(ib+1)%comps_per_rank))
          ENDIF
        ENDIF


MPI2