-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Summary of the new feature / enhancement
I'm Windows ↔ Linux user with both development OS are using. I found something fun: Environment Modules is starting support pwsh for a while, but it seems support not quite well as it in a early develop state.
This toy is based on tcl/tk, targeting environment variable "Hot-Swapping/Plugging" for development toolchain invocation, commonly can see it on cluster grade HPC Linux servers, no need to call sysdm.cpl GUI for adding PATH/include/lib(I think lots of Windows users have DEJA VU on this maybe).
If this feature is supported to both project, it may provide more development benifits and lower the difficulty on Windows develop(Like 3rd party can write Tclsh script into Windows installer for this feature).
The cea-hpc develop team have documentation marked we need to install tcl/tk redistribution like Active TCL or something have tclsh.exe so it will works in cmd.exe. The current state is CMD can use but not good experience then shell environment.
Proposed technical implementation details (optional)
As a preview for powershell users can have same experience when using modules usage, I just make a dry-run-like result to show what happens in macOS/Linux/BSD shell so what pwsh will be looks like if this feature is supported.
Assume have a server called foo, with some specified libraries, apps and intel oneAPI installed. Calling module to list all modules be like:
[taixeflar@serverfoo ~]$ module av
-------------------------------------------- /foo/modulefiles ---------------------------------------------
app/hypre/2.11/x86_64 app/openmpi/x86_64 lib/hdf5/1.10.8/x86_64 lib/szip/2.1.1/x86_64
app/nco/4.7.2/x86_64 intel/2020.4/304/x86_64 lib/netcdf/4.8.1_4.5.4/x86_64
app/ncview/2.1.8/x86_64 intel/2022.2/x86_64 lib/pnetcdf/1.12.3/x86_64
In usual, intel oneAPI toolchain won't be add to user's profile file PATH variable:
[taixeflar@serverfoo ~]$ ifx
bash: ifx: command not found...
[taixeflar@serverfoo ~]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/pbs/bin:/home/taixeflar/ps7//bin:/home/taixeflar/.local/bin:/home/taixeflar/bin
So we need to load its module:
[taixeflar@serverfoo ~]$ module load intel/2022.2/x86_64
Loading mkl version 2022.1.0
Loading tbb version 2021.6.0
Loading compiler-rt version 2022.1.0
Loading compiler version 2022.1.0
Loading oclfpga version 2022.1.0
Load "debugger" to debug DPC++ applications with the gdb-oneapi debugger.
Load "dpl" for additional DPC++ APIs: https://github.com/oneapi-src/oneDPL
Loading mpi version 2021.6.0
Loading intel/2022.2/x86_64
Loading requirement: tbb/latest compiler-rt/latest mkl/latest oclfpga/latest compiler/latest mpi/latest
The compiler toolchain and it's dependecy libraries/runtimes are loaded. Check PATH variable again:
[taixeflar@serverfoo ~]$ ifx
ifx: command line error: no files specified; for help type "ifx -help"
[taixeflar@serverfoo ~]$ echo $PATH
/aracbox/intel/oneapi/mpi/2021.6.0/libfabric/bin:/aracbox/intel/oneapi/mpi/2021.6.0/bin:/aracbox/intel/oneapi/compiler/2022.1.0/linux/bin/intel64:/aracbox/intel/oneapi/compiler/2022.1.0/linux/bin:/aracbox/intel/oneapi/compiler/2022.1.0/linux/lib/oclfpga/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/pbs/bin:/home/taixeflar/ps7//bin:/home/taixeflar/.local/bin:/home/taixeflar/bin
[taixeflar@serverfoo ~]$ ml
Currently Loaded Modulefiles:
1) tbb/latest 3) mkl/latest 5) compiler/latest 7) intel/2022.2/x86_64
2) compiler-rt/latest 4) oclfpga/latest 6) mpi/latest
Key:
auto-loaded
Now what we foreseen in pwsh will be like:
PS C:\Program Files\Environment Modules\modulefiles\NVIDIA\CUDA> module.cmd av
--------------- C:/Program Files/Environment Modules/modulefiles ---------------
Hoyoverse/Genshin_Impact oneAPI/compiler-rt/latest
Hoyoverse/Honkai_3rd oneAPI/compiler/latest
Hoyoverse/Honkai_StarRail oneAPI/mkl/latest
Hoyoverse/ZZZ oneAPI/tbb/latest
Lib/MSMPI/1.12 VS2022/dotNET/Roslyn
Lib/NetCDF/4.9.2 VS2022/MSVC/llvm/clang
Lib/PNetCDF/1.12.0 VS2022/MSVC/SDK/10.0.20348.0
MinGW64/gcc13.2 VS2022/MSVC/SDK/10.0.22621.0
MinGW64/gcc14.1 VS2022/MSVC/v143/AMD64
module-git VS2022/MSVC/v143/ARM64
module-info VS2022/MSVC/v143/cross/ARM32
null VS2022/MSVC/v143/cross/ARM64
NVIDIA/CUDA/11.8 VS2022/MSVC/v143/cross/RISCV
NVIDIA/CUDA/12.6 VS2022/MSVC/v143/cross/RISCV64
NVIDIA/cuDNN/8.6.0 VS2022/MSVC/v143/cross/x86
NVIDIA/cuDNN/9.6.0 VS2022/MSVC/v143/x86
NVIDIA/cuDSS/0.3.0 VS2022/Python/3.9.15
NVIDIA/cuTensor/2.0.3.0
Remind pwsh conflicts keyword module to environment modules. Here invokes is cmd script for module calling.