Get_last_MPI Function

public function Get_last_MPI(comm) result(last)

Arguments

Type IntentOptional Attributes Name
integer, optional :: comm

Return Value logical


Calls

proc~~get_last_mpi~~CallsGraph proc~get_last_mpi Get_last_MPI mpi_comm_rank mpi_comm_rank proc~get_last_mpi->mpi_comm_rank mpi_comm_size mpi_comm_size proc~get_last_mpi->mpi_comm_size

Source Code

  function Get_last_MPI(comm) result(last)
    integer,optional :: comm
    integer          :: comm_
    integer          :: size
    integer          :: rank
    logical          :: last
    comm_=MPI_COMM_WORLD;if(present(comm))comm_=comm
    if(comm_/=Mpi_Comm_Null)then
       call MPI_Comm_rank(comm_,rank,ierr)
       call MPI_Comm_size(comm_,size,ierr)    
       last=.false.
       if(rank==size-1)last=.true.
    else
       last=.false.
    endif
  end function Get_last_MPI