private function comm_split_by_color(this, color) result(new_comm)
Partitions the communicator into disjoint subgroups based on color.
Processes with the same color end up in the same new communicator.
Type Bound
comm_t
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
class(comm_t),
|
intent(in) |
|
|
:: |
this |
|
|
integer,
|
intent(in) |
|
|
:: |
color |
|
Return Value
type(comm_t)
Variables
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
integer(kind=int32),
|
private |
|
:: |
ierr |
|
|
|
|
type(MPI_Comm),
|
private |
|
:: |
mpi_comm_new |
|
|
|
Source Code
function comm_split_by_color(this, color) result(new_comm)
!! Partitions the communicator into disjoint subgroups based on color.
!! Processes with the same color end up in the same new communicator.
class(comm_t), intent(in) :: this
integer, intent(in) :: color
type(comm_t) :: new_comm
type(MPI_Comm) :: mpi_comm_new
integer(int32) :: ierr
! Every split of one rank is that rank.
new_comm = this
end function comm_split_by_color