|
subroutine | mpifx_comm_init (self, commid, error) |
| Initializes a communicator to contain all processes.
|
|
subroutine | mpifx_comm_split (self, splitkey, rankkey, newcomm, error) |
| Creates a new communicators by splitting the old one.
|
|
subroutine | mpifx_comm_split_type (self, splittype, rankkey, newcomm, error) |
| Creates a new communicator by splitting the old one applying a given split type.
|
|
subroutine | mpifx_comm_free (self) |
| Frees the MPI communicator.
|
|
Contains the extended MPI communicator.
subroutine mpifx_comm_module::mpifx_comm_split |
( |
class(mpifx_comm), intent(inout) | self, |
|
|
integer, intent(in) | splitkey, |
|
|
integer, intent(in) | rankkey, |
|
|
class(mpifx_comm), intent(out) | newcomm, |
|
|
integer, intent(out), optional | error ) |
|
private |
Creates a new communicators by splitting the old one.
- Parameters
-
self | Communicator instance. |
splitkey | Key for the splitting. Processes invoking the routine with the same value for splitkey will be belong to the same communicator. |
rankkey | Is used to determine the rank of the process in its new communicator. Processes calling the routine with a higher value will have a higher rank in the new communicator. |
newcomm | New communicator for the given process. |
error | Optional error code on return. |
Example:
program test_split
use libmpifx_module
implicit none
type(mpifx_comm) :: allproc, groupproc
integer :: groupsize, mygroup
call mpifx_init()
call allproc%init()
groupsize = allproc%size / 2
mygroup = allproc%rank / groupsize
call allproc%split(mygroup, allproc%rank, groupproc)
write(*, "(3(A,1X,I0,1X))") "ID:", allproc%rank, "SUBGROUP", &
& mygroup, "SUBGROUP ID", groupproc%rank
call mpifx_finalize()
end program test_split
- See also
- MPI documentation (
MPI_COMM_SPLIT
)
subroutine mpifx_comm_module::mpifx_comm_split_type |
( |
class(mpifx_comm), intent(inout) | self, |
|
|
integer, intent(in) | splittype, |
|
|
integer, intent(in) | rankkey, |
|
|
class(mpifx_comm), intent(out) | newcomm, |
|
|
integer, intent(out), optional | error ) |
|
private |
Creates a new communicator by splitting the old one applying a given split type.
- Parameters
-
self | Communicator instance. |
splittype | Determines which ranks to be grouped together. In MPI 3.0, this can only be MPI_COMM_TYPE_SHARED grouping all MPI ranks together that can share memory (usually on a node). |
rankkey | Is used to determine the rank of the process in its new communicator. Processes calling the routine with a higher value will have a higher rank in the new communicator. |
newcomm | New communicator for the given process. |
error | Optional error code on return. |
Example:
program test_split_type
use libmpifx_module
implicit none
type(mpifx_comm) :: allproc, splitproc
call mpifx_init()
call allproc%init()
call allproc%split_type(MPI_COMM_TYPE_SHARED, allproc%rank, splitproc)
write(*, "(2(A,1X,I0,1X))") "ID:", allproc%rank, "SPLIT ID", splitproc%rank
call mpifx_finalize()
end program test_split_type
- See also
- MPI documentation (
MPI_COMM_SPLIT_TYPE
)