69 SUBROUTINE mpl_init(KOUTPUT,KUNIT,KERROR,KPROCS,LDINFO,LDENV)
71 #ifdef USE_8_BYTE_WORDS 73 mpi_initialized => mpi_initialized8, mpi_init => mpi_init8, &
74 mpi_comm_size => mpi_comm_size8, mpi_comm_rank => mpi_comm_rank8, &
75 mpi_bcast => mpi_bcast8
80 INTEGER(KIND=JPIM),
INTENT(IN),
OPTIONAL :: KOUTPUT,KUNIT
81 INTEGER(KIND=JPIM),
INTENT(OUT),
OPTIONAL :: KERROR,KPROCS
82 LOGICAL,
INTENT(IN),
OPTIONAL :: LDINFO,LDENV
83 INTEGER(KIND=JPIM) :: IERROR,IP,ICOMM,IRANK,JNODE,JROC,ISTA
84 INTEGER(KIND=JPIM) :: IMAX_THREADS, IRET, IROOT, INUM(2), ICOUNT
85 INTEGER(KIND=JPIM) :: IREQUIRED,IPROVIDED
86 INTEGER(KIND=JPIM) :: IWORLD_RANK, IWORLD_SIZE
87 LOGICAL :: LLABORT=.true., llinfo
90 CHARACTER(LEN=12) :: CL_MBX_SIZE
91 CHARACTER(LEN=12) :: CL_ARCH
92 CHARACTER(LEN=12) :: CL_TASKSPERNODE
93 CHARACTER(LEN=1024) :: CLENV
94 CHARACTER(LEN=20) :: CL_METHOD,CL_HOST
96 IF(
PRESENT(koutput))
THEN 102 IF(
PRESENT(kunit))
THEN 108 IF(
PRESENT(ldinfo))
THEN 114 IF(
PRESENT(ldenv))
THEN 130 IF(
PRESENT(kerror))
THEN 133 IF(
PRESENT(kprocs))
THEN 139 CALL mpi_initialized(llinit, iret)
141 IF (llinit == 0)
THEN 143 CALL get_environment_variable(
'ARCH',cl_arch)
147 IF(cl_arch(1:10)==
'ibm_power6')
THEN 155 irequired = mpi_thread_multiple
156 iprovided = mpi_thread_single
157 CALL mpi_init_thread(irequired,iprovided,ierror)
160 CALL mpi_init(ierror)
166 IF(cl_arch(1:10)==
'ibm_power4')
THEN 180 IF(
PRESENT(kerror))
THEN 184 CALL mpl_message(ierror,cdmessage=
' MPL_INIT ERROR ',ldabort=llabort)
190 IF(
PRESENT(kprocs))
THEN 199 CALL mpi_comm_rank(
mpl_comm, irank, ierror)
202 llinfo = llinfo .AND. (
mpl_rank <= 1)
206 WRITE(
mpl_unit,
'(A)')
'MPL_INIT : LMPLUSERCOMM used' 209 WRITE(
mpl_unit,
'(A)')
'MPL_INIT : LMPLUSERCOMM not used' 234 CALL mpi_bcast(inum(1),2,int(mpi_integer),iroot,
mpl_comm,ierror)
239 CALL mpi_bcast(clenv,icount,int(mpi_byte),iroot,
mpl_comm,ierror)
241 IF (inum(2) == 1)
THEN 267 DO ip=ista,imax_threads
276 CALL get_environment_variable(
'VPP_MBX_SIZE',cl_mbx_size)
277 IF(cl_mbx_size ==
' ')
THEN 278 CALL get_environment_variable(
'MPL_MBX_SIZE',cl_mbx_size)
280 IF(cl_mbx_size /=
' ')
THEN 283 IF (llinfo)
WRITE(
mpl_unit,
'(A)')
'MPL_INIT : MPL_METHOD=JP_BLOCKING_STANDARD' 304 CALL get_environment_variable(
'MPL_METHOD',cl_method)
305 IF (cl_method ==
'JP_BLOCKING_STANDARD' )
THEN 312 CALL get_environment_variable(
'MPL_MBX_SIZE',cl_mbx_size)
313 IF (cl_mbx_size /=
' ')
THEN 316 IF (cl_method ==
'JP_BLOCKING_STANDARD' )
THEN 317 IF (llinfo)
WRITE(
mpl_unit,
'(A)')
'MPL_INIT : MPL_METHOD=JP_BLOCKING_STANDARD' 319 IF (llinfo)
WRITE(
mpl_unit,
'(A)')
'MPL_INIT : MPL_METHOD=JP_BLOCKING_BUFFERED' 328 CALL mpi_comm_rank (mpi_comm_world, iworld_rank, ierror)
329 CALL mpi_comm_size (mpi_comm_world, iworld_size, ierror)
330 CALL linux_bind (iworld_rank, iworld_size)
334 CALL get_environment_variable(
'EC_TASKS_PER_NODE',cl_taskspernode)
335 IF (cl_taskspernode(1:1) ==
' ' )
THEN 336 CALL get_environment_variable(
'HOST',cl_host)
337 IF (cl_host(1:2) ==
'c1')
THEN 339 ELSEIF(cl_host(1:3) ==
'hpc')
THEN 341 ELSEIF(cl_host(1:2) ==
'cc')
THEN 345 IF(llinfo)
WRITE(
mpl_unit,
'(A)')
'MPL_INIT CAUTION: MPL_NCPU_PER_NODE=1'
void ec_strenv(const int *i, char *value, const int valuelen)
subroutine, public mpl_message(KERROR, CDMESSAGE, CDSTRING, LDABORT)
void ec_putenv(const char *s, int slen)
integer(kind=jpim) mplusercomm
integer(kind=jpim), parameter jp_blocking_buffered
integer(kind=jpim) mpl_mynode
integer(kind=jpim) mpl_numproc
subroutine, public mpl_buffer_method(KMP_TYPE, KMBX_SIZE, KERROR, KPROCIDS, LDINFO)
integer(kind=jpim), dimension(:,:), allocatable mpl_node_tasks
subroutine, public mpl_locomm_create(N, KCOMM)
integer(kind=jpim), dimension(:), allocatable mpl_node
integer(kind=jpim), dimension(:), allocatable mpl_task_per_node
integer(kind=jpim) mpl_nnodes
integer(kind=jpim), dimension(:), allocatable mpl_comm_oml
subroutine ec_cray_meminfo(IU, IDSTRING, KCOMM)
integer(kind=jpim), parameter jp_blocking_standard
integer(kind=jpim) mpl_max_task_per_node
integer(kind=jpim) mpl_ncpu_per_node
subroutine, public mpl_init(KOUTPUT, KUNIT, KERROR, KPROCS, LDINFO, LDENV)
subroutine, public mpl_tour_table(KOPPONENT, KEVEN)
void ec_overwrite_env(int *do_overwrite)
integer(kind=jpim) function, public mpl_iargc()
integer(kind=jpim) mpl_comm
integer(kind=jpim), dimension(:), allocatable mpl_opponent
integer(kind=jpim) mpl_rank
integer(kind=jpim) mpl_mbx_size
integer(kind=jpim) mpl_method
integer(kind=jpim) function, public oml_max_threads()
integer(kind=jpim), dimension(:), allocatable mpl_ids
integer(kind=jpim) mpl_unit
void ec_putenv_nooverwrite(const char *s, int slen)
subroutine, public oml_init()
integer(kind=jpim) mpl_output