Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF OpenMp b4b #160

Merged
merged 20 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c471cda
Updating to latest upstream (NOAA-EMC/WW3).
ajhenrique Jun 10, 2019
5acd9d2
Revert "Updating to latest upstream (NOAA-EMC/WW3)."
ajhenrique Jun 10, 2019
a939155
Merge remote-tracking branch 'upstream/develop' into develop
ajhenrique Jun 10, 2019
a6cf904
Merge remote-tracking branch 'upstream/develop' into develop. 20190625
ajhenrique Jun 25, 2019
818a52f
Merge remote-tracking branch 'upstream/develop' commit 4bacd02 into a…
ajhenrique Oct 10, 2019
951aafa
Merge remote-tracking branch 'upstream/develop' into develop
ajhenrique Oct 22, 2019
76bb054
Merge remote-tracking branch 'upstream/develop' into develop
ajhenrique Dec 3, 2019
f0d3f39
Merge remote-tracking branch 'upstream/develop' into develop
ajhenrique Jan 26, 2020
8d624d8
Including additional variables in PRIVATE OMP declaration in attempt …
ajhenrique Jan 26, 2020
01048f7
Adding changes to several modules with OpenMP loops to declare proper…
ajhenrique Feb 2, 2020
fb2b47b
Creating mutually-exclusive condition in make_makefile.sh for OMPH an…
Feb 3, 2020
6ac47b7
Deleting deprecated NB=NK statement in w3iogomd.
Feb 3, 2020
b377677
Reverting back commented line to activate proper FLOMP behavior in w3…
Feb 3, 2020
e8e0ac7
Modified w3adc.f to enable processing of multiple switches on a singl…
ukmo-ccbunney Feb 3, 2020
456edd6
Revert "Creating mutually-exclusive condition in make_makefile.sh for…
ajhenrique Feb 3, 2020
d4dc8c6
Merge pull request #3 from ukmo-waves/fb_ad3_multisw
ajhenrique Feb 4, 2020
d964743
Update w3iogomd.ftn
ajhenrique Feb 4, 2020
4749310
Update w3iogomd.ftn
ajhenrique Feb 4, 2020
74b4585
Final changes to attend reviewer requirements.
ajhenrique Feb 10, 2020
ec810ad
Update w3uqckmd.ftn
ajhenrique Feb 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manual/impl/switch.tex
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ \subsubsection{~Optional switches} \label{sub:opt_switch}
\sit{ompx}{Idem, but for directives used only for exclusive OpenMP
parallelization.}
\sit{omph}{Idem, but for directives used only for hybrid MPI-OpenMP
parallelization.}
parallelization. Note that when using OMPH the test switch T1 cannot be used.}
\sit{pdlib}{Domain Decomposition for Explicit and Implicit Solver on triangular unstructured grids. ({\code ParMetis} is required for this option)}
\end{slist}
Note that these switches can only be used in certain combinations, as enforced
Expand Down
53 changes: 17 additions & 36 deletions model/bin/make_makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
shared mpp mpiexp thread GSE prop \
stress s_ln source stab s_nl snls s_bot s_db miche s_tr s_bs \
dstress s_ice s_is reflection s_xx \
wind windx wcor rwind curr currx mgwind mgprop mggse \
wind windx rwind curr currx mgwind mgprop mggse \
subsec tdyn dss0 pdif tide refrx ig rotag arctic nnt mprf \
cou oasis agcm ogcm igcm trknc setup pdlib memck uost rstwind
cou oasis agcm ogcm igcm trknc setup pdlib memck uost dbtest
do
case $type in
#sort:mach:
Expand Down Expand Up @@ -163,6 +163,11 @@
ID='directive controlled threading'
TS='OMP'
OK='OMPG OMPX OMPH' ;;
#sort:dbtest:
dbtest ) TY='upto1'
ID='test for T1 conflict eith OMPH'
TS='T1'
OK='T1' ;;
#sort:GSE:
GSE ) TY='one'
ID='GSE aleviation'
Expand Down Expand Up @@ -247,23 +252,11 @@
windx ) TY='one'
ID='wind interpolation in space'
OK='WNX0 WNX1 WNX2' ;;
#sort:wcor:
wcor ) TY='upto1'
ID='wind speed correction'
TS='WCOR'
OK='WCOR' ;;
#sort:rwind:
rwind ) TY='upto1'
ID='wind vs. current definition'
TS='RWND'
OK='RWND' ;;

#sort:rstwind:
rstwind ) TY='upto1'
ID='wind in restart for wmesmf'
TS='WRST'
OK='WRST' ;;

