Skip to content

Commit

Permalink
Use consistent casing (all-caps) for build_threaded value
Browse files Browse the repository at this point in the history
Three different casing styles were being used for this value
and Make does case-senstive comparisons, so it was incorrectly
interpretting build_threaded to be false.

[BFB]
  • Loading branch information
jgfouca committed Mar 29, 2019
1 parent 09c6b9b commit 0f88af0
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion config/e3sm/machines/Depends.cetus
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(SSOBJS): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -qsmallstack $<

QSMPFLAGS:=
ifeq ($(compile_threaded), true)
ifeq ($(compile_threaded), TRUE)
QSMPFLAGS += -qsmp=noauto:noomp
endif
shr_reprosum_mod.o: shr_reprosum_mod.F90
Expand Down
2 changes: 1 addition & 1 deletion config/e3sm/machines/Depends.mira
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(SSOBJS): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -qsmallstack $<

QSMPFLAGS:=
ifeq ($(compile_threaded), true)
ifeq ($(compile_threaded), TRUE)
QSMPFLAGS += -qsmp=noauto:noomp
endif
shr_reprosum_mod.o: shr_reprosum_mod.F90
Expand Down
2 changes: 1 addition & 1 deletion config/e3sm/machines/Depends.summit.ibm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(SSOBJS): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -qsmallstack $<

QSMPFLAGS:=
ifeq ($(compile_threaded), true)
ifeq ($(compile_threaded), TRUE)
QSMPFLAGS += -qsmp=noauto:noomp
endif
shr_reprosum_mod.o: shr_reprosum_mod.F90
Expand Down
2 changes: 1 addition & 1 deletion config/e3sm/machines/Depends.summitdev.ibm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(SSOBJS): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -qsmallstack $<

QSMPFLAGS:=
ifeq ($(compile_threaded), true)
ifeq ($(compile_threaded), TRUE)
QSMPFLAGS += -qsmp=noauto:noomp
endif
shr_reprosum_mod.o: shr_reprosum_mod.F90
Expand Down
168 changes: 84 additions & 84 deletions config/e3sm/machines/config_compilers.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<compiler COMPILER="gnu" MACH="example-osx-homebrew">
<!-- homebrew -->
<ADD_CPPDEFS> -DFORTRANUNDERSCORE -DNO_R16</ADD_CPPDEFS>
<ADD_CFLAGS compile_threaded="true"> -fopenmp </ADD_CFLAGS>
<ADD_FFLAGS compile_threaded="true"> -fopenmp </ADD_FFLAGS>
<ADD_LDFLAGS compile_threaded="true"> -L /usr/local/Cellar/gcc/4.9.2/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -fopenmp </ADD_LDFLAGS>
<ADD_CFLAGS compile_threaded="TRUE"> -fopenmp </ADD_CFLAGS>
<ADD_FFLAGS compile_threaded="TRUE"> -fopenmp </ADD_FFLAGS>
<ADD_LDFLAGS compile_threaded="TRUE"> -L /usr/local/Cellar/gcc/4.9.2/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -fopenmp </ADD_LDFLAGS>
<ADD_CMAKE_OPTS MODEL="cism"> -D CISM_GNU=ON </ADD_CMAKE_OPTS>
<FIXEDFLAGS> -ffixed-form </FIXEDFLAGS>
<FREEFLAGS> -ffree-form </FREEFLAGS>
Expand All @@ -29,15 +29,15 @@
<SUPPORTS_CXX>TRUE</SUPPORTS_CXX>
<NETCDF_PATH>/usr/local</NETCDF_PATH>
<ADD_SLIBS>$(shell $(NETCDF_PATH)/bin/nf-config --flibs) -framework Accelerate</ADD_SLIBS>
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="false">$ENV{HOME}/local/pfunit/pfunit-sf.git.ae92605e8e</PFUNIT_PATH>
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="FALSE">$ENV{HOME}/local/pfunit/pfunit-sf.git.ae92605e8e</PFUNIT_PATH>
</compiler>

