Skip to content

Commit

Permalink
Sourced from alperaltuntas, ada_cdf5 branch. Support for Ada and netC…
Browse files Browse the repository at this point in the history
…DF 64-bit format, with FOSS toolchain.

Sourced from alperaltuntas, ada_cdf5 branch. Modified to support ocn_za compilation using FOSS toolchain.

Modified to create a conda env from scratch, and install prerequisites from env_reqs.txt. Fixed deactivate
Skips conda create if env already present. Still testing this script

Hack to get diagnostics to build, as >=2.10 seems to require Python3 to install.

A central file to pre-install dependencies before the submodules start to install.
May not be necessary, but I got it to work, so..
  • Loading branch information
Abishek Gopal committed Feb 18, 2020
1 parent 469c5da commit a1f820f
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 15 deletions.
20 changes: 20 additions & 0 deletions Machines/ada_modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -l

echo "Loading modules for CESM_postprocessing tool..."

module purge
ml NCL/6.6.2-foss-2018b
ml NCO/4.7.9-foss-2018b
ml netCDF/4.6.1-foss-2018b-cdf5
#ml python/2.7.13-generic
ml Python/2.7.15-foss-2018b
#ml Anaconda3/5.2.0
ml Miniconda2/4.3.21

#source /ihesp/user/agopal/CESM_postprocessing/cesm-env2/bin/activate
#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/site-packages:$PYTHONPATH
#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/build/lib.linux-x86_64-2.7/PyNIO:$PYTHONPATH
#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/cesm-env2/lib/python2.7/site-packages/PyNIO:$PYTHONPATH
#export PYNIOPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/site-packages/PyNIO


59 changes: 59 additions & 0 deletions Machines/machine_postprocess.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,64 @@
</components>
</machine>

<machine name="ada" hostname="login">
<timeseries_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</timeseries_pes>
<xconform_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</xconform_pes>
<mpi_command>mpirun</mpi_command>
<pythonpath></pythonpath>
<f2py fcompiler="gfortran" f77exec="/sw/eb/software/GCCcore/7.3.0/bin/gfortran">f2py</f2py>
<za>
<compiler>gfortran</compiler>
<flags>-c -g -O2</flags>
<include>-I/sw/eb/software/netCDF/4.6.1-foss-2018b-cdf5/include -I/sw/eb/software/netCDF-Fortran/4.4.4-foss-2018b/include</include>
<libs>-L/sw/eb/software/netCDF-Fortran/4.4.4-foss-2018b/lib -lnetcdff -L/sw/eb/software/GCCcore/7.3.0/lib64 -L/sw/eb/software/GCCcore/7.3.0/lib -L/sw/eb/software/OpenBLAS/0.3.1-GCC-7.3.0-2.30/lib -L/sw/eb/software/ScaLAPACK/2.0.2-gompi-2018b-OpenBLAS-0.3.1/lib -L/sw/eb/software/FFTW/3.3.8-gompi-2018b/lib -L/sw/eb/software/netCDF/4.6.1-foss-2018b/lib64 -lnetcdf -lnetcdf -lm -lpthread</libs>
</za>
<reset_modules>
<module>module purge</module>
</reset_modules>
<modules>
<module>ml NCL/6.6.2-foss-2018b</module>
<module>ml NCO/4.7.9-foss-2018b</module>
<module>ml netCDF/4.6.1-foss-2018b-cdf5</module>
<module>ml Python/2.7.15-foss-2018b</module>
<!-- <module>export PYTHONPATH=/ihesp/altuntas/CESM_postprocessing_cdf5/pynio/site-packages:$PYTHONPATH</module>
<module>export PYTHONPATH=/ihesp/altuntas/CESM_postprocessing_cdf5/pynio/build/lib.linux-x86_64-2.7/PyNIO:$PYTHONPATH</module>
<module>export PYNIOPATH=/ihesp/altuntas/CESM_postprocessing_cdf5/pynio/site-packages/PyNIO</module>-->
</modules>
<components>
<component name="atm">
<averages_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</averages_pes>
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<regrid_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</regrid_pes>
<obs_root>/glade/p/cesm/amwg/amwg_data</obs_root> <!-- TODO: update this and other obs_roots -->
</component>
<component name="ice">
<averages_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</averages_pes>
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<obs_root>/glade/p/cesm/pcwg/ice/data</obs_root>
</component>
<component name="lnd">
<averages_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</averages_pes>
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<regrid_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="02:00:00" memory="18000">3</regrid_pes>
<obs_root>/glade/p/cesm/lmwg/diag/lnd_diag_data</obs_root>
</component>
<component name="ocn">
<averages_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</averages_pes>
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<obs_root>/scratch/user/altuntas/obsroot</obs_root> <!-- TODO: move to a permanent dir -->
</component>
<component name="ilamb">
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<initialize_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="06:00:10" memory="18000">3</initialize_pes>
<obs_root>/glade/p/cesm/lmwg_dev/oleson/ILAMB/ILAMB_all</obs_root>
</component>
<component name="iomb">
<diagnostics_pes queue="mn_small" nodes="1" pes_per_node="3" wallclock="6:00" memory="18000">3</diagnostics_pes>
<initialize_pes queue="mn_small" nodes="2" pes_per_node="1" wallclock="00:00:10" memory="18000">3</initialize_pes>
<obs_root>/glade/p/cesm/omwg/obs_data/IOMB</obs_root>
</component>
</components>
</machine>
</machine_postprocess>