#sort:curr:
curr ) TY='one'
ID='current interpolation in time'
Expand Down Expand Up @@ -508,6 +501,7 @@
memck ) memck=$sw ;;
setup ) setup=$sw ;;
uost ) uost=$sw ;;
dbtest ) dbtest=$sw ;;
* ) ;;
esac
done
Expand Down Expand Up @@ -677,6 +671,14 @@
echo ' ' ; exit 11
fi

if [ "$dbtest" = 'T1' ] && [ "$thread2" = 'OMPH' ]
then
echo ' '
echo " *** !/T1 cannot be used in combination with !/OMPH"
echo " Remove OMPH if desire is to test T1 GRINFO."
echo ' ' ; exit 11
fi

case $s_nl in
NL0) nl=$NULL
nlx=$NULL ;;
Expand Down Expand Up @@ -863,7 +865,6 @@
ww3_ounp ww3_gspl ww3_gint ww3_bound ww3_bounc ww3_systrk $tideprog"
progs="$progs ww3_multi_esmf ww3_uprstr"
progs="$progs libww3"
progs="$progs libww3.so"

for prog in $progs
do
Expand Down Expand Up @@ -1072,13 +1073,6 @@
source="w3triamd w3srcemd $dsx $flx $ln $st $nl $bt $ic $is $db $tr $bs $xx $refcode $igcode $uostmd"
IO='w3iogrmd w3iogomd w3iopomd w3iotrmd w3iorsmd w3iobcmd w3iosfmd w3partmd'
aux="constants w3servmd w3timemd $tidecode w3arrymd w3dispmd w3cspcmd w3gsrumd" ;;
libww3.so) IDstring='Object file archive'
core='w3fldsmd w3initmd w3wavemd w3wdasmd w3updtmd'
data='wmmdatmd w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd'
prop="$pr"
source="w3triamd w3srcemd $dsx $flx $ln $st $nl $bt $ic $is $db $tr $bs $xx $refcode $igcode $uostmd"
IO='w3iogrmd w3iogomd w3iopomd w3iotrmd w3iorsmd w3iobcmd w3iosfmd w3partmd'
aux="constants w3servmd w3timemd $tidecode w3arrymd w3dispmd w3cspcmd w3gsrumd" ;;
ww3_uprstr) IDstring='Update Restart File'
core=
data='wmmdatmd w3triamd w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd'
Expand All @@ -1098,7 +1092,7 @@
filesl="$data $core $prop $source $IO $aux"
# if program name is libww3, then
# the target is compile and create archive
elif [ "$prog" = "libww3" ] || [ "$prog" = "libww3.so" ]
elif [ "$prog" = "libww3" ]
then
d_string="$prog"' : $(aPo)/'
files="$aux $core $data $prop $source $IO"
Expand Down Expand Up @@ -1143,19 +1137,6 @@
done
echo " @cd \$(aPo); $ar_cmd $lib $objs" >> makefile
echo ' ' >> makefile
# if program name is libww3.so, then
# the target is compile and create archive
elif [ "$prog" = "libww3.so" ]
then
lib=$prog
objs=""
for file in $filesl
do
objs="$objs $file.o"
done
echo " @cd \$(aPo); ld -o $lib -shared $objs" >> makefile
echo ' ' >> makefile

else
echo ' @$(aPb)/link '"$filesl" >> makefile
echo ' ' >> makefile
Expand Down
12 changes: 6 additions & 6 deletions model/ftn/w3iogomd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@
! 2.c Finalize integration over band and update mean arrays
!
!
!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA,FACTOR,FACTOR2,KD,FKD,USSCO,M1)
!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA,FACTOR,FACTOR2,MA,MC,MB,KD,FKD,USSCO,M1)
ajhenrique marked this conversation as resolved.
Show resolved Hide resolved
!
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
Expand Down Expand Up @@ -1680,7 +1680,7 @@
!
END DO

