From a228a299097e5ba1cebbd79e06a0474a40c5ef32 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Mon, 11 Apr 2022 20:00:43 +0000 Subject: [PATCH 1/5] modified the gentoo module to allow overwriting the location of the custom directory, to facilitate testing --- modules-avx/gentoo/2020.lua | 3 ++- modules-avx2/gentoo/2020.lua | 3 ++- modules-avx512/gentoo/2020.lua | 3 ++- modules-sse3/gentoo/2020.lua | 3 ++- modules/gentoo/2020.lua | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules-avx/gentoo/2020.lua b/modules-avx/gentoo/2020.lua index c33855a..f88828c 100644 --- a/modules-avx/gentoo/2020.lua +++ b/modules-avx/gentoo/2020.lua @@ -20,4 +20,5 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" +assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-avx2/gentoo/2020.lua b/modules-avx2/gentoo/2020.lua index 3cfe6d9..4ab92fd 100644 --- a/modules-avx2/gentoo/2020.lua +++ b/modules-avx2/gentoo/2020.lua @@ -20,4 +20,5 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" +assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-avx512/gentoo/2020.lua b/modules-avx512/gentoo/2020.lua index c56accb..ef16f1c 100644 --- a/modules-avx512/gentoo/2020.lua +++ b/modules-avx512/gentoo/2020.lua @@ -20,4 +20,5 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" +assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-sse3/gentoo/2020.lua b/modules-sse3/gentoo/2020.lua index 3e60913..385d195 100644 --- a/modules-sse3/gentoo/2020.lua +++ b/modules-sse3/gentoo/2020.lua @@ -20,4 +20,5 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" +assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules/gentoo/2020.lua b/modules/gentoo/2020.lua index 7e053aa..c085228 100644 --- a/modules/gentoo/2020.lua +++ b/modules/gentoo/2020.lua @@ -27,6 +27,7 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" +assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) conflict("StdEnv/2016.4") conflict("StdEnv/2018.3") From cc860ccea3a362e193ffaded5bf5a90405c7bce8 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Mon, 11 Apr 2022 20:37:17 +0000 Subject: [PATCH 2/5] modified arch modules to support RSNT_CUSTOM_ROOT too --- modules/arch/avx.lua | 3 ++- modules/arch/avx2.lua | 3 ++- modules/arch/avx512.lua | 3 ++- modules/arch/sse3.lua | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/arch/avx.lua b/modules/arch/avx.lua index f4cdd28..19c9ecb 100644 --- a/modules/arch/avx.lua +++ b/modules/arch/avx.lua @@ -1,4 +1,5 @@ if (mode() ~= "spider") then - prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx") + local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" + prepend_path("MODULEPATH", custom_root .. "/modules-avx") setenv("EBVERSIONARCH","avx") end diff --git a/modules/arch/avx2.lua b/modules/arch/avx2.lua index 6e9c721..52d6a4e 100644 --- a/modules/arch/avx2.lua +++ b/modules/arch/avx2.lua @@ -1,4 +1,5 @@ if (mode() ~= "spider") then - prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx2") + local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" + prepend_path("MODULEPATH", custom_root .. "/modules-avx2") setenv("EBVERSIONARCH","avx2") end diff --git a/modules/arch/avx512.lua b/modules/arch/avx512.lua index 5566cd8..4ba0991 100644 --- a/modules/arch/avx512.lua +++ b/modules/arch/avx512.lua @@ -1,4 +1,5 @@ if (mode() ~= "spider") then - prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx512") + local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" + prepend_path("MODULEPATH", custom_root .. "/modules-avx512") setenv("EBVERSIONARCH","avx512") end diff --git a/modules/arch/sse3.lua b/modules/arch/sse3.lua index cd852ca..ffa1d10 100644 --- a/modules/arch/sse3.lua +++ b/modules/arch/sse3.lua @@ -1,4 +1,5 @@ if (mode() ~= "spider") then - prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-sse3") + local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" + prepend_path("MODULEPATH", custom_root .. "/modules-sse3") setenv("EBVERSIONARCH","sse3") end From 7cfe018f9ae4f7519ebd18c4f42a4057abfebdea Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Mon, 11 Apr 2022 20:43:55 +0000 Subject: [PATCH 3/5] if RSNT_ENABLE_LMOD_CACHE is set to yes, enable the Lmod cache --- modules/gentoo/2020.lua.core | 3 +++ modules/nixpkgs/16.09.lua.core | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/gentoo/2020.lua.core b/modules/gentoo/2020.lua.core index aa5d063..21e7cda 100644 --- a/modules/gentoo/2020.lua.core +++ b/modules/gentoo/2020.lua.core @@ -61,6 +61,9 @@ else setenv("PIP_CONFIG_FILE", "/cvmfs/soft.computecanada.ca/config/python/pip-gentoo.conf") end setenv("MII_INDEX_FILE", "/cvmfs/soft.computecanada.ca/custom/mii/data/" .. arch .. "_" .. vendor_id) +if os.getenv("RSNT_ENABLE_LMOD_CACHE") == "yes" then + append_path("LMOD_RC", "/cvmfs/soft.computecanada.ca/config/lmod/lmodrc/cache_" .. arch .. "_" .. vendor_id .. ".lua") +end -- also make easybuild and easybuild-generated modules accessible prepend_path("PATH", "/cvmfs/soft.computecanada.ca/easybuild/bin") diff --git a/modules/nixpkgs/16.09.lua.core b/modules/nixpkgs/16.09.lua.core index b6daf9a..70acfa0 100644 --- a/modules/nixpkgs/16.09.lua.core +++ b/modules/nixpkgs/16.09.lua.core @@ -70,6 +70,9 @@ else setenv("PIP_CONFIG_FILE", "/cvmfs/soft.computecanada.ca/config/python/pip.conf") end setenv("MII_INDEX_FILE", "/cvmfs/soft.computecanada.ca/custom/mii/data/" .. arch .. "_" .. cpu_vendor_id) +if os.getenv("RSNT_ENABLE_LMOD_CACHE") == "yes" then + append_path("LMOD_RC", "/cvmfs/soft.computecanada.ca/config/lmod/lmodrc/cache_" .. arch .. "_" .. cpu_vendor_id .. ".lua") +end -- also make easybuild and easybuild-generated modules accessible prepend_path("PATH", "/cvmfs/soft.computecanada.ca/easybuild/bin") From 1a60e4b363b509c3dc25ed84fb7fe1346fa194ab Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Thu, 14 Apr 2022 13:18:19 +0000 Subject: [PATCH 4/5] Revert "modified arch modules to support RSNT_CUSTOM_ROOT too" This reverts commit cc860ccea3a362e193ffaded5bf5a90405c7bce8. --- modules/arch/avx.lua | 3 +-- modules/arch/avx2.lua | 3 +-- modules/arch/avx512.lua | 3 +-- modules/arch/sse3.lua | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/arch/avx.lua b/modules/arch/avx.lua index 19c9ecb..f4cdd28 100644 --- a/modules/arch/avx.lua +++ b/modules/arch/avx.lua @@ -1,5 +1,4 @@ if (mode() ~= "spider") then - local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" - prepend_path("MODULEPATH", custom_root .. "/modules-avx") + prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx") setenv("EBVERSIONARCH","avx") end diff --git a/modules/arch/avx2.lua b/modules/arch/avx2.lua index 52d6a4e..6e9c721 100644 --- a/modules/arch/avx2.lua +++ b/modules/arch/avx2.lua @@ -1,5 +1,4 @@ if (mode() ~= "spider") then - local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" - prepend_path("MODULEPATH", custom_root .. "/modules-avx2") + prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx2") setenv("EBVERSIONARCH","avx2") end diff --git a/modules/arch/avx512.lua b/modules/arch/avx512.lua index 4ba0991..5566cd8 100644 --- a/modules/arch/avx512.lua +++ b/modules/arch/avx512.lua @@ -1,5 +1,4 @@ if (mode() ~= "spider") then - local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" - prepend_path("MODULEPATH", custom_root .. "/modules-avx512") + prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-avx512") setenv("EBVERSIONARCH","avx512") end diff --git a/modules/arch/sse3.lua b/modules/arch/sse3.lua index ffa1d10..cd852ca 100644 --- a/modules/arch/sse3.lua +++ b/modules/arch/sse3.lua @@ -1,5 +1,4 @@ if (mode() ~= "spider") then - local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" - prepend_path("MODULEPATH", custom_root .. "/modules-sse3") + prepend_path("MODULEPATH","/cvmfs/soft.computecanada.ca/custom/modules-sse3") setenv("EBVERSIONARCH","sse3") end From 86ec11c8dee681b5b1944a4bb9fd8f0123078a73 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Thu, 14 Apr 2022 13:18:26 +0000 Subject: [PATCH 5/5] Revert "modified the gentoo module to allow overwriting the location of the custom directory, to facilitate testing" This reverts commit a228a299097e5ba1cebbd79e06a0474a40c5ef32. --- modules-avx/gentoo/2020.lua | 3 +-- modules-avx2/gentoo/2020.lua | 3 +-- modules-avx512/gentoo/2020.lua | 3 +-- modules-sse3/gentoo/2020.lua | 3 +-- modules/gentoo/2020.lua | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modules-avx/gentoo/2020.lua b/modules-avx/gentoo/2020.lua index f88828c..c33855a 100644 --- a/modules-avx/gentoo/2020.lua +++ b/modules-avx/gentoo/2020.lua @@ -20,5 +20,4 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" -assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-avx2/gentoo/2020.lua b/modules-avx2/gentoo/2020.lua index 4ab92fd..3cfe6d9 100644 --- a/modules-avx2/gentoo/2020.lua +++ b/modules-avx2/gentoo/2020.lua @@ -20,5 +20,4 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" -assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-avx512/gentoo/2020.lua b/modules-avx512/gentoo/2020.lua index ef16f1c..c56accb 100644 --- a/modules-avx512/gentoo/2020.lua +++ b/modules-avx512/gentoo/2020.lua @@ -20,5 +20,4 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" -assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules-sse3/gentoo/2020.lua b/modules-sse3/gentoo/2020.lua index 385d195..3e60913 100644 --- a/modules-sse3/gentoo/2020.lua +++ b/modules-sse3/gentoo/2020.lua @@ -20,5 +20,4 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" -assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) diff --git a/modules/gentoo/2020.lua b/modules/gentoo/2020.lua index c085228..7e053aa 100644 --- a/modules/gentoo/2020.lua +++ b/modules/gentoo/2020.lua @@ -27,7 +27,6 @@ if not cuda_driver_version or cuda_driver_version == "" then cuda_driver_version = get_installed_cuda_driver_version() end -local custom_root = os.getenv("RSNT_CUSTOM_ROOT") or "/cvmfs/soft.computecanada.ca/custom" -assert(loadfile(custom_root .. "/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) +assert(loadfile("/cvmfs/soft.computecanada.ca/custom/modules/gentoo/2020.lua.core"))(arch, cpu_vendor_id, interconnect, cuda_driver_version) conflict("StdEnv/2016.4") conflict("StdEnv/2018.3")