<compiler COMPILER="gnu" MACH="example-osx-macports">
<!-- macports -->
<ADD_CPPDEFS> -DFORTRANUNDERSCORE -DNO_R16</ADD_CPPDEFS>
<ADD_CFLAGS compile_threaded="true"> -fopenmp </ADD_CFLAGS>
<ADD_FFLAGS compile_threaded="true"> -fopenmp </ADD_FFLAGS>
<ADD_LDFLAGS compile_threaded="true"> -fopenmp </ADD_LDFLAGS>
<ADD_CFLAGS compile_threaded="TRUE"> -fopenmp </ADD_CFLAGS>
<ADD_FFLAGS compile_threaded="TRUE"> -fopenmp </ADD_FFLAGS>
<ADD_LDFLAGS compile_threaded="TRUE"> -fopenmp </ADD_LDFLAGS>
<ADD_CMAKE_OPTS MODEL="cism"> -D CISM_GNU=ON </ADD_CMAKE_OPTS>
<FIXEDFLAGS> -ffixed-form </FIXEDFLAGS>
<FREEFLAGS> -ffree-form </FREEFLAGS>
Expand All @@ -57,6 +57,6 @@
<SUPPORTS_CXX>TRUE</SUPPORTS_CXX>
<NETCDF_PATH>/opt/local</NETCDF_PATH>
<ADD_SLIBS>$(shell $(NETCDF_PATH)/bin/nf-config --flibs) -framework Accelerate</ADD_SLIBS>
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="false">$ENV{HOME}/local/pfunit/pfunit-sf.git.ae92605e8e</PFUNIT_PATH>
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="FALSE">$ENV{HOME}/local/pfunit/pfunit-sf.git.ae92605e8e</PFUNIT_PATH>
</compiler>
</config_compilers>
2 changes: 1 addition & 1 deletion config/xml_schemas/config_compilers_v2.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<xs:attribute name="COMPILER" type="xs:token"/>
<xs:attribute name="OS" type="xs:token"/>
<xs:attribute name="MACH" type="xs:token"/>
<xs:attribute name="compile_threaded" type="xs:boolean"/>
<xs:attribute name="compile_threaded" type="upperBoolean"/>
<xs:attribute name="DEBUG" type="upperBoolean"/>
<xs:attribute name="MODEL" type="xs:token"/>
<xs:attribute name="MPILIB" type="xs:token"/>
Expand Down
4 changes: 2 additions & 2 deletions doc/source/users_guide/cime-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ CIME recognizes a user-created custom configuration directory, ``$HOME/.cime``.
<compiler COMPILER="ibm" OS="BGQ">
<FFLAGS> -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush </FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O3 -qstrict -qinline=auto </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE" compile_threaded="true"> -qsmp=omp </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="TRUE" compile_threaded="true"> -qsmp=omp:noopt </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE" compile_threaded="TRUE"> -qsmp=omp </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="TRUE" compile_threaded="TRUE"> -qsmp=omp:noopt </ADD_FFLAGS>
<ADD_CPPDEFS> -DLINUX </ADD_CPPDEFS>
<CONFIG_ARGS> --build=powerpc-bgp-linux --host=powerpc64-suse-linux </CONFIG_ARGS>
<LDFLAGS> -Wl,--relax -Wl,--allow-multiple-definition </LDFLAGS>
Expand Down
4 changes: 2 additions & 2 deletions doc/source/users_guide/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ For a serial build, your setting will look like this example:

.. code-block:: xml
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="false">$ENV{CESMDATAROOT}/tools/pFUnit/pFUnit3.2.8_cheyenne_Intel17.0.1_noMPI_noOpenMP</PFUNIT_PATH>
<PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="FALSE">$ENV{CESMDATAROOT}/tools/pFUnit/pFUnit3.2.8_cheyenne_Intel17.0.1_noMPI_noOpenMP</PFUNIT_PATH>
The ``MPILIB`` attribute should be either:

