[Q-e-developers] introduce a parallel communicator derived data type ?
stefano de gironcoli
degironc at sissa.it
Sun Aug 6 17:55:30 CEST 2017
Dear All,
I would like to in introduce a Parallel Communicator derived data type.
The aim would be to make the information associated to the different
parallelization levels more structured and uniform. They already look
all the same (see intra_image_comm/inter_image_comm,
intra_pool_comm/inter_pool_comm, intra_bgrp_comm/inter_bgrp_comm,...)
but this is obtained by quite bit of code duplication and if a
new/different parallelization level is desired one needs to write more
almost identical code and double check in many places.
The parallel communicator data type would allow, in future, to pass
the communicator as argument of the routines so making the
parallelization level easily 'local' to the routine that would help
disentangling the different parallelization levels and possibly
introduce them when needed rather than all at the beginning.
I don't know how much this will be possible/desirable but with the
current structure it is clearly impossible.
Anyhow, since this is going to have an impact on the distribution at
all levels I would like to have a preliminary feedback.
In particular if you see compelling reasons NOT to take such a path !
best,
stefano
PS: the derived data type would look something like this
TYPE pcomm_type
CHARACTER(len=35) :: label ! the name of this
parallelization level
INTEGER :: parent_comm = 0 ! the parent communicator from
which it originates
INTEGER :: intra_comm = 0 ! intra group communicator
INTEGER :: inter_comm = 0 ! inter group communicator
INTEGER :: ngroups = 1 ! number of created groups
INTEGER :: nproc = 1 ! number of processors per group
INTEGER :: parent_nproc = 1 ! number of processors of the
parent communicator
INTEGER :: my_group_id = 0 ! which of the created groups
this proc belongs to
INTEGER :: mype = 0 ! the index (rank) of the
processor inside its group
INTEGER :: mype_in_parent_comm = 0 ! should be clear by the name
INTEGER :: root_group_id = 0 ! the group_id of the root
group (it's always 0 as root is the first by def)
INTEGER :: root = 0 ! the index (rank) of the root
processor inside the group (it's always 0)
END TYPE pcomm_type
More information about the developers
mailing list