espnet3.utils.logging_utils.log_env_metadata
Less than 1 minute
espnet3.utils.logging_utils.log_env_metadata
espnet3.utils.logging_utils.log_env_metadata(logger: Logger, cluster_prefixes: Iterable[str] | None = None, runtime_prefixes: Iterable[str] | None = None, runtime_keys: Iterable[str] | None = None) → None
Log selected cluster and runtime environment variables.
Output blocks. : - Cluster environment variables (scheduler/runtime IDs).
- Runtime environment variables (CUDA/NCCL/OMP/PATH, etc.).
Default environment variables.
Cluster prefixes. : - SLURM_: Slurm job/step metadata.
PBS_: PBS/Torque job metadata.LSF_: LSF job metadata.SGE_: SGE job metadata.COBALT_: Cobalt job metadata.OMPI_: Open MPI runtime metadata.PMI_: PMI metadata.MPI_: Generic MPI runtime metadata.
Runtime prefixes. : - NCCL_: NCCL configuration.
CUDA_: CUDA runtime configuration.ROCM_: ROCm runtime configuration.OMP_: OpenMP threading configuration.MKL_: Intel MKL configuration.OPENBLAS_: OpenBLAS configuration.UCX_: UCX communication configuration.NVIDIA_: NVIDIA runtime configuration.
Explicit runtime keys. : - PATH: Executable search path.
PYTHONPATH: Python module search path.LD_LIBRARY_PATH: Shared library search path.CUDA_VISIBLE_DEVICES: GPU visibility mask.RANK: Global rank.LOCAL_RANK: Local rank on node.NODE_RANK: Node rank in job.WORLD_SIZE: Total process count.MASTER_ADDR: Distributed master address.MASTER_PORT: Distributed master port.
Example usage. : ```python from pathlib import Path from espnet3.utils.logging_utils import configure_logging, log_env_metadata <br/> logger = configure_logging(log_dir=Path("exp/run1")) log_env_metadata(logger)
**Example log output.**
: ```text
[hostname] 2026-02-11 03:57:17 EST (run.py:256) INFO: [train] Cluster env:
SLURM_JOB_ID=6335268
[hostname] 2026-02-11 03:57:17 EST (run.py:256) INFO: [train] Runtime env:
CUDA_VISIBLE_DEVICES=0
NCCL_DEBUG=INFO
PATH=/usr/local/bin:/usr/bin:...- Parameters:
- logger (logging.Logger) – Logger used to emit metadata.
- cluster_prefixes (Iterable *[*str ] | None) – Prefixes for cluster variables.
- runtime_prefixes (Iterable *[*str ] | None) – Prefixes for runtime variables.
- runtime_keys (Iterable *[*str ] | None) – Explicit runtime keys to include.
- Returns: None
Example
>>> import logging
>>> log_env_metadata(logging.getLogger("espnet3"))