Skip to content

Commit 75d677c

Browse files
Merge pull request #264 from NCAR/onesided
New test for verifying one-sided MPI communication
2 parents 9550188 + 541b897 commit 75d677c

File tree

19 files changed

+667
-770
lines changed

19 files changed

+667
-770
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ individual files.
2222

2323
The changes are now listed with the most recent at the top.
2424

25-
**August 19 2021 :: WRF-Hydro diagnostics**
25+
**August 26 2021 :: NAG compiler fixes and updates to developer tests Tag: v9.11.8**
26+
27+
- bug fix for fixsytem for the NAG compiler
28+
- new developer test for mpi one-sided communication
29+
- removed obsolete async 4 developer tests
30+
31+
**August 19 2021 :: WRF-Hydro diagnostics Tag: v9.11.7**
2632

2733
- Improved DART diagnostic routines for WRF-Hydro
2834

29-
**August 10 2021 :: Documentation and GitHub template update**
35+
**August 10 2021 :: Documentation and GitHub template update Tag: v9.11.6**
3036

3137
- External forward operator documentation
3238
- Typo fixes for GitHub templates
3339

34-
**August 5 2021 :: bug fix for obs_seq_to_netcdf and grabbufr.x**
40+
**August 5 2021 :: bug fix for obs_seq_to_netcdf and grabbufr.x Tag: v9.11.5**
3541

3642
- obs_seq_to_netcdf now works correctly with mulitple obs_seq per epoch.
3743
- grabbufr.x STAT function returns correctly for long filenames when using PGI

assimilation_code/modules/utilities/fixsystem

