-
Notifications
You must be signed in to change notification settings - Fork 11
installAMUSE.md
First of all, let me advice you to always use virtual environments. It costs you only one command every time you open the terminal to activate the right environment, but breaking your installation (without any noticeable errors!) because you are doing 2-3-4-...-N projects with your one golden Python install is just bad practice and easy to avoid!
Conda is an excellent tool when you work on your local system, especially since it provides a graphical user interface for their package manger for novice users. Please actually make sure you make a new environment for this course though! Conda however is less than ideal however on institute workstations and high performance compute, this is because it will bring all its own binaries (eating up your valuable home disk space unless configured correctly) and it will not use any of the excellent packages the IT already installed for you (probably with a better idea of which optimizations and versions you need!)
On non unix operating systems (macOS and Windows) primarily, it is a really good tool and I would advice you to use it. A tutorial on using conda
Virtual environment are the Python native solution to managing many different environments. One of the primary benefits on observatory systems is that you can load a good version of Python on your observatory system with the command module load Python
. This will load the default version of Python for your system that the IT already installed. This ensure you always know what version of Python you are using (check: module list
). After doing so, you can create a virtual environment in your project directory with the following command:
python -m venv name_of_this_virtual_environment
After creating this a name_of_this_virtual_environment
directory is created with a virtual environment in it, how convenient! Now activate it:
source name_of_this_virtual_environment/bin/activate
The primary benefit of this is that now your virtual environment is in the same directory as your project (if you ran the command in the right spot). Now you can continue to install things, don't forget to load Python and the virtual environment on every reopening of your terminal!
Please refer to this page for the complete installation instructions. This is preferable if you have a personal system that you want to use AMUSE on.
Sometimes the installer of the default amuse
package will fail to install some packages and not install everything, in this case you can always install AMUSE by just installing each package you need:
pip install amuse-framework
pip install amuse-$(community_code_name)
You will only succesfully install packages you have the right dependencies for, make sure you have gcc, fortran, nvidia installed correctly before attempting this. At the end, verify that the codes for the course are in the list. If not they are not, check out the error for the specific code.
At the Leiden observatory, most scientific software is available via the module
system. To see which software you can access on the pc, use the following command:
module available
During this course you will need the most recent version of AMUSE, so please find the module AMUSE/2023.5.1
in the list. We will try to load this module with the load command:
module load AMUSE/2023.5.1
Now, we need to check it actually did something, by checking what is loaded with:
module list
You will now probably see a whole bunch of packages show up! On my system I get:
→ module list
Currently Loaded Modules:
1) Miniconda3/4.9.2 6) numactl/2.0.14-GCCcore-11.3.0 11) OpenSSL/1.1 16) UCC/1.0.0-GCCcore-11.3.0 21) ScaLAPACK/2.2.0-gompi-2022a-fb
2) GCCcore/11.3.0 7) XZ/5.2.5-GCCcore-11.3.0 12) libevent/2.1.12-GCCcore-11.3.0 17) OpenMPI/4.1.4-GCC-11.3.0 22) AMUSE/2023.5.1
3) zlib/1.2.12-GCCcore-11.3.0 8) libxml2/2.9.13-GCCcore-11.3.0 13) UCX/1.12.1-GCCcore-11.3.0 18) gompi/2022a
4) binutils/2.38-GCCcore-11.3.0 9) libpciaccess/0.16-GCCcore-11.3.0 14) libfabric/1.15.1-GCCcore-11.3.0 19) OpenBLAS/0.3.20-GCC-11.3.0
5) GCC/11.3.0 10) hwloc/2.7.1-GCCcore-11.3.0 15) PMIx/4.1.2-GCCcore-11.3.0 20) FlexiBLAS/3.2.0-GCC-11.
This shows that all the dependencies of AMUSE have been loaded correctly. AMUSE requires several pieces of software to work correctly, and this is an efficient way of the observatory IT of making sure we have the correct of everything!
Now we need to make sure that we actually use the correct python (the one that has AMUSE installed!). You can do so using the which command:
→ which python
/easybuild/easybuild/fc37/software/AMUSE/2023.5.1/bin/python
Note
When you create a virtual environment you need to make sure you can access the parent packages, you can do so by adding the --system-site-packages flag to your virtual environment:
python -m venv --system-site-packages your_virtual_environment_with_amuse_from_module_installed
Here I will briefly schedule a workflow that I personally use to effectively use the observatory systems. You will need to install the following things:
- Visual studio code
- Add your ssh key to the observatory system
- Install the vscode ssh plugin Then you can follow these instructions to login to your pczaal.ssh.strw.leidenuniv.nl of choice!