1. Environment
Install
The first step before running any sloop experiment, the user has to install python environment dedicated to sloop. To do so, run the following command:
$ sloop-conda-installSeveral options are available:
$ sloop-conda-install --help usage: sloop-conda-install [-h] [--label LABEL] [-a] [-l] [-x EXPORT] [-n] [-p PYTHON_VERSION] [-u USER] [--public] [--profile PROFILE] [-i INSTALL_DIR] [--exec-dir EXEC_DIR] [--miniconda-installer MINICONDA_INSTALLER] [-c CHANNEL] [--override-channels] [--strict-channel-priority] [--no-pip] [--env-dir ENV_DIR] [--env-file ENV_FILE] [--no-env] [--mod-dir MOD_DIR] [-m MOD_NAME] [--mod-as-template] [--no-mod] [-t TESTING_IMPORTS] [--no-color] Utility for installing conda and alot of useful packages for SLOOP users, locally or on known supercomputers optional arguments: -h, --help show this help message and exit --label LABEL label used in install directory and modulefile names, which defaults to "perso" or to the name of a meta- package when specified alone (default: sloop) -a, --avail show available meta-packages (default: False) -l, --list only list packages to install (default: False) -x EXPORT, --export EXPORT only installation specs as environment file (default: None) -n, --dry-run only show commands to be executed (default: False) -p PYTHON_VERSION, --python-version PYTHON_VERSION python version like 3 or 3.6 (default: 3) -u USER, --user USER user name (default: None) --public install everything as a public installation with most of the paths prefixed with "Public/" (default: False) --profile PROFILE installation profile, whose default is detected; list of profiles: path, home, default, datarmor, meteofrance, localhome, where path is a file path with a "/" inside (default: home) -i INSTALL_DIR, --install-dir INSTALL_DIR installation directory, which depends on the installation profile (default: None) --exec-dir EXEC_DIR directory where to download the installer and execute it, which defaults to home dir (default: ~) --miniconda-installer MINICONDA_INSTALLER miniconda url or local file (default: https://repo.ana conda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64 .sh) -c CHANNEL, --channel CHANNEL choose channels manually, instead of default ones: conda-forge (default: None) --override-channels do not override user config conda channels (default: False) --strict-channel-priority do not pass option --strict-channel-priority (default: False) --no-pip do not install pip packages (default: False) --env-dir ENV_DIR where to save the installed conda env (default: None) --env-file ENV_FILE basename of the environment yml file (default: {flat_install_dir}-{env_type}.yml) --no-env do not save the installed environment (default: False) --mod-dir MOD_DIR source directory for modulefiles (default: None) -m MOD_NAME, --mod-name MOD_NAME modulefile name to create (default: conda3/sloop) --mod-as-template save the module file as a template with the {install_dir} pattern (default: False) --no-mod do not create a modulefile (default: False) -t TESTING_IMPORTS, --testing-imports TESTING_IMPORTS imports to check the installation as a comma separated list of modules (default: None) --no-color do not colorize outputs (default: False) examples of usage:: sloop-conda-install -n # dry run means inform but do nothing, just to try sloop-conda-installWarning
The python installation directory is automatically defined. On a local computer, the directory will be $HOME but the user can explicitly give an other directory by passing the -i option.
$ sloop-conda-install -n Installation profile: home Chdir: /Users/mcaillau Install in new directory: /Users/mcaillau/Soft/conda3-sloop Download miniconda: https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh Install conda with: bash Miniconda3-py37_4.8.2-Linux-x86_64.sh -b -p /Users/mcaillau/Soft/conda3-sloop Install conda packages with: /Users/mcaillau/Soft/conda3-sloop/bin/conda install -q -y --override-channels --strict-channel-priority -c conda-forge appdirs cfgrib colorlog dask esmpy=8.2.0 gitpython htop mpi4py mpich nose python=3.7.6 pyyaml six xarray=0.16.0 xesmf=0.6.0 xoa=0.4.0 Export env with: /Users/mcaillau/Soft/conda3-sloop/bin/conda env export -n sloop --file /Users/mcaillau/Soft/conda3-sloop/environment.yml Create modulefile: /Users/mcaillau/Modulefiles/conda3/sloop Installation successfull ############################################################ /Users/mcaillau/Soft/conda3-sloop/bin/python /Users/mcaillau/Soft/conda3-sloop/bin/conda module use /Users/mcaillau/Modulefiles module load conda3/sloop ############################################################
Load
Load the dedicated sloop environment. To do so, first load the python environment, for instance:
$ module purge $ module use ~$LOGNAME/Modulefiles/conda3 $ module load sloopThen, export the following environment variables:
$ export MTOOLDIR=$WORKDIR $ export PATH=$PATH:~$LOGNAME/Src/vortex/bin:~$LOGNAME/Src/sloop/bin $ export PYTHONPATH=~$LOGNAME/Src/vortex/project:~LOGNAME/Src/vortex/site:~LOGNAME/Src/vortex/src:~$LOGNAME/Src/sloopThat’s it ! For all the commande lines above, the creation of an alias named sloopenv is recommanded.