Back to OASIS4 home

Routine psmile_io_init_pelist (ierror)
Subroutine that creates a PE list for each component in order to let the MPP IO package distinguishes model component code.

pelist must be defined with same info on all component pes ; it must be dimensionned with the number of pes having an active grid (which can be < npes)
it must contain the rank in the application communicator Appl%comm of pes having an active grid.
it is enough to have one active grid on the pe : MPP_IO does not need to know the total active grids on the pe, MPP_IO only needs to have the number of pe with a grid.

call psmile_io_derive_pelist => to define IO_Comps_infos(id_comp_id)%pelist
(1:act_size)
id_comm_appl = Appl%comm
call MPI_Comm_group(id_comm_appl,appl_grp,ierror) : return the group attached to the id_comm_appl communicator
call MPI_Comm_group(Comps(id_comp_id)%comm,comp_grp,ierror) : return the group attached to the id_comm_comp communicator
call MPI_Comm_rank(Comps(id_comp_id)%comm,i,ierror)
call MPI_Group_size(comp_grp,comp_grp_size,ierror)
comp_grp_ranks=(/(i-1,i=1,comp_grp_size)/)
call MPI_Group_translate_ranks(comp_grp,comp_grp_size,comp_grp_ranks ,appl_grp,appl_grp_ranks,ierror)

Then
mpp_declare_pelist :
call mpp_declare_pelist(IO_Comps_infos(id_comp_id)%pelist(1:act_size))
get a communicator to the pelist : i = get_peset(pelist)
and then give a name to the pelist peset(i)%name