-
Notifications
You must be signed in to change notification settings - Fork 49
Princeton Stellar
This page provides steps to install VMEC and simsopt on Princeton University's stellar machine. stellar does not expose system python and does not provide python modules. It only provides anaconda modules.
-
Load anaconda module. For this step, we are using anaconda3/2021.5 module
module load anaconda3/2021.5
-
Create a conda virtual environment with python version 3.9. Let us call it
sims_gcc_py39
indicating that we are using python 3.9 and gcc compiler.conda create -n sims_gcc_py39 python=3.9
-
Activate the newly created virtual environment
conda activate sims_gcc_py39
-
We need to delete a couple of libraries that come with anaconda and clash with system libraries. First find out the location of the sims_gcc_py39 virtual environment, by typing
which python
. The output should be of type<VE_ROOT>/bin/python
, where<VE_ROOT>
denotes the root directory of the virtual environment. Then issue the below commandsrm <VE_ROOT>/lib/libcrypto.*
NOTE
Do not forget to substitute
<VE_ROOT>
with the root directory of the virtual environment.
- Download the package
git clone https://github.com/hiddenSymmetries/VMEC2000.git cd VMEC2000
- Load all the required compilers and libraries by running
module load openmpi/gcc/4.1.0 hdf5/gcc/1.10.6 netcdf/gcc/hdf5-1.10.6/4.7.4
- We use Intel MKL release in 2021. On stellar you can load Intel MKL module separately from Intel compilers, which will populate MKLROOT environment variable automatically.
module load intel-mkl/2021.1.1
- Copy the relevant cmake config file from
cmake/machines
folder.cp cmake/machines/stellar_gcc.json cmake_config_file.json
-
First, install python dependencies
pip install setuptools wheel scikit-build cmake ninja numpy f90wrap
-
Build the python wheel
python setup.py bdist_wheel
-
Install the built wheel
pip install dist/*.whl
-
Test the installation by loading the installed
vmec
packagepython -c "import vmec; print('Success')"
If
vmec
is successfully installed, the above command should printSuccess
.
For installing simsopt, follow all the steps related to loading modules and activating the conda virtual environment if not done already. We are going to use gcc to compile simsopt.
- If still in VMEC folder, move out of the VMEC folder and download the
simsopt
packagegit clone https://github.com/hiddenSymmetries/simsopt.git cd simsopt
- Instead of using pip to compile and install simsopt in one step, we use two steps for conda virtual environemnts. First install all the required build dependencies specified in
pyproject.toml
manually.pip install "setuptools>=45" wheel numpy cmake ninja "setuptools_scm[toml]>=6.0"
- Then build the simsopt wheel. If simsopt wheels are built before, delete them by deleting the
build
anddist
folders. Before building the wheel, set the environment variable CI to True. This reduces the optimization level because PPPL cluster has heterogenous hardware and we want the compiled code to work on all nodes.python setup.py bdist_wheel
- The wheel built with the above command resides in
dist
folder. Make sure there is only one file indist
folder. However it is not a strict requirement. Install the newly built wheel by runningThis command assumes there is only one file withpip install dist/simsopt*.whl
whl
extension in thedist
folder. If there are multiplewhl
files, specify the full name of thewhl
file.
We need mpi4py package to run VMEC from python. On stellar we need to explicitly point to MPI compiler wrappers to compile mpi4py
CC=mpicc CXX=mpicxx pip install --no-cache-dir mpi4py