!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA)
!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA,IX,IY,STEX,STEY,STED,ITL,IK)
!
DO JSEA=1, NSEAL
!/DIST ISEA = IAPROC + (JSEA-1)*NAPROC
Expand Down Expand Up @@ -2239,7 +2239,7 @@
!
! 6.b Loop over local sea points
!
!/OMPG/!$OMP PARALLEL DO PRIVATE(ISEA,JSEA,IX,IY,I)
!/OMPG/!$OMP PARALLEL DO PRIVATE(ISEA,JSEA,IX,IY,I,J)
!
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
Expand Down Expand Up @@ -3730,7 +3730,7 @@
!
DO ITH=1, NTH
!
!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA,FACTOR)
!/OMPG/!$OMP PARALLEL DO PRIVATE(JSEA,ISEA)
!
DO JSEA=1, NSEAL
!/DIST ISEA = IAPROC + (JSEA-1)*NAPROC
ajhenrique marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -3747,7 +3747,7 @@
!
!
!/OMPG/!$OMP PARALLEL DO
!PRIVATE(JSEA,ISEA,FACTOR,FACTOR2,KD,FKD,USSCO,M1)
!PRIVATE(JSEA,ISEA,FACTOR,FACTOR2,KD,FKD,USSCO,M1,MINDIFF,IB)
ajhenrique marked this conversation as resolved.
Show resolved Hide resolved
!
DO JSEA=1, NSEAL
!/DIST ISEA = IAPROC + (JSEA-1)*NAPROC
Expand Down Expand Up @@ -3786,11 +3786,11 @@
ENDDO
MINDIFF=1.e8
!Put spectral energey into whichever band central wavenumber fits in
NB=NK!allocated to size2*NK! STKBND_IN(NK)
USSP(JSEA,Spc2Bnd(IK)) = USSP(JSEA,Spc2Bnd(IK)) + ABX(JSEA)*USSCO
USSP(JSEA,NK+Spc2BND(IK)) = USSP(JSEA,NK+Spc2Bnd(IK)) + ABY(JSEA)*USSCO
ENDIF
END DO
!/OMPG/!$OMP END PARALLEL DO
END DO
!
RETURN
Expand Down
4 changes: 2 additions & 2 deletions model/ftn/w3pro1md.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
NYMAX=NY-1
IF ( ICLOSE.EQ.ICLOSE_TRPL ) NYMAX=NY
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IX, IY, IXY)
!/OMPH/!$OMP PARALLEL DO PRIVATE (IX, IY, IXY, VCB)
!
DO IX=1, NX
DO IY=1, NYMAX
Expand Down Expand Up @@ -627,7 +627,7 @@
IF ( ICLOSE.EQ.ICLOSE_TRPL ) THEN
IY=NY
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IXY, VCB, IX, IY)
!/OMPH/!$OMP PARALLEL DO PRIVATE (IXY, VCB, IX)
!
DO IX=1, NX
IXY = IY +(IX-1)*NY
Expand Down
4 changes: 2 additions & 2 deletions model/ftn/w3pro3md.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@
IF ( FLCUR ) THEN
!/T WRITE (NDST,9022)
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IXY)
!/OMPH/!$OMP PARALLEL DO PRIVATE (ISEA,IXY)
ajhenrique marked this conversation as resolved.
Show resolved Hide resolved
!
DO ISEA=1, NSEA
IXY = MAPSF(ISEA,3)
Expand All @@ -974,7 +974,7 @@
!
END IF
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IX, IY, IXY, CP, CQ)
!/OMPH/!$OMP PARALLEL DO PRIVATE (ISEA,IX, IY, IXY, CP, CQ)
!
DO ISEA=1, NSEA
IX = MAPSF(ISEA,1)
Expand Down
4 changes: 2 additions & 2 deletions model/ftn/w3uno2md.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@
!/T1 WRITE (NDST,9010)
!/T1 WRITE (NDST,9011) NB0, 'CENTRAL'
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IP, IXY, CFL, IXYC, IXYD, QB)
!/OMPH/!$OMP PARALLEL DO PRIVATE (IP, IXY, CFL, IXYC, IXYD, QB, QBO, IY2, IX2, QN)
!
DO IP=1, NB0
!
Expand Down Expand Up @@ -910,7 +910,7 @@
!/C90/!DIR$ IVDEP
!/NEC/!CDIR NODEP
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IP, IXY, JN, JP )
!/OMPH/!$OMP PARALLEL DO PRIVATE (IP, IXY, JN, JP, QOLD )
!
DO IP=1, NACT
!
Expand Down
3 changes: 2 additions & 1 deletion model/ftn/w3uqckmd.ftn
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#include "w3macros.h"
!/ ------------------------------------------------------------------- /
MODULE W3UQCKMD
Expand Down Expand Up @@ -877,7 +878,7 @@
!/T1 WRITE (NDST,9011) NB0, 'CENTRAL'
!
!/OMPH/!$OMP PARALLEL DO PRIVATE (IP, IXY, CFL, IXYC, QB, IXYU, IXYD, &
!/OMPH/!$OMP& DQ, DQNZ, QCN, QBN, QBR, CFAC )
!/OMPH/!$OMP& DQ, DQNZ, QCN, QBN, QBR, CFAC, IY, IX )
ajhenrique marked this conversation as resolved.
Show resolved Hide resolved
!
DO IP=1, NB0
!
Expand Down
16 changes: 8 additions & 8 deletions model/ftn/w3wavemd.ftn
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@
NKCFL=NK
!/T NKCFL=1
!
!/OMPG/!$OMP PARALLEL DO PRIVATE (JSEA,ISEA,IX,IY) SCHEDULE (DYNAMIC,1)
!/OMPG/!$OMP PARALLEL DO PRIVATE (JSEA,ISEA) SCHEDULE (DYNAMIC,1)
!
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA, JSEA)
Expand Down Expand Up @@ -1585,7 +1585,7 @@
IF ( FLCTH .OR. FLCK ) THEN
DO ITLOC=1, ITLOCH
!
!/OMPG/!$OMP PARALLEL PRIVATE (JSEA,ISEA,IX,IY,DEPTH)
!/OMPG/!$OMP PARALLEL PRIVATE (JSEA,ISEA,IX,IY,DEPTH,IXrel)
!/OMPG/!$OMP DO SCHEDULE (DYNAMIC,1)
!
!/DEBUGRUN WRITE(740+IAPROC,*) ' ITLOC=', ITLOC
Expand Down Expand Up @@ -1725,14 +1725,14 @@
!/MPI CALL MPI_STARTALL (NRQSG1, IRQSG1(1,2), IERR_MPI)
!/MPI END IF
!
!/OMPX/!$OMP PARALLEL PRIVATE (ISPEC,FIELD)
!!/OMPX/!$OMP PARALLEL PRIVATE (ISPEC,FIELD)
!
!/DEBUGRUN WRITE(740+IAPROC,*) 'W3WAVE, step 6.14'
!/DEBUGRUN FLUSH(740+IAPROC)

