mp_get_processor_name Subroutine

public subroutine mp_get_processor_name(procname, resultlen)

Get a unique specifier for the actual (as opposed to virtual) node (MPI 2.1)

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(out) :: procname

Name of processor, declared as CHARACTER(LEN=mp_max_processor_name)

integer, intent(out), optional :: resultlen

Length (in characters) of procname (INTEGER)


Contents

Source Code


Source Code

   SUBROUTINE mp_get_processor_name(procname, resultlen)
      !! Get a unique specifier for the actual (as opposed to virtual) node (MPI 2.1)

      CHARACTER(LEN=*), INTENT(OUT)                      :: procname
         !! Name of processor, declared as CHARACTER(LEN=mp_max_processor_name)
      INTEGER, OPTIONAL, INTENT(OUT)                     :: resultlen
         !! Length (in characters) of procname (INTEGER)

#if defined(__parallel)
      INTEGER                                            :: namelen, ierr

      CALL mpi_get_processor_name(procname, namelen, ierr)
      IF (ierr .EQ. 0) THEN
         IF (PRESENT(resultlen)) resultlen = namelen
      ELSE
#endif
         CALL m_hostnm(procname)
         IF (PRESENT(resultlen)) resultlen = LEN_TRIM(procname)
#if defined(__parallel)
      END IF
#endif
   END SUBROUTINE mp_get_processor_name