| 1 |
#%Module |
| 2 |
# Default to lowest SIMD support available |
| 3 |
# |
| 4 |
# Defaults to first of sse4.1, avx, or avx2 found |
| 5 |
# |
| 6 |
# Usage: |
| 7 |
# In most cases, can simply symlink .modulerc to this file |
| 8 |
# |
| 9 |
# In more complicated cases, .modulerc can source this file, and can |
| 10 |
# then test the variable _did_default, which will be true if we set |
| 11 |
# a default for modules for the next level, or false otherwise (in which |
| 12 |
# case your .modulerc can set one) |
| 13 |
|
| 14 |
# Source some required Tcl procedures here. Hack for cookbook |
| 15 |
# making use of environment variable for location. |
| 16 |
# In production, this should ideally be in a site config file. |
| 17 |
# At minimum, hardcode the path |
| 18 |
set rootdir $::env(MOD_GIT_ROOTDIR) |
| 19 |
set tcllibdir $rootdir/doc/example/compiler-etc-dependencies/tcllib |
| 20 |
source $tcllibdir/common_utilities.tcl |
| 21 |
|
| 22 |
set moduledir [file dirname $ModulesCurrentModulefile] |
| 23 |
set baseComponent [ file tail $moduledir ] |
| 24 |
|
| 25 |
# _did_default will be true if we actually default something |
| 26 |
# Useful in case a .modulerc sources us, and wants to set a default if we |
| 27 |
# did not |
| 28 |
set _did_default false |
| 29 |
|
| 30 |
set simdList {sse4.1 avx avx2} |
| 31 |
set firstChild [ FirstChildModuleInList $simdList ] |
| 32 |
if { $firstChild ne {} } { |
| 33 |
module-version $baseComponent/$firstChild default |
| 34 |
set _did_default true |
| 35 |
} |