### Initialize CRYOWRF Dependencies and Environment Source: https://docs.cscs.ch/software/cw/wrf This section sets up the root directory for WRF and CRYOWRF installations, defines a directory for dependencies, and downloads and bootstraps the uenv-spack tool. It then starts the necessary uenv environment. ```bash # the root directory under which all dependencies and WRF/CRYOWRF will be installed export WRFROOT=$STORE/wrf # the directory where we will install the dependencies of WRF/CRYOWRF/WPS export WRFDEPS=$WRFROOT/dependencies # assume that we are crating WRFROOT for the first time mkdir $WRFROOT # download and install uenv-spack git clone https://github.com/eth-cscs/uenv-spack.git $WRFROOT/uenv-spack (cd $WRFROOT/uenv-spack && ./bootstrap) # start the uenv with the spack view enabled # warning: bootstrap the uenv-spack tool _before_ starting the uenv uenv start prgenv-gnu/24.11:v2 --view=spack ``` -------------------------------- ### Configure and Build Dependencies with uenv-spack Source: https://docs.cscs.ch/software/cw/wrf This snippet starts a uenv session, configures the build environment with specified compilers and view, and then uses uenv-spack to install the required dependencies. Finally, it navigates to the dependency directory and initiates the build process. ```bash # start the uenv with the spack view enabled uenv start prgenv-gnu/24.11:v2 --view=spack $WRFROOT/uenv-spack/uenv-spack $WRFDEPS --uarch=zen2 --specs='parallel-netcdf,jasper~shared,libpng,zlib-ng' cd $WRFDEPS ./build ``` -------------------------------- ### Example Custom Environment Script Source: https://docs.cscs.ch/software/uenv/guides An example script demonstrating how to create a custom command to start a new shell with a specific uenv loaded, along with additional environment customizations like loading modules and setting environment variables. ```bash # always add this line source ~/.bashrc ``` -------------------------------- ### Starting Uenv with Specific Views Source: https://docs.cscs.ch/software/uenv/using Illustrates how to start a user environment (`uenv`) and activate specific views using the `uenv start` command. It shows examples of activating a single view, multiple views using a comma-separated list, and disambiguating views when starting multiple uenvs. ```bash # activate the view named default in prgenv-gnu $ uenv start --view=default prgenv-gnu/24.11:v1 # activate both the spack and modules views in prgenv-gnu using # a comma-separated list of view names $ uenv start --view=spack,modules prgenv-gnu/24.11:v1 # when starting multiple uenv, you can disambiguate using uenvname:viewname $ uenv start --view=prgenv-gnu:default,editors:ed prgenv-gnu/24.11:v1,editors ``` -------------------------------- ### Starting User Environment Source: https://docs.cscs.ch/software/cw/wrf This command starts a specific user environment, likely for scientific computing, with the 'prgenv-gnu/24.11:v2' configuration. This ensures that the necessary compilers and libraries are loaded before proceeding with subsequent build steps. ```bash uenv start --view-default prgenv-gnu/24.11:v2 ``` -------------------------------- ### Initialize Project Directory and Dependencies Source: https://docs.cscs.ch/software/cw/wrf This snippet initializes the WRF root directory and dependency directory, creates the root directory, and changes the current directory to it for subsequent installations. ```bash # the root directory under which all dependencies and WRF/CRYOWRF will be installed export WRFROOT=$STORE/wrf # the directory where we will install the dependencies of WRF/CRYOWRF/WPS export WRFDEPS=$WRFROOT/dependencies # assume that we are crating WRFROOT for the first time mkdir $WRFROOT cd $WRFROOT ``` -------------------------------- ### Create WRF Working Directory and Install uenv-spack Source: https://docs.cscs.ch/software/cw/wrf This snippet outlines the initial steps for setting up a working directory for WRF and cloning the uenv-spack tool. uenv-spack is a utility for managing software environments and installations using Spack. ```bash mkdir $STORE/wrf cd $STORE/wrf git clone https://github.com/eth-cscs/uenv-spack.git (cd uenv-spack && ./bootstrap) ``` -------------------------------- ### Verify WRF Module Availability and Path Source: https://docs.cscs.ch/software/cw/wrf These commands demonstrate how to list available modules after setting the module path and how to find the path to the WRF executable. This is useful for confirming the installation and understanding where the executables are located. ```bash $STORE/wrf/uenv-spack/uenv-spack $PWD/build --uarch=zen2 --specs=wrf@4.6.1 cd build ./build module use $STORE/wrf/build/modules module avail module load wrf which wrf.exe ``` -------------------------------- ### Initialize SNOWPACK Build Environment Source: https://docs.cscs.ch/software/cw/wrf This section sets up the environment for building SNOWPACK. It starts a uenv session with a default view, sets paths for WRF root and dependencies, clones the CRYOWRF repository, and configures essential build variables including compiler paths and WRF specific flags. ```bash uenv start --view-default prgenv-gnu/24.11:v2 # set the paths to match those used in Step 1 export WRFROOT=$STORE/wrf export WRFDEPS=$WRFROOT/dependencies git clone https://gitlabext.wsl.ch/atmospheric-models/CRYOWRF.git $WRFROOT/CRYOWRF cd $WRFROOT/CRYOWRF export NETCDF=/user-environment/env/default export HDF5=/user-environment/env/default export PNETCDF=$WRFDEPS/view export WRF_EM_CORE=1 export WRF_NMM_CORE=0 export WRF_DA_CORE=0 export WRF_CHEM=0 export WRF_KPP=0 export NETCDF4=1 export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export WRFIO_NCD_NO_LARGE_FILE_SUPPORT=0 export CC=mpicc export FC=mpifort export CXX=mpic++ ./clean.sh ./compiler_snow_libs.sh ``` -------------------------------- ### Example CI Job Configuration Source: https://docs.cscs.ch/services/cicd This YAML snippet demonstrates a typical job setup for the CSCS CI system. It includes commands to run before the main script, such as cloning a repository and installing dependencies. It also defines environment variables used within the job, like the target system and configuration paths. ```yaml job: before_script: - git clone https://github.com/eth-cscs/cscs-reframe-tests - pip install -r cscs-reframe-tests/config/utilities/requirements.txt - sed -i -e "s/account=csstaff/account=$CSCS_CI_DEFAULT_SLURM_ACCOUNT/" cscs-reframe-tests/config/systems-firecrest/eiger.py variables: FIRECREST_SYSTEM: 'eiger' FIRECREST_BASEDIR: /capstor/scratch/cscs/jenkssl/reframe-runner RFM_FIRECREST: '1' RFM_CONFIG: cscs-reframe-tests/config/cscs.py RFM_CHECKPATH: cscs-reframe-tests/checks/microbenchmarks/mpi/halo_exchange ``` -------------------------------- ### Dockerfile Example for Multi-Stage Spack Build Source: https://docs.cscs.ch/services/cicd This Dockerfile demonstrates a multi-stage build using 'spack-build' for installing software and 'spack-runtime' for the final image. It includes steps for configuring Spack, installing packages, and setting up the environment. Dependencies include the base 'spack-build' and 'spack-runtime' images. ```dockerfile # use spack to install the software stack FROM $CSCS_REGISTRY/docker-ci-ext/base-containers/public/spack-build:spack0.21.0-ubuntu22.04-cuda12.4.1 as builder # number or processes used for building the spack software stack ARG NUM_PROCS RUN spack-install-helper --target alps-gh200 \ "git" "cmake" "valgrind" "python@3.11" "vim +python +perl +lua" # end of builder container, now we are ready to copy necessary files # copy only relevant parts to the final container FROM $CSCS_REGISTRY/docker-ci-ext/base-containers/public/spack-runtime:ubuntu22.04-cuda12.4.1 # it is important to keep the paths, otherwise your installation is broken # all these paths are created with the above `spack-install-helper` invocation COPY --from=builder /opt/spack-environment /opt/spack-environment COPY --from=builder /opt/software /opt/software COPY --from=builder /opt/._view /opt/._view COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh # Some boilerplate to get all paths correctly - fix_spack_install is part of the base image # and makes sure that all important things are being correctly setup RUN fix_spack_install # Finally install software that is needed, e.g. compilers # It is also possible to build compilers via spack and let all dependencies be handled by spack RUN apt-get -yqq update && apt-get -yqq upgrade \ && apt-get -yqq install build-essential gfortran \ && rm -rf /var/lib/apt/lists/* ``` -------------------------------- ### Create and Activate Python Virtual Environment on uenv Source: https://docs.cscs.ch/software/ml/pytorch Shows the process of starting a uenv, creating a Python virtual environment with system site packages, activating it, installing a package, and deactivating it. This allows for isolated Python package management. ```bash $ uenv start pytorch/v2.6.0:v1 --view=default $ python -m venv --system-site-packages venv-uenv-pt2.6-v1 $ source venv-uenv-pt2.6-v1/bin/activate (venv-uenv-pt2.6-v1) $ pip install (venv-uenv-pt2.6-v1) $ deactivate $ exit ``` -------------------------------- ### Install uenv-spack Dependency Manager Source: https://docs.cscs.ch/software/cw/wrf This code downloads and bootstraps the uenv-spack tool, which is used to manage and install project dependencies. It clones the repository and runs the bootstrap script within the uenv-spack directory. ```bash # download and install uenv-spack git clone https://github.com/eth-cscs/uenv-spack.git $WRFROOT/uenv-spack (cd $WRFROOT/uenv-spack && ./bootstrap) ``` -------------------------------- ### Start prgenv-gnu Environment with Default View Source: https://docs.cscs.ch/software/prgenv/prgenv-gnu Initializes the prgenv-gnu programming environment using the default filesystem view, which automatically loads all provided packages. This is the simplest approach for users starting with the environment. The example demonstrates accessing Python from version 25.6. ```bash # start using the default view $ uenv start --view=default prgenv-gnu/25.6:v1 # the python executable provided by the uenv is the default, and is a recent version $ which python /user-environment/env/default/bin/python $ python --version Python 3.13.5 ``` -------------------------------- ### Build the WRF Software Source: https://docs.cscs.ch/software/cw/wrf After configuring and specifying the build options, this command executes the build process for WRF. This step involves Spack compiling WRF and its dependencies, which can take a significant amount of time. ```bash cd build ./build ``` -------------------------------- ### Configuring WPS Source: https://docs.cscs.ch/software/cw/wrf This sequence sets up environment variables for WRF dependencies (NETCDF, HDF5, PNETCDF, JASPER) and then navigates to the WPS source directory. It runs the './configure' script for WPS, prompting the user to select configuration options (option 1 is chosen here). ```bash # set the paths to match those used in Step 1 export WRFROOT=$STORE/wrf export WRFDEPS=$WRFROOT/dependencies # set variables used by the WRF build tool export NETCDF=/user-environment/env/default export HDF5=/user-environment/env/default export PNETCDF=$WRFDEPS/view export JASPERLIB=$WRFDEPS/view/lib64 export JASPERINC=$WRFDEPS/view/include export CC=mpicc export FC=mpifort export CXX=mpic++ cd $WRFROOT/CRYOWRF/WPS-4.2 ./configure # choose option 1 ``` -------------------------------- ### Configure WRF Build Source: https://docs.cscs.ch/software/cw/wrf This code prepares the environment for building WRF. It sets up paths to dependencies and SNOWPACK libraries, configures WRF-specific build options, and then runs the `./configure` script. The `vim configure.wrf` command is included to allow manual editing of configuration settings. ```bash uenv start --view-default prgenv-gnu/24.11:v2 # set the paths to match those used in Step 1 export WRFROOT=$STORE/wrf export WRFDEPS=$WRFROOT/dependencies # required for the CRYOWRF build to find SNOWPACK built in step 1 export SNOWLIBS=$WRFROOT/CRYOWRF/snpack_for_wrf # set variables used by the WRF build tool export NETCDF=/user-environment/env/default export HDF5=/user-environment/env/default export PNETCDF=$WRFDEPS/view export WRF_EM_CORE=1 export WRF_NMM_CORE=0 export WRF_DA_CORE=0 export WRF_CHEM=0 export WRF_KPP=0 export NETCDF4=1 export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export WRFIO_NCD_NO_LARGE_FILE_SUPPORT=0 export CC=mpicc export FC=mpifort export CXX=mpic++ git clone https://gitlabext.wsl.ch/atmospheric-models/CRYOWRF.git $WRFROOT/CRYOWRF cd $WRFROOT/CRYOWRF/WRF ./clean -a # [choose option 34][nesting: choose option 1] when prompted by configure ./configure # edit configure.wrf vim configure.wrf # SFC = gfortran # SCC = gcc # CCOMP = gcc # DM_FC = mpif90 # DM_CC = mpicc # FC = mpif90 # FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG) -fallow-argument-mismatch -fallow-invalid-boz -g ``` -------------------------------- ### Build SNOWPACK and CRYOWRF Source: https://docs.cscs.ch/software/cw/wrf This snippet compiles SNOWPACK and CRYOWRF. It ensures the correct environment is active and then executes the cleaning and compilation scripts for SNOWPACK. This prepares the necessary libraries for the WRF build in the next step. ```bash # set the paths to match those used in Step 1 export WRFROOT=$STORE/wrf export WRFDEPS=$WRFROOT/dependencies uenv start prgenv-gnu/24.11:v2 --view=default # First download the CRYOWRF software: git clone https://gitlabext.wsl.ch/atmospheric-models/CRYOWRF.git $WRFROOT/CRYOWRF cd $WRFROOT/CRYOWRF # Set the following environment variables: export NETCDF=/user-environment/env/default export HDF5=/user-environment/env/default export PNETCDF=$WRFDEPS/view export WRF_EM_CORE=1 export WRF_NMM_CORE=0 export WRF_DA_CORE=0 export WRF_CHEM=0 export WRF_KPP=0 export NETCDF4=1 export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export WRFIO_NCD_NO_LARGE_FILE_SUPPORT=0 export CC=mpicc export FC=mpifort export CXX=mpic++ # Then compile SNOWPACK: ./clean.sh ./compiler_snow_libs.sh ``` -------------------------------- ### Serving Documentation Locally with MkDocs Source: https://docs.cscs.ch/contributing This command starts a local development server for the documentation. It requires the `uv` package to be installed. The server watches for file changes and automatically rebuilds the documentation, reloading the page in your browser. ```shell ./serve ... INFO - [08:33:34] Serving on http://127.0.0.1:8000/ ``` -------------------------------- ### Clone Nanotron Repository from GitHub Source: https://docs.cscs.ch/tutorials/ml/llm-nanotron-training Bash commands to download the Nanotron repository from Hugging Face GitHub and checkout a specific commit. Executed on the login node in the $SCRATCH/tutorials/nanotron-pretrain directory. This prepares the source code for installation in the virtual environment. ```bash [clariden-lnXXX]$ cd $SCRATCH/tutorials/nanotron-pretrain [clariden-lnXXX]$ git clone https://github.com/huggingface/nanotron.git [clariden-lnXXX]$ cd nanotron [clariden-lnXXX]$ git checkout 5f8a52b08b702e206f31f2660e4b6f22ac328c95 ``` -------------------------------- ### Start uenv with Spack View for WRF Build Source: https://docs.cscs.ch/software/cw/wrf This command starts a specific uenv environment with the Spack view enabled, which is necessary for building WRF and its dependencies. It uses the 'prgenv-gnu' environment, version 24.11:v2. ```bash uenv start prgenv-gnu/24.11:v2 --view=spack ``` -------------------------------- ### Install Nanotron in Virtual Environment with srun Source: https://docs.cscs.ch/tutorials/ml/llm-nanotron-training Bash commands to create a thin Python virtual environment on top of the container image using srun with the EDF configuration, then install Nanotron in editable mode. The --system-site-packages flag ensures access to pre-installed dependencies in the container, avoiding redundant package installation. This virtual environment must be activated in subsequent job submissions. ```bash [clariden-lnXXX]$ srun -A --environment=./ngc-nanotron-24.04.toml --pty bash user@nidYYYYYY$ python -m venv --system-site-packages venv-24.04 user@nidYYYYYY$ source venv-24.04/bin/activate (venv-24.04) user@nidYYYYYY$ cd nanotron/ && pip install -e . ``` -------------------------------- ### Install CRYOWRF Dependencies using uenv-spack Source: https://docs.cscs.ch/software/cw/wrf This command installs the required dependencies for CRYOWRF and WRF/WPS using uenv-spack. It specifies the build directory for dependencies and lists the necessary Spack specifications like 'parallel-netcdf', 'jasper', 'libpng', and 'zlib-ng'. ```bash # configure the environment and build it $WRFROOT/uenv-spack/uenv-spack $WRFDEPS --uarch=zen2 --specs='parallel-netcdf,jasper~shared,libpng,zlib-ng' cd $WRFDEPS ./build ``` -------------------------------- ### Configure Container Image Directory with LUSTRE Settings Source: https://docs.cscs.ch/tutorials/ml/llm-nanotron-training This command sequence creates a directory for container images and configures it with LUSTRE settings for optimal performance. It sets extended attributes for file striping and caching, which is beneficial for high-performance storage environments. ```bash #!/bin/bash [clariden-lnXXX]$ mkdir -p $SCRATCH/ce-images [clariden-lnXXX]$ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 -S 4M $SCRATCH/ce-images ``` -------------------------------- ### Build Specific WRF Version using uenv-spack Source: https://docs.cscs.ch/software/cw/wrf This command builds a specific version of WRF (e.g., 4.5.2) using uenv-spack. It allows for precise version control of the WRF installation. ```bash $PWD/uenv-spack/uenv-spack $PWD/build --uarch=zen2 --specs=wrf@4.5.2 ``` -------------------------------- ### Run Nanotron Training with srun and Torchrun Source: https://docs.cscs.ch/tutorials/ml/llm-nanotron-training This script demonstrates how to launch the Nanotron training process using `srun` to manage SLURM resources and `bash` to execute commands within an activated virtual environment. It configures distributed training arguments for `torch.distributed.run` and specifies the training configuration file. Dependencies include the `venv-24.04` virtual environment and the `nanotron` package. ```bash #!/bin/bash #SBATCH --account= #SBATCH --job-name=pretrain-nanotron # create a short name for your job #SBATCH --time=00:45:00 #SBATCH --nodes=2 # total number of nodes #SBATCH --ntasks-per-node=4 # total number of tasks per node #SBATCH --output=logs/slurm-%x-%j.log # if #SBATCH --error=... is not specified, # this will also contain stderr (error messages) # Initialization. set -x cat $0 export HF_HOME=$SCRATCH/huggingface export CUDA_DEVICE_MAX_CONNECTIONS=1 export WANDB_API_KEY= # alternatively: export WANDB_MODE=offline # Run main script. srun -ul --environment=./ngc-nanotron-24.04.toml bash -c " # activate virtual environment source venv-24.04/bin/activate # change cwd and run the training script cd nanotron/ MASTER_ADDR=$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n 1) \ MASTER_PORT=29500 \ RANK=${SLURM_PROCID} \ LOCAL_RANK=${SLURM_LOCALID} \ WORLD_SIZE=${SLURM_NTASKS} \ python run_train.py --config-file examples/config_tiny_llama_wikitext.yaml " ``` -------------------------------- ### Example uenv Image Label Source: https://docs.cscs.ch/software/uenv/deploy Provides a concrete example of a uenv image label, illustrating how the general format is applied in practice. This example helps users understand how to interpret and construct uenv image labels. ```text prgenv-gnu/24.11:v2@todi%gh200 ``` -------------------------------- ### Load WRF Module in sbatch Script Source: https://docs.cscs.ch/software/cw/wrf This snippet shows how to load the WRF module within an sbatch script to make the installed WRF executable available. It requires setting the correct uenv and then using 'module use' and 'module load'. ```bash #SBATCH --uenv=prgenv-gnu/24.11:v2 module use $STORE/wrf/build/modules module load wrf ``` -------------------------------- ### Dockerfile for Base Container Image (Dockerfile.base) Source: https://docs.cscs.ch/services/cicd This Dockerfile defines the base container image. It starts from a Spack-enabled Ubuntu image and uses `spack-install-helper` to install specified packages like PETSc and Trilinos. It supports an argument `NUM_PROCS` for parallel installations. ```dockerfile FROM docker.io/finkandreas/spack:0.19.2-cuda11.7.1-ubuntu22.04 ARG NUM_PROCS RUN spack-install-helper daint-gpu \ petsc \ trilinos ``` -------------------------------- ### Start uenv and Test MPI Compilers and Python Source: https://docs.cscs.ch/software/ml/pytorch Demonstrates how to start a uenv with a specific view and verify the paths and versions of Python and MPI compilers (mpicc). This is useful for ensuring the environment is correctly loaded. ```bash $ uenv start pytorch/v2.6.0:v1 --view=default $ which python /user-environment/env/default/bin/python $ python --version Python 3.13.0 $ which mpicc /user-environment/env/default/bin/mpicc $ mpicc --version gcc (Spack GCC) 13.3.0 $ gcc --version # the compiler wrapper uses the gcc provided by the uenv gcc (Spack GCC) 13.3.0 $ exit ``` -------------------------------- ### Create Container Image Directory with LUSTRE Settings Source: https://docs.cscs.ch/tutorials/ml/llm-inference This section demonstrates how to create a directory for container images and apply LUSTRE settings to optimize storage distribution. The `lfs setstripe` command configures striping parameters for better performance on shared file systems. ```bash [clariden-lnXXX]$ mkdir -p $SCRATCH/ce-images [clariden-lnXXX]$ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 -S 4M \ $SCRATCH/ce-images ``` -------------------------------- ### Custom PyTorch Container Configuration (Dockerfile) Source: https://docs.cscs.ch/access/jupyterlab Example Dockerfile for creating a custom PyTorch container compatible with Jupyter services. It installs essential packages like jupyterlab, jupyterhub, and specific versions of pyfirecrest, SQLAlchemy, oauthenticator, notebook, and jupyterlab_nvdashboard. It also installs the firecrestspawner from a GitHub repository. ```docker FROM nvcr.io/nvidia/pytorch:25.05-py3 RUN pip install --no-cache \ jupyterlab \ jupyterhub==4.1.6 \ pyfirecrest==1.2.0 \ SQLAlchemy==1.4.52 \ oauthenticator==16.3.1 \ notebook==7.3.3 \ jupyterlab_nvdashboard==0.13.0 \ git+https://github.com/eth-cscs/firecrestspawner.git ``` -------------------------------- ### Create Build Directory and Spack Environment Source: https://docs.cscs.ch/build-install/uenv Initializes a build directory with a template Spack environment file (`spack.yaml`) and a Spack package repository. The `--uarch` flag specifies the target architecture. After creation, navigate into the build directory and run the `./build` script. ```shell uenv-spack --uarch=gh200 cd ./build ``` -------------------------------- ### Compiling WPS Source: https://docs.cscs.ch/software/cw/wrf This command compiles the WPS (WRF Preprocessing System) software. The compilation output is redirected to 'log_compile'. ```bash ./compile &> log_compile ``` -------------------------------- ### Create Environment Description File (EDF) for Nanotron Source: https://docs.cscs.ch/tutorials/ml/llm-nanotron-training TOML configuration file that co-locates with the Dockerfile and specifies container image path, mount points, working directory, and environment variables for Nanotron pretraining. Includes NCCL debugging configuration and CUDA settings for GPU support. This file must be placed at $SCRATCH/tutorials/nanotron-pretrain/ngc-nanotron-24.04.toml. ```toml image = "${SCRATCH}/ce-images/ngc-nanotron+24.04.sqsh" mounts = [ "/capstor", "/iopsstor" ] workdir = "${SCRATCH}/tutorials/nanotron-pretrain/" [annotations] com.hooks.aws_ofi_nccl.enabled = "true" com.hooks.aws_ofi_nccl.variant = "cuda12" [env] NCCL_DEBUG = "INFO" CUDA_CACHE_DISABLE = "1" TORCH_NCCL_ASYNC_ERROR_HANDLING = "1" MPICH_GPU_SUPPORT_ENABLED = "0" ``` -------------------------------- ### Running WRF Executable Source: https://docs.cscs.ch/software/cw/wrf This command executes the main WRF model executable ('wrf.exe') after all necessary environment variables and configurations have been set. ```bash wrf.exe ``` -------------------------------- ### Set up Environment for NAMD Development Source: https://docs.cscs.ch/software/sciapps/namd This snippet sets up the development environment for NAMD. It defines variables for the NAMD source path and the development view name, then starts a user environment (uenv) and sets the VIEW_PATH variable. ```bash export DEV_VIEW_NAME="develop" export PATH_TO_NAMD_SOURCE= # Start uenv and load develop view uenv start --view=${DEV_VIEW_NAME} # Set variable VIEW_PATH to the view export DEV_VIEW_PATH=/user-environment/env/${DEV_VIEW_NAME} cd ${PATH_TO_NAMD_SOURCE} ``` -------------------------------- ### Troubleshoot module command not found error in uenv v9.0.0 Source: https://docs.cscs.ch/software/uenv/using Documents the bug in uenv version 9.0.0 (installed October 22, 2025) where the `module` command is not available in `uenv start` sessions on Santis and Clariden systems. Shows the error output when attempting to use `module avail` after starting a uenv session. ```bash $ uenv start prgenv-gnu/24.11:v2 --view=modules $ module avail bash: module: command not found ``` -------------------------------- ### Create Build Path with Spack Specs Source: https://docs.cscs.ch/build-install/uenv Creates a build directory and populates the `spack.yaml` file with specified Spack packages using the `--specs` argument. This allows defining the desired software stack during environment creation. After setup, navigate to the build directory and execute the `./build` script. ```shell uenv-spack $SCRATCH/install/tools --uarch=gh200 \ --specs="tree, screen, emacs +treesitter" cd $SCRATCH/install/tools ./build ``` -------------------------------- ### Uenv Label Structure Source: https://docs.cscs.ch/software/uenv/guides Defines the structure of a uenv label, including name, version, tag, system, and microarchitecture. Used for identifying and referencing specific uenv installations. ```text name/version:tag@system%uarch name: name of the uenv, e.g. gromacs, prgenv-gnu version: version of the uenv: e.g. v8.7, 2025.01 tag: a tag applied by CSCS system: name of the system/cluster, e.g. daint, clariden, eiger or santis uarch: node microarchitecture: one of gh200, a100, zen2, mi200, mi300a, zen3 ``` -------------------------------- ### Manage and Use Uenv Environments Source: https://docs.cscs.ch/software/uenv Workflow for finding, downloading, listing, and starting uenv environments. This includes searching for specific applications like NAMD, pulling the image, and verifying its installation. ```bash $ uenv image find namd uenv arch system id size(MB) date namd/3.0:v1 zen2 eiger cd8d842d108f2eb1 347 2025-05-21 $ uenv image pull namd pulling cd8d842d108f2eb1 100.00% ━━━━━━━━━━━━━━━━━━━━━━━━━ 348/348 (60.71 MB/s) updating namd/3.0:v1@eiger%zen2 $ uenv image ls uenv arch system id size(MB) date namd/3.0:v1 zen2 eiger cd8d842d108f2eb1 347 2025-05-21 $ uenv start namd/3.0:v1 $ which namd3 /user-environment/env/namd/bin/namd3 $ exit ```