IF ( FLOMP ) ALLOCATE ( FIELD(1-NY:NY*(NX+2)) )
!
!/OMPX/!$OMP DO SCHEDULE (DYNAMIC,1)
!!/OMPX/!$OMP DO SCHEDULE (DYNAMIC,1)
!
DO ISPEC=1, NSPEC
IF ( IAPPRO(ISPEC) .EQ. IAPROC ) THEN
Expand Down Expand Up @@ -1781,11 +1781,11 @@
!/MEMCHECK call printMallInfo(IAPROC,mallInfos)


!/OMPX/!$OMP END DO
!!/OMPX/!$OMP END DO

IF ( FLOMP ) DEALLOCATE ( FIELD )

!/OMPX/!$OMP END PARALLEL
!!/OMPX/!$OMP END PARALLEL

!Li Initialise IK IX IY in case ARC option is not used to avoid warnings.
IK=1
Expand Down Expand Up @@ -1873,7 +1873,7 @@
IF ( FLCTH .OR. FLCK ) THEN
DO ITLOC=ITLOCH+1, NTLOC
!
!/OMPG/!$OMP PARALLEL PRIVATE (JSEA,ISEA,IX,IY,DEPTH)
!/OMPG/!$OMP PARALLEL PRIVATE (JSEA,ISEA,IX,IY,DEPTH,IXrel)
!/OMPG/!$OMP DO SCHEDULE (DYNAMIC,1)
!
!/DEBUGRUN WRITE(740+IAPROC,*) ' ITLOC=', ITLOC
Expand Down Expand Up @@ -1964,7 +1964,7 @@
!/PDLIB!/DEBUGSRC END IF
!
!/OMPG/!$OMP PARALLEL PRIVATE (JSEA,ISEA,IX,IY,DELA,DELX,DELY, &
!/OMPG/!$OMP& REFLEC,REFLED,D50,PSIC,TMP1,TMP2,TMP3)
!/OMPG/!$OMP& REFLEC,REFLED,D50,PSIC,TMP1,TMP2,TMP3,TMP4)
!/OMPG/!$OMP DO SCHEDULE (DYNAMIC,1)
!
DO JSEA=1, NSEAL
Expand Down
2 changes: 1 addition & 1 deletion regtests/bin/matrix_ncep
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fi
export shrd='y' # Do shared architecture tests
export dist='y' # Do distributed architecture (MPI) tests
export omp='y' # Threaded (OpenMP) tests
export hybd='n' # Hybrid options
export hybd='y' # Hybrid options

export prop1D='y' # 1-D propagation tests (ww3_tp1.X)
export prop2D='y' # 2-D propagation tests (ww3_tp2.X)
Expand Down