|
231 | 231 | end |
232 | 232 | end |
233 | 233 |
|
234 | | -local function using_eessi_accel_stack () |
235 | | - local modulepath = os.getenv("MODULEPATH") or "" |
236 | | - local accel_stack_in_modulepath = false |
237 | | -
|
238 | | - -- Check if we are using an EESSI version 2023 accelerator stack by checking if the $MODULEPATH contains |
239 | | - -- a path that starts with /cvmfs/software.eessi.io and contains accel/nvidia/ccNN |
240 | | - for path in string.gmatch(modulepath, '(.-):') do |
241 | | - if string.sub(path, 1, 41) == "/cvmfs/software.eessi.io/versions/2023.06" then |
242 | | - if string.find(path, "accel/nvidia/cc%d%d") then |
243 | | - accel_stack_in_modulepath = true |
244 | | - break |
245 | | - end |
246 | | - end |
247 | | - end |
248 | | - return accel_stack_in_modulepath |
249 | | -end |
250 | | -
|
251 | | -local function eessi_removed_module_warning_startup_hook(usrCmd) |
252 | | - if usrCmd == 'load' and not os.getenv("EESSI_SKIP_REMOVED_MODULES_CHECK") then |
253 | | - local CUDA_RELOCATION_MSG = [[All CUDA installations and modules depending on CUDA have been relocated to GPU-specific stacks. |
254 | | - Please see https://www.eessi.io/docs/site_specific_config/gpu/ for more information.]] |
255 | | -
|
256 | | - local RELOCATED_CUDA_MODULES = { |
257 | | - ['NCCL'] = CUDA_RELOCATION_MSG, |
258 | | - ['NCCL/2.18.3-GCCcore-12.3.0-CUDA-12.1.1'] = CUDA_RELOCATION_MSG, |
259 | | - ['UCX-CUDA'] = CUDA_RELOCATION_MSG, |
260 | | - ['UCX-CUDA/1.14.1-GCCcore-12.3.0-CUDA-12.1.1'] = CUDA_RELOCATION_MSG, |
261 | | - -- we also have non-CUDA versions of OSU Micro Benchmarks, so only match the CUDA version |
262 | | - ['OSU-Micro-Benchmarks/7.2-gompi-2023a-CUDA-12.1.1'] = CUDA_RELOCATION_MSG, |
263 | | - ['UCC-CUDA'] = CUDA_RELOCATION_MSG, |
264 | | - ['UCC-CUDA/1.2.0-GCCcore-12.3.0-CUDA-12.1.1'] = CUDA_RELOCATION_MSG, |
265 | | - ['CUDA'] = CUDA_RELOCATION_MSG, |
266 | | - ['CUDA/12.1.1'] = CUDA_RELOCATION_MSG, |
267 | | - ['CUDA-Samples'] = CUDA_RELOCATION_MSG, |
268 | | - ['CUDA-Samples/12.1-GCC-12.3.0-CUDA-12.1.1'] = CUDA_RELOCATION_MSG, |
269 | | - } |
270 | | -
|
271 | | - local REMOVED_MODULES = { |
272 | | - ['ipympl/0.9.3-foss-2023a'] = 'This module has been replaced by ipympl/0.9.3-gfbf-2023a', |
273 | | - } |
274 | | -
|
275 | | - local masterTbl = masterTbl() |
276 | | - local error_msg = "" |
277 | | - -- The CUDA messages should only be shown if the accelerator stack is NOT being used |
278 | | - if not using_eessi_accel_stack() then |
279 | | - for _, module in pairs(masterTbl.pargs) do |
280 | | - if RELOCATED_CUDA_MODULES[module] ~= nil then |
281 | | - error_msg = error_msg .. module .. ': ' .. RELOCATED_CUDA_MODULES[module] .. '\\n\\n' |
282 | | - end |
283 | | - end |
284 | | - end |
285 | | - for _, module in pairs(masterTbl.pargs) do |
286 | | - if REMOVED_MODULES[module] ~= nil then |
287 | | - error_msg = error_msg .. module .. ': ' .. REMOVED_MODULES[module] .. '\\n\\n' |
288 | | - end |
289 | | - end |
290 | | - if error_msg ~= "" then |
291 | | - LmodError('\\n' .. error_msg .. 'If you know what you are doing and you want to ignore this check for removed/relocated modules, set $EESSI_SKIP_REMOVED_MODULES_CHECK to any value.') |
292 | | - end |
293 | | - end |
294 | | -end |
295 | | -
|
296 | | -function eessi_startup_hook(usrCmd) |
297 | | - eessi_removed_module_warning_startup_hook(usrCmd) |
298 | | -end |
299 | | -
|
300 | | -hook.register("startup", eessi_startup_hook) |
301 | 234 | hook.register("load", eessi_load_hook) |
302 | 235 |
|
303 | 236 | """ |
|
320 | 253 | modT.fullName:match("GCC%-([0-9]*.[0-9]*.[0-9]*)") or |
321 | 254 | modT.fullName:match("GCCcore%-([0-9]*.[0-9]*.[0-9]*)") |
322 | 255 |
|
323 | | - -- if nothing matches, return |
| 256 | + -- if nothing matches, return |
324 | 257 | if tcver == nil then return end |
325 | 258 |
|
326 | 259 | -- if we have matches, check if the toolchain version is either 2022b or 12.2.0 |
|
0 commit comments