From 44ea4c9b703d1aa7986ed2cdd855d81087177a32 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Fri, 26 Jan 2018 15:57:54 -0700 Subject: [PATCH 01/15] Added script for building on cheyenne --- build_scripts/chey_intel_mkl_omp.sh | 16 ++++++++++++++++ conda_recipe/meta.yaml | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 build_scripts/chey_intel_mkl_omp.sh diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh new file mode 100644 index 0000000..9af0c41 --- /dev/null +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +cd ../fortran/build_help +ifort -o sizes -qopenmp omp_sizes.f90 +python sub_sizes.py + +cd .. +ifort ompgen.F90 -qopenmp -fpp -save-temps +mv ompgen.i90 omp.f90 +f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature +cd .. + +python setup.py clean --all +python setup.py config_fc --f90flags="-O3 -xHost -mkl -openmp" build --compiler=intelem --fcompiler=intelem +pip install . + diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index d613f4c..1b83f52 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -6,7 +6,7 @@ package: source: git_url: https://github.com/NCAR/wrf-python - git_branch: release/1.1.0 + git_branch: develop build: number: 0 @@ -56,4 +56,4 @@ extra: - marylhaley - david-ian-brown - khallock - \ No newline at end of file + From 7d53bb7837787862c48238083828fb9eaab64fab Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Fri, 26 Jan 2018 16:29:19 -0700 Subject: [PATCH 02/15] Fixed some typos. Build still needs paths to MKL and OMP in order to run --- build_scripts/chey_intel_mkl_omp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index 9af0c41..5cc4ac1 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -5,12 +5,12 @@ ifort -o sizes -qopenmp omp_sizes.f90 python sub_sizes.py cd .. -ifort ompgen.F90 -qopenmp -fpp -save-temps +ifort ompgen.F90 -qopenmp -fpp -save-temps 2>/dev/null mv ompgen.i90 omp.f90 f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. python setup.py clean --all -python setup.py config_fc --f90flags="-O3 -xHost -mkl -openmp" build --compiler=intelem --fcompiler=intelem +python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build --compiler=intelem --fcompiler=intelem pip install . From 219041246d9fbac3d6f41935b7bdf83f18383fe4 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Mon, 29 Jan 2018 15:32:48 -0700 Subject: [PATCH 03/15] Fix doc printing of fill values. Update recipe based on Travis CI failures with sizes executable. --- conda_recipe/build.sh | 10 ++++++---- src/wrf/constants.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/conda_recipe/build.sh b/conda_recipe/build.sh index eefecaf..feace2b 100644 --- a/conda_recipe/build.sh +++ b/conda_recipe/build.sh @@ -1,12 +1,16 @@ #!/bin/bash cd fortran/build_help -gfortran -o sizes -fopenmp omp_sizes.f90 +if [ `uname` == Darwin ]; then + gfortran -o sizes -fopenmp omp_sizes.f90 -Wl,-rpath,${CONDA_PREFIX}/lib +else + gfortran -o sizes -fopenmp omp_sizes.f90 +fi python sub_sizes.py cd .. gfortran -E ompgen.F90 -fopenmp -cpp -o omp.f90 -f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature +f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. if [ `uname` == Darwin ]; then @@ -16,5 +20,3 @@ fi $PYTHON setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build $PYTHON setup.py install --single-version-externally-managed --record=record.txt - - diff --git a/src/wrf/constants.py b/src/wrf/constants.py index 6a6dc90..cedc62a 100755 --- a/src/wrf/constants.py +++ b/src/wrf/constants.py @@ -76,7 +76,7 @@ else: # Add the integers based on python 2.x or 3.x def default_fill(dtype=None): dt = np.dtype(dtype) if dtype is not None else None - return _DEFAULT_FILL_MAP.get(dt, 0) + return _DEFAULT_FILL_MAP.get(dt, Constants.DEFAULT_FILL) From 4a7ad36c3d11d884db0e1e52eabea1cc6504f404 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Wed, 31 Jan 2018 16:28:00 -0700 Subject: [PATCH 04/15] Fix intel compile command --- build_scripts/chey_intel_mkl_omp.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index 5cc4ac1..57862d1 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -5,12 +5,13 @@ ifort -o sizes -qopenmp omp_sizes.f90 python sub_sizes.py cd .. -ifort ompgen.F90 -qopenmp -fpp -save-temps 2>/dev/null +ifort ompgen.F90 -qopenmp -fpp -save-temps mv ompgen.i90 omp.f90 f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. python setup.py clean --all -python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build --compiler=intelem --fcompiler=intelem -pip install . +python setup.py config_fc --f90flags="-O3 -xHost -mkl -openmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem + +#pip install . From 593873b6b0ac821accf5418830757caf22e6a7d2 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 10:52:04 -0700 Subject: [PATCH 05/15] Added patching for numpy.distutils --- build_scripts/chey_intel_mkl_omp.sh | 2 +- setup.py | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index 57862d1..3796691 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -1,7 +1,7 @@ #!/bin/bash cd ../fortran/build_help -ifort -o sizes -qopenmp omp_sizes.f90 +ifort -o sizes -qopenmp omp_sizes.f90 &>/dev/null python sub_sizes.py cd .. diff --git a/setup.py b/setup.py index 41ec9e6..de39044 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,26 @@ import os import sys import setuptools -import numpy.distutils.core - +import socket + +if not socket.gethostname().startswith("cheyenne"): + import numpy.distutils.core +else: + import chey_intel + import numpy.distutils.core + import numpy.distutils.fcompiler.intel + + numpy.distutils.fcompiler.intel.IntelFCompiler = chey_intel.IntelFCompiler + numpy.distutils.fcompiler.intel.IntelVisualFCompiler = ( + chey_intel.IntelVisualFCompiler) + numpy.distutils.fcompiler.intel.IntelItaniumFCompiler = ( + chey_intel.IntelItaniumFCompiler) + numpy.distutils.fcompiler.intel.IntelItaniumVisualFCompiler = ( + chey_intel.IntelItaniumVisualFCompiler) + numpy.distutils.fcompiler.intel.IntelEM64VisualFCompiler = ( + chey_intel.IntelEM64VisualFCompiler) + numpy.distutils.fcompiler.intel.IntelEM64TFCompiler = ( + chey_intel.IntelEM64TFCompiler) ext1 = numpy.distutils.core.Extension( name = "wrf._wrffortran", From 4654f0437496ae8077094d25996dc26f521af8f1 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 10:56:19 -0700 Subject: [PATCH 06/15] Added intel patch --- chey_intel.py | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 chey_intel.py diff --git a/chey_intel.py b/chey_intel.py new file mode 100644 index 0000000..1662af9 --- /dev/null +++ b/chey_intel.py @@ -0,0 +1,219 @@ +# http://developer.intel.com/software/products/compilers/flin/ +from __future__ import division, absolute_import, print_function + +import sys + +from numpy.distutils.ccompiler import simple_version_match +from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file + +compilers = ['IntelFCompiler', 'IntelVisualFCompiler', + 'IntelItaniumFCompiler', 'IntelItaniumVisualFCompiler', + 'IntelEM64VisualFCompiler', 'IntelEM64TFCompiler'] + + +def intel_version_match(type): + # Match against the important stuff in the version string + return simple_version_match(start=r'Intel.*?Fortran.*?(?:%s).*?Version' % (type,)) + + +class BaseIntelFCompiler(FCompiler): + def update_executables(self): + f = dummy_fortran_file() + self.executables['version_cmd'] = ['', '-FI', '-V', '-c', + f + '.f', '-o', f + '.o'] + + def runtime_library_dir_option(self, dir): + return '-Wl,-rpath="%s"' % dir + + +class IntelFCompiler(BaseIntelFCompiler): + + compiler_type = 'intel' + compiler_aliases = ('ifort',) + description = 'Intel Fortran Compiler for 32-bit apps' + version_match = intel_version_match('32-bit|IA-32') + + possible_executables = ['ifort', 'ifc'] + + executables = { + 'version_cmd' : None, # set by update_executables + 'compiler_f77' : [None, "-72", "-w90", "-w95"], + 'compiler_f90' : [None], + 'compiler_fix' : [None, "-FI"], + 'linker_so' : ["", "-shared"], + 'archiver' : ["ar", "-cr"], + 'ranlib' : ["ranlib"] + } + + pic_flags = ['-fPIC'] + module_dir_switch = '-module ' # Don't remove ending space! + module_include_switch = '-I' + + def get_flags_free(self): + return ['-FR'] + + def get_flags(self): + return ['-fPIC'] + + def get_flags_opt(self): # Scipy test failures with -O2 + v = self.get_version() + mpopt = 'qopenmp' + return ['-fp-model strict -O3 -{}'.format(mpopt)] + + def get_flags_arch(self): + return [] + + def get_flags_linker_so(self): + opt = FCompiler.get_flags_linker_so(self) + v = self.get_version() + if v and v >= '8.0': + opt.append('-nofor_main') + if sys.platform == 'darwin': + # Here, it's -dynamiclib + try: + idx = opt.index('-shared') + opt.remove('-shared') + except ValueError: + idx = 0 + opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup'] + return opt + + +class IntelItaniumFCompiler(IntelFCompiler): + compiler_type = 'intele' + compiler_aliases = () + description = 'Intel Fortran Compiler for Itanium apps' + + version_match = intel_version_match('Itanium|IA-64') + + possible_executables = ['ifort', 'efort', 'efc'] + + executables = { + 'version_cmd' : None, + 'compiler_f77' : [None, "-FI", "-w90", "-w95"], + 'compiler_fix' : [None, "-FI"], + 'compiler_f90' : [None], + 'linker_so' : ['', "-shared"], + 'archiver' : ["ar", "-cr"], + 'ranlib' : ["ranlib"] + } + + +class IntelEM64TFCompiler(IntelFCompiler): + compiler_type = 'intelem' + compiler_aliases = () + description = 'Intel Fortran Compiler for 64-bit apps' + + version_match = intel_version_match('EM64T-based|Intel\\(R\\) 64|64|IA-64|64-bit') + + possible_executables = ['ifort', 'efort', 'efc'] + + executables = { + 'version_cmd' : None, + 'compiler_f77' : [None, "-FI"], + 'compiler_fix' : [None, "-FI"], + 'compiler_f90' : [None], + 'linker_so' : ['', "-shared"], + 'archiver' : ["ar", "-cr"], + 'ranlib' : ["ranlib"] + } + + def get_flags(self): + return ['-fPIC'] + + def get_flags_opt(self): # Scipy test failures with -O2 + v = self.get_version() + mpopt = 'qopenmp' + return ['-fp-model strict -O3 -{}'.format(mpopt)] + + def get_flags_arch(self): + return [''] + +# Is there no difference in the version string between the above compilers +# and the Visual compilers? + + +class IntelVisualFCompiler(BaseIntelFCompiler): + compiler_type = 'intelv' + description = 'Intel Visual Fortran Compiler for 32-bit apps' + version_match = intel_version_match('32-bit|IA-32') + + def update_executables(self): + f = dummy_fortran_file() + self.executables['version_cmd'] = ['', '/FI', '/c', + f + '.f', '/o', f + '.o'] + + ar_exe = 'lib.exe' + possible_executables = ['ifort', 'ifl'] + + executables = { + 'version_cmd' : None, + 'compiler_f77' : [None], + 'compiler_fix' : [None], + 'compiler_f90' : [None], + 'linker_so' : [None], + 'archiver' : [ar_exe, "/verbose", "/OUT:"], + 'ranlib' : None + } + + compile_switch = '/c ' + object_switch = '/Fo' # No space after /Fo! + library_switch = '/OUT:' # No space after /OUT:! + module_dir_switch = '/module:' # No space after /module: + module_include_switch = '/I' + + def get_flags(self): + opt = ['/nologo', '/MD', '/nbs', '/names:lowercase', '/assume:underscore'] + return opt + + def get_flags_free(self): + return [] + + def get_flags_debug(self): + return ['/4Yb', '/d2'] + + def get_flags_opt(self): + return ['/O1'] # Scipy test failures with /O2 + + def get_flags_arch(self): + return ["/arch:IA32", "/QaxSSE3"] + + def runtime_library_dir_option(self, dir): + raise NotImplementedError + + +class IntelItaniumVisualFCompiler(IntelVisualFCompiler): + compiler_type = 'intelev' + description = 'Intel Visual Fortran Compiler for Itanium apps' + + version_match = intel_version_match('Itanium') + + possible_executables = ['efl'] # XXX this is a wild guess + ar_exe = IntelVisualFCompiler.ar_exe + + executables = { + 'version_cmd' : None, + 'compiler_f77' : [None, "-FI", "-w90", "-w95"], + 'compiler_fix' : [None, "-FI", "-4L72", "-w"], + 'compiler_f90' : [None], + 'linker_so' : ['', "-shared"], + 'archiver' : [ar_exe, "/verbose", "/OUT:"], + 'ranlib' : None + } + + +class IntelEM64VisualFCompiler(IntelVisualFCompiler): + compiler_type = 'intelvem' + description = 'Intel Visual Fortran Compiler for 64-bit apps' + + version_match = simple_version_match(start=r'Intel\(R\).*?64,') + + def get_flags_arch(self): + return [''] + + +if __name__ == '__main__': + from distutils import log + log.set_verbosity(2) + from numpy.distutils import customized_fcompiler + print(customized_fcompiler(compiler='intel').get_version()) From 0b02c0a952c1dc24b16761649f4adae7e22949ab Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 11:02:39 -0700 Subject: [PATCH 07/15] Fix typo --- build_scripts/chey_intel_mkl_omp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index 3796691..88a5a28 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -11,7 +11,7 @@ f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. python setup.py clean --all -python setup.py config_fc --f90flags="-O3 -xHost -mkl -openmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem +python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem #pip install . From a6452a25da6bdb7e796ba4266d8199494b071ed1 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 11:38:06 -0700 Subject: [PATCH 08/15] Changed to make a wheel --- build_scripts/chey_intel_mkl_omp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index 88a5a28..c6a766d 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -1,17 +1,17 @@ #!/bin/bash cd ../fortran/build_help -ifort -o sizes -qopenmp omp_sizes.f90 &>/dev/null +ifort -o sizes -qopenmp omp_sizes.f90 python sub_sizes.py cd .. -ifort ompgen.F90 -qopenmp -fpp -save-temps +ifort ompgen.F90 -qopenmp -fpp -save-temps > /dev/null 2>&1 mv ompgen.i90 omp.f90 f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. python setup.py clean --all -python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem +python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem bdist_wheel #pip install . From 87355fc5312282d92ec005fd0d2a17715c3c4ff0 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 11:47:46 -0700 Subject: [PATCH 09/15] Fix acidental unicode character --- src/wrf/extension.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrf/extension.py b/src/wrf/extension.py index a3357a3..a766040 100755 --- a/src/wrf/extension.py +++ b/src/wrf/extension.py @@ -1569,7 +1569,7 @@ def omp_get_wtime(): """Return elapsed wall clock time in seconds. The omp_get_wtime routine returns a value equal to the elapsed wall clock - time in seconds since some “time in the past”. The actual + time in seconds since some "time in the past". The actual “time in the past” is arbitrary, but it is guaranteed not to change during the execution of the application program. The time returned is a “per-thread time”, so it is not required to be globally consistent across From a5e8f8f0b61ca02d88f418400cb5b2938cabddef Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 11:50:02 -0700 Subject: [PATCH 10/15] Fix more accidental unicode characters --- src/wrf/extension.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrf/extension.py b/src/wrf/extension.py index a766040..167d27c 100755 --- a/src/wrf/extension.py +++ b/src/wrf/extension.py @@ -1570,9 +1570,9 @@ def omp_get_wtime(): The omp_get_wtime routine returns a value equal to the elapsed wall clock time in seconds since some "time in the past". The actual - “time in the past” is arbitrary, but it is guaranteed not to change during + "time in the past" is arbitrary, but it is guaranteed not to change during the execution of the application program. The time returned is a - “per-thread time”, so it is not required to be globally consistent across + "per-thread time", so it is not required to be globally consistent across all threads participating in an application. Returns: From bb41e19d36ab33266d3fd480383fd6ac135598c8 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 14:00:53 -0700 Subject: [PATCH 11/15] Updated version to 1.1.1 Updated docs. Updated numpy compile flags. Updated build script flags. --- build_scripts/chey_intel_mkl_omp.sh | 2 +- chey_intel.py | 8 ++++---- doc/source/new.rst | 10 ++++++++++ src/wrf/version.py | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/build_scripts/chey_intel_mkl_omp.sh b/build_scripts/chey_intel_mkl_omp.sh index c6a766d..ee40614 100644 --- a/build_scripts/chey_intel_mkl_omp.sh +++ b/build_scripts/chey_intel_mkl_omp.sh @@ -11,7 +11,7 @@ f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. python setup.py clean --all -python setup.py config_fc --f90flags="-O3 -xHost -mkl -qopenmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem bdist_wheel +python setup.py config_fc --f90flags="-xHost -mkl -qopenmp" build_ext --rpath="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --library-dirs="/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin:/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/mkl/lib/intel64_lin" --libraries="mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl" build --compiler=intelem --fcompiler=intelem bdist_wheel #pip install . diff --git a/chey_intel.py b/chey_intel.py index 1662af9..8ba16b7 100644 --- a/chey_intel.py +++ b/chey_intel.py @@ -57,8 +57,8 @@ class IntelFCompiler(BaseIntelFCompiler): def get_flags_opt(self): # Scipy test failures with -O2 v = self.get_version() - mpopt = 'qopenmp' - return ['-fp-model strict -O3 -{}'.format(mpopt)] + mpopt = '' + return ['-fp-model strict -O2 -{}'.format(mpopt)] def get_flags_arch(self): return [] @@ -123,8 +123,8 @@ class IntelEM64TFCompiler(IntelFCompiler): def get_flags_opt(self): # Scipy test failures with -O2 v = self.get_version() - mpopt = 'qopenmp' - return ['-fp-model strict -O3 -{}'.format(mpopt)] + mpopt = '' + return ['-fp-model strict -O2 -{}'.format(mpopt)] def get_flags_arch(self): return [''] diff --git a/doc/source/new.rst b/doc/source/new.rst index e2ff9cc..5197ebb 100644 --- a/doc/source/new.rst +++ b/doc/source/new.rst @@ -4,6 +4,16 @@ What's New Releases ------------- +v1.1.1 +^^^^^^^^^^^^^^ + +- Release 1.1.1 +- Added script for building on Cheyenne with maxed out Intel settings, which + also included a patch for numpy.distutils. +- Fixed a few unicode characters hiding in a docstring that were causing + problems on Cheyenne, and also building the docs with Sphinx with Python 2.x. + + v1.1.0 ^^^^^^^^^^^^^^ diff --git a/src/wrf/version.py b/src/wrf/version.py index aebf1b8..c5762ad 100644 --- a/src/wrf/version.py +++ b/src/wrf/version.py @@ -1,2 +1,2 @@ -__version__ = "1.1.0" +__version__ = "1.1.1" From 63109fffef9047caaee8cb5a2d142b5a9f66c5b6 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 14:12:51 -0700 Subject: [PATCH 12/15] Fix typo --- chey_intel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chey_intel.py b/chey_intel.py index 8ba16b7..78d194f 100644 --- a/chey_intel.py +++ b/chey_intel.py @@ -58,7 +58,7 @@ class IntelFCompiler(BaseIntelFCompiler): def get_flags_opt(self): # Scipy test failures with -O2 v = self.get_version() mpopt = '' - return ['-fp-model strict -O2 -{}'.format(mpopt)] + return ['-fp-model strict -O2'] def get_flags_arch(self): return [] @@ -124,7 +124,7 @@ class IntelEM64TFCompiler(IntelFCompiler): def get_flags_opt(self): # Scipy test failures with -O2 v = self.get_version() mpopt = '' - return ['-fp-model strict -O2 -{}'.format(mpopt)] + return ['-fp-model strict -O2'] def get_flags_arch(self): return [''] From 411cfd17cf4aa6c12222e13b653a2e5ab2294ad4 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 15:03:56 -0700 Subject: [PATCH 13/15] Fix mdbz on cheyenne. Xarray doesn't work with np.amax on cheyenne for some reason. --- doc/source/new.rst | 2 ++ src/wrf/g_dbz.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/source/new.rst b/doc/source/new.rst index 5197ebb..9faff79 100644 --- a/doc/source/new.rst +++ b/doc/source/new.rst @@ -12,6 +12,8 @@ v1.1.1 also included a patch for numpy.distutils. - Fixed a few unicode characters hiding in a docstring that were causing problems on Cheyenne, and also building the docs with Sphinx with Python 2.x. +- Fix issue with np.amax not working with xarray on Cheyenne, causing an error + with the mdbz product. v1.1.0 diff --git a/src/wrf/g_dbz.py b/src/wrf/g_dbz.py index 4c0e71f..f16b6bb 100755 --- a/src/wrf/g_dbz.py +++ b/src/wrf/g_dbz.py @@ -6,7 +6,7 @@ import numpy as np #from .extension import computedbz,computetk from .extension import _dbz, _tk from .constants import Constants -from .util import extract_vars +from .util import extract_vars, to_np from .metadecorators import copy_and_set_metadata @@ -194,7 +194,7 @@ def get_max_dbz(wrfin, timeidx=0, method="cat", be a :class:`numpy.ndarray` object with no metadata. """ - return np.amax(get_dbz(wrfin, timeidx, method, squeeze, cache, meta, - _key, use_varint, use_liqskin), + return np.amax(to_np(get_dbz(wrfin, timeidx, method, squeeze, cache, meta, + _key, use_varint, use_liqskin)), axis=-3) From 607e095a9e2b00b5aea35192a112bc97e425e978 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 15:21:46 -0700 Subject: [PATCH 14/15] Fix missing openmp private variables --- fortran/rip_cape.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/rip_cape.f90 b/fortran/rip_cape.f90 index c92be3f..5e9cdac 100644 --- a/fortran/rip_cape.f90 +++ b/fortran/rip_cape.f90 @@ -708,7 +708,7 @@ SUBROUTINE DCAPECALC2D(prs,tmk,qvp,ght,ter,sfp,cape,cin,& !$OMP PARALLEL DO COLLAPSE(2) PRIVATE(tlcl, ethpari, & !$OMP zlcl, kk, ilcl, klcl, tmklift, tvenv, tvlift, ghtlift, & !$OMP facden, tmkenv, qvpenv, eslift, qvplift, buoy, benamin, & - !$OMP benaccum, zrel, kmax, dz, elfound, & + !$OMP benaccum, zrel, kmax, dz, elfound, gammam, cpm, e, & !$OMP kel, klfc, pavg, p2, p1, totthe, totqvp, totprs, & !$OMP i, j, k, kpar, kpar1, kpar2, qvppari, tmkpari, p, pup, pdn, th, & !$OMP pp1, pp2, ethmax, eth_temp, klev) SCHEDULE(runtime) From 514d9ecaec67bb184d0e6c24b785e0a1bb1fed68 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 1 Feb 2018 15:37:08 -0700 Subject: [PATCH 15/15] Updated doc --- doc/source/new.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/new.rst b/doc/source/new.rst index 9faff79..c6f949d 100644 --- a/doc/source/new.rst +++ b/doc/source/new.rst @@ -9,11 +9,12 @@ v1.1.1 - Release 1.1.1 - Added script for building on Cheyenne with maxed out Intel settings, which - also included a patch for numpy.distutils. + also required a patch for numpy.distutils. - Fixed a few unicode characters hiding in a docstring that were causing - problems on Cheyenne, and also building the docs with Sphinx with Python 2.x. + problems on Cheyenne, and also building the docs with Sphinx on Python 2.x. - Fix issue with np.amax not working with xarray on Cheyenne, causing an error with the mdbz product. +- Fix cape_2d private variable bug when running with multiple CPUs. v1.1.0