Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
image = "library/ubuntu:24.04"
mounts = ["/capstor/scratch/cscs/${USER}<username>:/capstor/scratch/cscs/${USER}<username>"]
workdir = "/capstor/scratch/cscs/${USER}<username>"

Note: Ensure that your ${USER} environment variable is defined with your actual username.Enter your actual username insead of the <username> placeholder in the example above

Save this file as ubuntu.toml file in $HOME/.edf directory (which is the default location of EDF files). A more detailed explanation of each entry for the EDF can be seen in the EDF reference.

...

  • Syntax. Use ${VAR} to reference an environment variable VAR. The variable's value is resolved from the combined environment, which includes variables defined in the host and the container image, the later taking precedence.
  • Scope. Variable expansion is supported across all EDF parameters. This includes EDF’s parameters like mounts, workdir, image, etc. For example, ${SCRATCH} can be used in mounts to reference a directory path.
  • Undefined Variables. Referencing an undefined variable results in an error. To safely handle undefined variables, you can use the syntax ${VAR:-}, which evaluates to an empty string if VAR is undefined.
  • Preventing Expansion. To prevent expansion, use double dollar signs $$. For example, $$$$${VAR} will render as the literal string ${VAR}.
  • Limitations:
    • Variables defined within the [env] EDF table cannot reference other entries from [env] tables in the same or other EDF files (e.g. the ones entered as base environments) . Therefore, only environment variables from the host or image can be referenced.
  • Environment Variable Resolution Order. The environment variables in containers are resolved set based on the following order:
    1. TOML env: Variable values as defined in EDF’s [env].
    2. Container Image: Variables defined in the container image's environment take precedence.
    3. Host Environment: Environment variables defined in the host system.

...

A temporary workaround consists in ensuring that the PMI_RANK environment variable inside the container corresponds to the actual MPI rank of the process within the job step.
This can be achieved by wrapping the original command for the container within a bash command like shown below:

...