Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
doku:spack-transition [2023/05/04 08:32] katrindoku:spack-transition [2023/05/08 07:45] katrin
Line 1: Line 1:
 ====== SPACK - migration to setup without environment  ====== ====== SPACK - migration to setup without environment  ======
  
-===== Problems of SPACK environments =====+===== Motivation: problems of SPACK environments =====
  
 Having worked with //spack environments// for some time, we have encountered several severe issues which have convinced us that we need to find a more practical way of maintaining software packages on VSC. Having worked with //spack environments// for some time, we have encountered several severe issues which have convinced us that we need to find a more practical way of maintaining software packages on VSC.
Line 14: Line 14:
 ===== New approach without environments ===== ===== New approach without environments =====
  
-There are three separate spack installation trees corresponding to the CPU/GPU architectures on VSC:+There are now three separate spack installation trees corresponding to the CPU/GPU architectures on VSC:
  
   * skylake - Intel CPUs; works on Intel Skylake and Cascadelake CPUs   * skylake - Intel CPUs; works on Intel Skylake and Cascadelake CPUs
Line 63: Line 63:
 ---- ----
  
-===== Migration script - search.py =====+===== Migration script - "spacksearch" =====
  
-If you want to find a list of packages or modules which correspond to the software you have been using until now, you may use the following script:+==== Method 1 ==== 
 + 
 +If you need to find a list of packages or modules which correspond to the software you have been using until now, you can use the alias **spacksearch** to do that 
 + 
 +<code> 
 +alias spacksearch='/usr/bin/python3.9 /opt/sw/spack-scripts/search/search.py' 
 +</code>  
 + 
 +The script can be used like in the following example:
  
 <code> <code>
-zen [user@l51 ~] python3 /opt/sw/spack-scripts/search/search.py <hash>+zen [user@l51 ~] spacksearch <hash>
 </code> </code>
  
-where ''<hash>'' is the 7 character hash of the package that you see at the end of the module name or in the output of ''spack find -l <package>''.+where ''<hash>'' is the 7 character hash of the package that you see at the end of the module name or in the output of ''spack find -l <package>'' 
  
 ==== Usage Example ==== ==== Usage Example ====
Line 90: Line 98:
  
 <code> <code>
-zen [user@l51 ~]$ module load python/3.9.15-gcc-12.2.0-my6jxu2 +zen [user@l51 ~]$ spacksearch jsfjwaz
- +
-zen [user@l51 ~]$ python3 /opt/sw/spack-scripts/search/search.py jsfjwaz+
  
 ==> The package hash jsfjwaz refers to netcdf-c and belongs to vsc5 as: ==> The package hash jsfjwaz refers to netcdf-c and belongs to vsc5 as:
Line 119: Line 125:
 </code> </code>
  
-You can also switch to another spack tree and search for packages there, e.g. cuda-zen:+To search for packages in a different spack tree you can just change to that tree and then run **spacksearch** there. 
 + 
 +For example to search in the 'cuda-zen' spack tree:
  
 <code> <code>
 zen [user@l51 search]$ cuz zen [user@l51 search]$ cuz
-cuda-zen [user@l51 search]$ python3 ./search.py jsfjwaz+cuda-zen [user@l51 search]$ spacksearch jsfjwaz
  
 ==> The package hash jsfjwaz refers to netcdf-c and belongs to vsc5 as: ==> The package hash jsfjwaz refers to netcdf-c and belongs to vsc5 as:
Line 142: Line 150:
 spack find -lvd /upkxxi spack find -lvd /upkxxi
 </code> </code>
 +
 +
 +==== Method 2 ====
 +
 +Add this function to your ''.bashrc'' file:
 +
 +<code>
 +## spack command wrapper, so we can include our own `spack something`
 +## commands, like `spack search`:
 +spack () {
 +    case "$1" in
 +        "search")
 +            python3 /opt/sw/spack-scripts/search/search.py "$2"
 +            ;;
 +        *)
 +            command spack "$@"
 +    esac
 +}
 +</code>
 +
 +Usage example:
 +
 +<code>
 +skylake [user@l41 ~]$ spack search asd
 +
 +==> The package hash asd refers to python and belongs to vsc4 as:
 +     python +bz2+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4+uuid+zlib
 +
 +==> Searching similar python modules at skylake...
 +
 +---/gpfs/opt/sw/skylake/spack-0.19.0/share/spack/modules/linux-almalinux8-skylake_avx512---
 +python/3.10.8-gcc-9.5.0-qh22vnd
 +python/3.10.8-gcc-12.2.0-apbi5uz
 +python/3.10.8-intel-2021.7.1-p4x6jid
 +
 +==> Load any one of these packages with 'module load mypackage', e.g.:
 +module load python/3.10.8-intel-2021.7.1-p4x6jid
 +
 +==> Get some additional info with 'spack find -lvd mypackage', e.g.:
 +spack find -lvd /p4x6ji
 +</code>
 +
 +----
  
  
Line 159: Line 210:
  
 <box 80% round red|Warning>This approach is not recommended and we will no longer maintain the spack environments or install new packages there</box> <box 80% round red|Warning>This approach is not recommended and we will no longer maintain the spack environments or install new packages there</box>
 +
 +===== Continue working with old spack environments =====
 +
 +You may also continue to work with the spack environments. If you wish to do so you need the following commands:
 +
 +==== On zen3 ====
 +
 +<code>
 +source /opt/sw/spack-0.17.1/share/spack/setup-env.sh
 +spacktivate zen3
 +</code>
 +
 +==== On skylake ====
 +
 +<code>
 +source /opt/sw/spack-0.19.0/share/spack/setup-env.sh
 +spacktivate skylake
 +</code>
 +
 +
 +<box 80% round red|Warning>This approach is not recommended and we will no longer maintain the spack environments or install new packages there</box>
 +
 ---- ----
  
Line 182: Line 255:
 ---- ----
  
-===== Setting LD_LIBRARY_PATH =====+==== Setting LD_LIBRARY_PATH ====
  
 Loading a module does no longer automatically set the ''LD_LIBRARY_PATH'' environment variable, as with some software packages this has lead to conflicts with system libraries. If you have to set ''LD_LIBRARY_PATH'' you may use: Loading a module does no longer automatically set the ''LD_LIBRARY_PATH'' environment variable, as with some software packages this has lead to conflicts with system libraries. If you have to set ''LD_LIBRARY_PATH'' you may use:
  • doku/spack-transition.txt
  • Last modified: 2023/05/17 14:48
  • by msiegel