* ``mpi-serial`` for a pFUnit build where ``-DMPI=NO``, or

* the name of the MPI library you used for a pFUnit build where ``-DMPI=YES``. (For example, you might use ``mpich``, which should be one of the machine's MPI libraries specified by ``MPILIBS`` in **config_machines.xml**.)

The ``compile_threaded`` attribute should be either ``true`` or ``false`` depending on the value of ``-DOPENMP``.
The ``compile_threaded`` attribute should be either ``TRUE`` or ``FALSE`` depending on the value of ``-DOPENMP``.

Once you have specified the path for your build(s), you should be able to run the unit tests by following the instructions in :ref:`running_unit_tests`.

Expand Down
6 changes: 3 additions & 3 deletions scripts/fortran_unit_testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def find_pfunit(compilerobj, mpilib, use_openmp):
- use_openmp: Boolean
"""
attrs = {"MPILIB": mpilib,
"compile_threaded": "true" if use_openmp else "false"
"compile_threaded": "TRUE" if use_openmp else "FALSE"
}

pfunit_path = compilerobj.get_optional_compiler_node("PFUNIT_PATH", attributes=attrs)
Expand Down Expand Up @@ -337,9 +337,9 @@ def _main():
os.environ["DEBUG"] = stringify_bool(debug)
os.environ["MPILIB"] = mpilib
if use_openmp:
os.environ["compile_threaded"] = "true"
os.environ["compile_threaded"] = "TRUE"
else:
os.environ["compile_threaded"] = "false"
os.environ["compile_threaded"] = "FALSE"

os.environ["UNIT_TEST_HOST"] = socket.gethostname()
if "NETCDF_PATH" in os.environ and not "NETCDF" in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/CIME/BuildTools/valuesetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def has_special_case(self, other):
>>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], [])
>>> b = ValueSetting('bar', False, {"DEBUG": "TRUE", "MPILIB": "mpich2"}, [], [])
>>> c = ValueSetting('bar', False, {"DEBUG": "TRUE", "compile_threaded": "false"}, [], [])
>>> c = ValueSetting('bar', False, {"DEBUG": "TRUE", "compile_threaded": "FALSE"}, [], [])
>>> d = ValueSetting('foo', False, {"DEBUG": "FALSE"}, [], [])
>>> a.has_special_case(b)
True
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/CIME/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_standard_makefile_args(case):
"OCN_SUBMODEL", "CISM_USE_TRILINOS", "USE_ALBANY", "USE_PETSC"]

make_args = "CIME_MODEL={} ".format(case.get_value("MODEL"))
make_args += " compile_threaded={} ".format(case.get_build_threaded())
make_args += " compile_threaded={} ".format(stringify_bool(case.get_build_threaded()))
for var in variables:
make_args+=xml_to_make_variable(case, var)

Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/scripts_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _has_unit_test_support(self):
compiler = Compilers(MACHINE, compiler=default_compiler)
else:
compiler = Compilers(MACHINE, compiler=TEST_COMPILER)
attrs = {'MPILIB': 'mpi-serial', 'compile_threaded': 'false'}
attrs = {'MPILIB': 'mpi-serial', 'compile_threaded': 'FALSE'}
pfunit_path = compiler.get_optional_compiler_node("PFUNIT_PATH",
attributes=attrs)
if pfunit_path is None:
Expand Down
4 changes: 2 additions & 2 deletions tools/mapping/gen_mapping_files/runoff_to_ocn/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ VPATH := $(shell pwd)
SRCFILE := NONE
SRCS := NONE
DEPGEN := ./makdep # an externally provided dependency generator
#compile_threaded := true
compile_threaded := false
#compile_threaded := TRUE
compile_threaded := FALSE

ifneq ($(VPATH),.)
# this variable was specified on cmd line or in an env var
Expand Down

0 comments on commit 0f88af0

Please sign in to comment.