Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Clarify output message on MPI_THREAD_MULTIPLE
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-petersen committed May 2, 2017
1 parent f37f79d commit edcb4b4
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/framework/mpas_dmpar.F
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ subroutine mpas_dmpar_init(dminfo, mpi_comm)!{{{
#ifdef MPAS_OPENMP
desiredThreadLevel = MPI_THREAD_MULTIPLE
call MPI_Init_thread(desiredThreadLevel, threadLevel, mpi_ierr)
if ( threadLevel /= desiredThreadLevel ) then
write(0, *) 'WARNING: In mpas_dmpar_init, MPI implementation gave thread level of ', &
threadLevel, ' when ', desiredThreadLevel, ' was requested.'
end if
#else
call MPI_Init(mpi_ierr)
#endif
Expand All @@ -261,7 +257,25 @@ subroutine mpas_dmpar_init(dminfo, mpi_comm)!{{{
dminfo % my_proc_id = mpi_rank

dminfo % info = MPI_INFO_NULL

#ifdef MPAS_OPENMP
if ( mpi_rank==0 ) then
write(0, *) 'In mpas_dmpar_init: OpenMP threads per MPI task, thread level setting: '
write(0, '(a,i2,a)') ' requested thread level: MPI_THREAD_MULTIPLE (',desiredThreadLevel, ')'
if ( threadLevel == MPI_THREAD_SINGLE ) then
write(0, '(a,i2,a)') ' actual thread level: MPI_THREAD_SINGLE (',threadLevel, ')'
elseif ( threadLevel == MPI_THREAD_FUNNELED ) then
write(0, '(a,i2,a)') ' actual thread level: MPI_THREAD_FUNNELED (',threadLevel, ')'
elseif ( threadLevel == MPI_THREAD_SERIALIZED ) then
write(0, '(a,i2,a)') ' actual thread level: MPI_THREAD_SERIALIZED (',threadLevel, ')'
elseif ( threadLevel == MPI_THREAD_MULTIPLE ) then
write(0, '(a,i2,a)') ' actual thread level: MPI_THREAD_MULTIPLE (',threadLevel, ')'
end if
end if
#endif

#else
! Set up single processor run, no MPI.
dminfo % comm = 0
dminfo % my_proc_id = IO_NODE
dminfo % nprocs = 1
Expand Down

0 comments on commit edcb4b4

Please sign in to comment.