File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 3636# Find all subtrees of supported CPU targets by looking for "modules" directories, and taking their parent directory
3737architectures=$( find ${stack_base_dir} /software/ -maxdepth 5 -type d -name modules -exec dirname {} \; )
3838
39- # Create/update the Lmod cache for all architectures
39+ # Create/update the Lmod cache for all CPU targets
4040for archdir in ${architectures}
4141do
4242 lmod_cache_dir=" ${archdir} /.lmod/cache"
43- ${update_lmod_system_cache_files} -d ${lmod_cache_dir} -t ${lmod_cache_dir} /timestamp ${archdir} /modules/all
43+ modulepath=" ${archdir} /modules/all"
44+ # Find any accelerator targets for this CPU, and add them to the module path, so they will be included in the cache
45+ if [ -d " ${archdir} /accel" ]; then
46+ accelerators=$( find ${archdir} /accel -maxdepth 3 -type d -name modules -exec dirname {} \; )
47+ for acceldir in ${accelerators} ; do
48+ modulepath=" ${acceldir} /modules/all:$modulepath "
49+ done
50+ fi
51+
52+ ${update_lmod_system_cache_files} -d ${lmod_cache_dir} -t ${lmod_cache_dir} /timestamp " ${modulepath} "
4453 exit_code=$?
4554 if [[ ${exit_code} -eq 0 ]]; then
46- echo_green " Updated the Lmod cache for ${archdir} ."
55+ echo_green " Updated the Lmod cache for ${archdir} using MODULEPATH: ${modulepath} ."
4756 ls -lrt ${lmod_cache_dir}
4857 else
49- echo_red " Updating the Lmod cache failed for ${archdir} ."
58+ echo_red " Updating the Lmod cache failed for ${archdir} using MODULEPATH: ${modulepath} ."
5059 exit ${exit_code}
5160 fi
5261done
You can’t perform that action at this time.
0 commit comments