From 19712d346166c1c0dc3c0ae60848ee15fff62ad2 Mon Sep 17 00:00:00 2001 From: Cristian Di Pietrantonio Date: Sat, 28 Sep 2024 19:14:19 +0800 Subject: [PATCH] Singularity: set `share loop devices` to `yes`. (#45846) https://docs.sylabs.io/guides/main/admin-guide/configfiles.html#loop-devices shared loop devices: This allows containers running the same image to share a single loop device. This minimizes loop device usage and helps optimize kernel cache usage. Enabling this feature can be particularly useful for large MPI jobs. --- var/spack/repos/builtin/packages/singularityce/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/singularityce/package.py b/var/spack/repos/builtin/packages/singularityce/package.py index 4969b1e3c27..8ebc4936d51 100644 --- a/var/spack/repos/builtin/packages/singularityce/package.py +++ b/var/spack/repos/builtin/packages/singularityce/package.py @@ -113,6 +113,11 @@ def fix_mksquashfs_path(self): "mksquashfs path = {0}".format(squash_path), join_path(prefix.etc, self.singularity_name, self.singularity_name + ".conf"), ) + filter_file( + r"^shared loop devices = no", + "shared loop devices = yes", + join_path(prefix.etc, self.singularity_name, self.singularity_name + ".conf"), + ) # # Assemble a script that fixes the ownership and permissions of several