From 5d36f1b8d82b28eb4db73b0692a79df53d38784a Mon Sep 17 00:00:00 2001 From: "ukmo-chris.bunney" Date: Wed, 21 Feb 2024 17:03:59 +0000 Subject: [PATCH 1/2] Added screen output showing number of threads when OMP enabled. --- model/src/ww3_multi.F90 | 13 +++++++++++++ model/src/ww3_shel.F90 | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/model/src/ww3_multi.F90 b/model/src/ww3_multi.F90 index 39a6b5bf3..e3101b7c2 100644 --- a/model/src/ww3_multi.F90 +++ b/model/src/ww3_multi.F90 @@ -91,6 +91,9 @@ PROGRAM W3MLTI !/ USE WMMDATMD, ONLY: MDSI, MDSO, MDSS, MDST, MDSE, & NMPROC, IMPROC, NMPSCR, NRGRD, ETIME +#ifdef W3_OMPG + USE OMP_LIB +#endif !/ IMPLICIT NONE ! @@ -144,6 +147,12 @@ PROGRAM W3MLTI #ifdef W3_OMPH IF ( IMPROC .EQ. NMPSCR ) WRITE (*,905) & MPI_THREAD_FUNNELED, THRLEV +#endif + ! +#ifdef W3_OMPG + IF( IMPROC .EQ. NMPSCR ) THEN + WRITE(*,906) omp_get_max_threads() + ENDIF #endif ! !/ ------------------------------------------------------------------- / @@ -210,6 +219,10 @@ PROGRAM W3MLTI 905 FORMAT ( ' Hybrid MPI/OMP thread support level:'/ & ' Requested: ', I2/ & ' Provided: ', I2/ ) +#endif + ! +#ifdef W3_OMPG +906 FORMAT ( ' OMP threading enabled. Number of threads: ', I3 / ) #endif ! 999 FORMAT(//' End of program '/ & diff --git a/model/src/ww3_shel.F90 b/model/src/ww3_shel.F90 index d7e9790bb..a92cdfabc 100644 --- a/model/src/ww3_shel.F90 +++ b/model/src/ww3_shel.F90 @@ -304,6 +304,10 @@ PROGRAM W3SHEL #endif ! USE W3NMLSHELMD + +#ifdef W3_OMPG + USE OMP_LIB +#endif IMPLICIT NONE ! #ifdef W3_MPI @@ -481,6 +485,7 @@ PROGRAM W3SHEL #ifdef W3_OMPH ENDIF #endif + #ifdef W3_MPI MPI_COMM = MPI_COMM_WORLD #endif @@ -583,6 +588,11 @@ PROGRAM W3SHEL MPI_THREAD_FUNNELED, THRLEV #endif ! +#ifdef W3_OMPG + IF(IAPROC .EQ. NAPOUT) THEN + WRITE(NDSO, 906) omp_get_max_threads() + ENDIF +#endif ! ! 1.b For WAVEWATCH III (See W3INIT) @@ -2734,6 +2744,10 @@ PROGRAM W3SHEL 905 FORMAT ( ' Hybrid MPI/OMP thread support level:'/ & ' Requested: ', I2/ & ' Provided: ', I2/ ) +#endif + ! +#ifdef W3_OMPG +906 FORMAT ( ' OMP threading enabled. Number of threads: ', I3 / ) #endif 920 FORMAT (/' Input fields : '/ & ' --------------------------------------------------') From b249df17ae733fc68e209a369ea3f6abdee53a33 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Thu, 29 Feb 2024 04:41:40 -0500 Subject: [PATCH 2/2] update build to get more info in logs (#46) --- regtests/bin/run_cmake_test | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index 844f3e23e..993745060 100755 --- a/regtests/bin/run_cmake_test +++ b/regtests/bin/run_cmake_test @@ -435,21 +435,21 @@ then echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? if [[ $rc -ne 0 ]] ; then echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 rc=$? if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile" @@ -468,20 +468,20 @@ then \cp -f $file_c $path_build/switch echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? if [[ $rc -ne 0 ]] ; then echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile" @@ -507,20 +507,20 @@ else fi echo "Switch file is $path_build/switch with switches:" >> $ofile cat $path_build/switch >> $ofile - cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install > $ofile 2>&1 + cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1 rc=$? if [[ $rc -ne 0 ]] ; then echo "Fatal error in cmake." echo "The build log is in $ofile" exit fi - make -j 8 > $ofile 2>&1 + make -j 8 VERBOSE=1 >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make." echo "The build log is in $ofile" exit fi - make install > $ofile 2>&1 + make install >> $ofile 2>&1 if [[ $rc -ne 0 ]] ; then echo "Fatal error in make install." echo "The build log is in $ofile"