27 changes: 13 additions & 14 deletions create_python_env
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,15 @@ fi
#----------------------------------------------------------------------
env="${pp_dir}/cesm-env2"
echo $env
if [ ! -d $env ]; then
status="ERROR"
info="$progname - ${pp_dir}/cesm-env2 virtual environment does not exist.
Check the $module_script for the correct ncar_pylib virtualenv clone command.
If a new or updated virtual environment needs to be created then follow these steps:
>cd ${pp_dir}
>make clobber
>make clobber-env
and rerun this script."
print_result $status "$info"
exit 0
#if [ ! -d $env ]; then
if [ -d $env ]; then
#status="ERROR"
info="$progname - ${pp_dir}/cesm-env2 virtual environment already exists. Skipping conda create"
print_result "$info"
else
export CONDA_ENVS_PATH=${pp_dir}
export CONDA_PKGS_DIRS=/ihesp/user/agopal/conda/pkgs
conda create python=2.7 -n cesm-env2
fi

#----------------------------------------------------------------------
Expand All @@ -167,6 +163,9 @@ cd $pp_dir
echo "$progname - activating virtual environment in ${pp_dir}/cesm-env2."
. cesm-env2/bin/activate

export PATH=${pp_dir}/cesm-env2/bin:$PATH

cesm-env2/bin/pip install -r env_reqs.txt
#----------------------------------------------------------------------
# install post processing packages
#----------------------------------------------------------------------
Expand Down Expand Up @@ -229,7 +228,7 @@ ln -sf $pp_dir/ocn_diag/tool_lib/zon_avg/za $pp_dir/ocn_diag/tool_lib/za
#----------------------------------------------------------------------
# cleanup and deactivate the virtualenv.
#----------------------------------------------------------------------
deactivate
source deactivate

cd $curdir

Expand Down
3 changes: 2 additions & 1 deletion diagnostics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jinja2>=2.10
#jinja2>=2.10
jinja2==2.7.3
numpy>=1.8.1
ilamb>=2.1
9 changes: 9 additions & 0 deletions env_reqs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scipy==1.1.0
pandas==0.23.1
numpy==1.16.5
netCDF4==1.5.3
mpi4py==2.0.0
#cf_units>=2.0.0
matplotlib>=1.4.3
Jinja2==2.7.3
sympy>=0.7.6

0 comments on commit a1f820f

Please sign in to comment.