scope Subroutine

public subroutine scope(focus)

Switch the module communicator (and size/rank variables) between different scopes.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: focus

Which scope to use. Should be one of allprocs, multigs2procs, subprocs. Other values are equivalent to subprocs


Contents

Source Code


Source Code

  subroutine scope (focus)
    !> Which scope to use. Should be one of [[allprocs]], [[multigs2procs]],
    !> [[subprocs]]. Other values are equivalent to [[subprocs]]
    integer, intent (in) :: focus
# ifdef MPI
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
    if (focus == allprocs) then
       mp_comm => comm_all
       nproc => ntot_proc
       iproc => aproc
       proc0 => aproc0
    else if (focus == multigs2procs) then
       mp_comm => comm_multigs2
       nproc => mulntot_proc
       iproc => mulproc
       proc0 => mulproc0
    else
       mp_comm => comm_group
       nproc => ngroup_proc
       iproc => gproc
       proc0 => gproc0
    end if
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
# else
    UNUSED_DUMMY(focus)
# endif
  end subroutine scope