Lines changed: 93 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,90 @@
44
# by UCAR, "as is", without charge, subject to all terms of use at
55
# http://www.image.ucar.edu/DAReS/DART/DART_download
66
#
7-
# $Id$
8-
9-
# usage: fixsystem [ your_fortran_command_name | -help ]
10-
# (e.g. ifort, pgf90, gfortran, g95, xlf90, etc)
7+
#
8+
# usage: fixsystem your_fortran_command_name [ files to change ]
9+
# fortran names such as: ifort, pgf90, gfortran, g95, xlf90, etc
10+
# default filenames are mpi_utilities_mod.f90 and null_mpi_utilities_mod.f90
11+
# other filenames can be given instead
1112
#
1213
# this script updates the mpi source files for any compiler-dependent
13-
# changes needed before building.
14+
# changes needed before building. these changes should be handled
15+
# by the compiler preprocessor, except that on systems with
16+
# case-insensitive filesystems (e.g. macs with OSX), bob.F90
17+
# and bob.f90 are the same file and the preprocessor bombs.
1418
#
15-
# at the moment the only compiler-dependent code is the declaration
16-
# of the "system()" function in a fortran interface block.
17-
# the code uses this function to run a shell script or command and
18-
# wait for the command exit code, e.g.: rc = system("/bin/date")
19+
# there are currently two code blocks of interest: 1) the fortran
20+
# interface block declaring the system() function, and 2) some
21+
# NAG-specific external use lines.
1922
#
23+
# the DART code uses system() to run a shell script or command and
24+
# wait for the command exit code, e.g.: rc = system("/bin/date")
2025
# for all compilers, except gfortran, an interface block is required
2126
# to define the integer return from the system function. however
2227
# the gfortran compiler gives an error if this block is defined.
23-
# this script enables and disables this interface block by
28+
#
29+
# this script enables and disables these interface blocks by
2430
# looking for a pair of specially formatted comment lines and
2531
# commenting in (or out) all the lines between those comment
2632
# delimiter lines.
2733
#
28-
# the original usage of this script was without any arguments.
29-
# the backwards compatibility remains for now, but is deprecated.
30-
# usage now is to give it a single argument - the name that the
34+
# this script requires at least one argument - the name the
3135
# fortran compiler is invoked with, e.g. ifort, xlf90, pgf90, etc.
32-
# it will ensure that any required changes to the source will be
33-
# made here before compilation.
36+
# by default mpi_utilities_mod.f90 and null_mpi_utilities_mod.f90
37+
# will be examined and changed if needed. other filenames can be
38+
# given instead and they will be processed instead of these.
39+
#
40+
41+
# default file list, and both marker strings must exist in these files
42+
export FLIST="mpi_utilities_mod.f90 null_mpi_utilities_mod.f90"
43+
export STRINGS_REQUIRED=1
44+
45+
# compiler name required. additional filenames optional.
46+
# if filenames are given, they replace the defaults
47+
if [ $# = 0 ]; then
48+
echo invalid usage, 1 argument required by $0
49+
echo "usage: $0 your_fortran_command_name [ filenames to modify ]"
50+
echo " e.g. $0 gfortran"
51+
echo " or $0 ifort "
52+
echo " or $0 pgf90 "
53+
echo " etc."
54+
exit 1
55+
elif [ $# = 1 ]; then
56+
# first arg: the name of your fortran compiler command
57+
export COMPILER=$1
58+
shift
59+
else
60+
# first arg: the name of your fortran compiler command
61+
# additional args: list of filenames to process
62+
# not a fatal error if files don't contain marker strings
63+
export COMPILER=$1
64+
shift
65+
export FLIST="$*"
66+
export STRINGS_REQUIRED=0
67+
fi
68+
3469

70+
# based on the compiler, what needs doing?
71+
# "out" means comment the code block out
72+
# "in" means remove comment character so the
73+
# code will be compiled.
74+
# currently there are two different code blocks
75+
# that need to be handled.
3576

36-
for f in mpi_utilities_mod.f90 null_mpi_utilities_mod.f90
77+
if [ "$COMPILER" = gfortran ]; then
78+
export todo1=out
79+
export todo2=out
80+
elif [ "$COMPILER" = nagfor ]; then
81+
export todo1=out
82+
export todo2=in
83+
else
84+
export todo1=in
85+
export todo2=out
86+
fi
87+
88+
# check each file in the list
89+
90+
for f in $FLIST
3791
do
3892

3993
# figure out what state the source file is in before we start
@@ -43,11 +97,15 @@ do
4397
elif [ "`echo $bline1 | grep COMMENTED_IN`" != "" ]; then
4498
export before1=in
4599
else
46-
echo ${f} not found, or does not have the right comment string to
47-
echo automatically change the system interface block via script.
48-
echo Please restore original file from the subversion repository
49-
echo and try again.
50-
exit 1
100+
if [ $STRINGS_REQUIRED = 0 ]; then
101+
before1=none
102+
else
103+
echo ${f} not found, or does not have the right comment string to
104+
echo automatically change the system interface block via script.
105+
echo Please restore original file from the repository
106+
echo and try again.
107+
exit 1
108+
fi
51109
fi
52110

53111
# NAG sections have both in and out - but NAG_BLOCK_EDIT is key
@@ -57,54 +115,20 @@ do
57115
elif [ "`echo $bline2 | grep COMMENTED_IN`" != "" ]; then
58116
export before2=in
59117
else
60-
echo ${f} not found, or does not have the right comment string to
61-
echo automatically change the system interface block via script.
62-
echo Please restore original file from the subversion repository
63-
echo and try again.
64-
exit 1
65-
fi
66-
67-
# no args given - error. required now.
68-
if [ $# = 0 ]; then
69-
echo invalid usage, 1 argument required by $0
70-
echo "usage: $0 [ your_fortran_command_name | -help ]"
71-
echo " e.g. $0 gfortran"
72-
echo " or $0 ifort "
73-
echo " or $0 pgf90 "
74-
echo " etc."
75-
exit 1
76-
elif [ $# = 1 ]; then
77-
# single arg: the name of your fortran compiler command
78-
if ([ "$1" = help ] || [ "$1" = -help ] || [ "$1" = --help ]); then
79-
echo "usage: $0 [ your_fortran_command_name | -help ]"
80-
echo " e.g. $0 gfortran"
81-
echo " or $0 ifort "
82-
echo " or $0 pgf90 "
83-
echo " etc."
84-
exit 1
85-
elif ([ "$1" = gfortran ] || [ "$1" = nagfor ]); then
86-
export todo1=out
87-
export todo2=out
88-
elif [ "$1" = nagfor ]; then
89-
export todo1=out
90-
export todo2=in
118+
if [ $STRINGS_REQUIRED = 0 ]; then
119+
before2=none
91120
else
92-
export todo1=in
93-
export todo2=out
121+
echo ${f} not found, or does not have the right comment string to
122+
echo automatically change the NAG interface block via script.
123+
echo Please restore original file from the repository
124+
echo and try again.
125+
exit 1
94126
fi
95-
export compiler=$1
96-
97-
else
98-
# too many arguments, give an error message and exit
99-
echo invalid usage, more than 1 argument given to $0
100-
echo "usage: $0 [ your_fortran_command_name | -help ]"
101-
echo " e.g. $0 gfortran"
102-
echo " or $0 ifort "
103-
echo " or $0 pgf90 "
104-
echo " etc."
105-
exit 1
106127
fi
107-
128+
129+
# if neither marker string is found, loop without complaint.
130+
if ([ $before1 = none ] && [ $before2 = none ]); then continue; fi
131+
108132
# if we are already in the right state, loop to next file
109133
if ([ $before1 = $todo1 ] && [ $before2 = $todo2 ]); then continue; fi
110134

@@ -115,7 +139,7 @@ do
115139

116140
# say what compiler we are doing this for, and move the existing
117141
# code into a temporary file so the sed command does not overwrite it.
118-
echo Setting for $compiler compiler in ${f}
142+
echo Setting for $COMPILER compiler in ${f}
119143
mv ${f} tempfile
120144

121145
# removing comment chars, enabling interface block code
@@ -132,7 +156,7 @@ do
132156
mv ${f} tempfile
133157
fi
134158

135-
# changing comment chars, enabling NAG specific block code
159+
# removing comment chars, enabling NAG specific block code
136160
# non-nag section headers cannot match nag headers.
137161
if [ $todo2 = in ]; then
138162
sed -e '/NAG_BLOCK_EDIT START COMMENTED_OUT/,/NAG_BLOCK_EDIT END COMMENTED_OUT/s/^!//' \
@@ -141,7 +165,7 @@ do
141165
-e '/\(OTHER_BLOCK_EDIT [A-Z][A-Z]*\) COMMENTED_IN/s//\1 COMMENTED_OUT/' tempfile > ${f}
142166
fi
143167

144-
# changing comment chars, disabling NAG specific block code
168+
# adding comment chars, disabling NAG specific block code
145169
if [ $todo2 = out ]; then
146170
sed -e '/NAG_BLOCK_EDIT START COMMENTED_IN/,/NAG_BLOCK_EDIT END COMMENTED_IN/s/^/!/' \
147171
-e '/\(NAG_BLOCK_EDIT [A-Z][A-Z]*\) COMMENTED_IN/s//\1 COMMENTED_OUT/' \
@@ -155,7 +179,3 @@ done
155179

156180
exit 0
157181

158-
# <next few lines under version control, do not edit>
159-
# $URL$
160-
# $Revision$
161-
# $Date$

build_templates/mkmf.template.nag.linux

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# DART software - Copyright UCAR. This open source software is provided
44
# by UCAR, "as is", without charge, subject to all terms of use at
55
# http://www.image.ucar.edu/DAReS/DART/DART_download
6-
#
7-
# DART $Id$
86

97
# typical use with mkmf
108
# mkmf -t mkmf.template.xxxx ...
@@ -20,6 +18,7 @@
2018
#
2119
# FFLAGS useful for bitwise reproducibility and accuracy control
2220
# (these will slow down performance to various degrees)
21+
# (currently none listed)
2322
#
2423
# FFLAGS useful for production
2524
# -O2 default. optimize without too much unrepeatable numerical games
@@ -30,8 +29,10 @@
3029
# optimization level on the offending source files.
3130
#
3231
# FFLAGS possibly useful, not normally used by DART
32+
# (currently none listed)
3333
#
3434
# Runtime environment variables that influence the compiler behavior:
35+
# (currently none listed)
3536
#
3637
#
3738
# IF YOU HAVE MORE CURRENT COMPILER INFORMATION, PLEASE SHARE IT WITH US.
@@ -63,9 +64,15 @@ LD = nagfor
6364
# NETCDF = /opt/local
6465
NETCDF = /usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0
6566

67+
# NAG defaults to strict argument checking. MPI allows you to
68+
# pass different array types to the same routine. 'use mpi_f08' will
69+
# provide the right interface blocks to make this compile successfully.
70+
# we currently have 'use mpi' for backwards compatibility and that
71+
# provokes a fatal compile error in the mpi_utilities_mod.f90 file.
72+
# the -mismatch flag turns the error into a warning.
6673
INCS = -I$(NETCDF)/include
6774
LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf
68-
FFLAGS = -O $(INCS)
75+
FFLAGS = -O -mismatch $(INCS)
6976
LDFLAGS = $(FFLAGS) $(LIBS)
7077

7178
# for development or debugging, use this instead:
@@ -76,7 +83,3 @@ LDFLAGS = $(FFLAGS) $(LIBS)
7683
# LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -lmkl -lmkl_lapack -lguide -lpthread
7784
#
7885

79-
# <next few lines under version control, do not edit>
80-
# $URL$
81-
# $Revision$
82-
# $Date$

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
author = 'Data Assimilation Research Section'
2222

2323
# The full version, including alpha/beta/rc tags
24-
release = '9.11.7'
24+
release = '9.11.8'
2525
master_doc = 'README'
2626

2727
# -- General configuration ---------------------------------------------------

0 commit comments

Comments
 (0)