Install pyiron on your cluster in 10 minutes!

  1. First, fetch mambaforge (mamba is essentially faster conda) install script from the web:

  1. Execute the script to install mambaforge:



NOTE: There are systems with a very tight filequota/memory quota on the home directory. In that case, you may need to install on a different directory. Usually there is a /software or /group directory that users can have permanent storage for software on. You can adjust where mamba is installed by changing the directory when it asks you where it should be installed. In this example, we install mamba in a folder named /software/abc123/.

  1. Refresh/restart your shell:

source .bashrc
  1. Now you have the option of installing pyiron in an environment with:

mamba create -n YOURENVNAME

Change YOURENVNAME to your liking.

  1. Then activate your environment with:

mamba activate YOURENVNAME
  1. Call this to install pyiron:

mamba install -c conda-forge pyiron pyiron_contrib

This can take some time, so just hang tight.

7. Now, we create a pyiron_resources folder. This can be placed anywhere, but here we place it in our home folder (e.g. /home/abc123). You can figure out the absolute path of your home directory is by calling echo $HOME:

mkdir /home/abc123/pyiron_resources
  1. Now, create our pyiron configuration file, .pyiron in the home folder. Paste the following lines into the file:

RESOURCE_PATHS = /home/abc123/pyiron_resources, /software/abc123/mambaforge/envs/pyiron/share/pyiron
FILE = ~/pyiron.db

Note the RESOURCE_PATHS` contain two entries:

  1. /home/abc123/pyiron_resources

  2. /software/abc123/mambaforge/envs/pyiron/share/pyiron

RESOURCE_PATHS tells pyiron where we are storing our executables, job scripts and queue configuration settings.

The first is the directory we just made. The second is where pyiron’s environment is located on the filesystem. You can find where it is using which python with the environment activated, which yields something like: /software/abc123/mambaforge/bin/python And you can replace the bin/… bit onwards with envs/YOURENVNAME/share/pyiron

  1. Now enter the pyiron_resources folder and make the queues folder:

cd /home/abc123/pyiron_resources
mkdir queues

Configure the queue on your supercomputer (SLURM setup, for others ). Edit/create a queue.yaml file in the queues folder, with contents of:

queue_type: SLURM
queue_primary: work
work: {cores_max: 128, cores_min: 1, run_time_max: 1440, script:}
express: {cores_max: 128, cores_min: 1, run_time_max: 1440, script:}

Change cores_max/cores_max/run_time_max into something fitting your HPC queue. In the above example, the jobs submitted using pyiron are limited to somewhere between 1-128 cores, and a run time of 1440 minutes (1 day). You can usually find this information about how many resources are allowed usually on the information pages of your cluster. It usually looks something like this.

The queue_primary string (“work” in the above script) is the name of the queue. Replace all instances of work, if you would like to use something else as the queue_name. To add more queues, simply add more entries like the express entry and configure the queueing script template accordingly.

  1. Create the file in the same queues directory, modify YOURACCOUNT, YOURQUEUENAME and YOURENVNAME accordingly:

#SBATCH --output=time.out
#SBATCH --job-name={{job_name}}
#SBATCH --chdir={{working_directory}}
#SBATCH --get-user-env=L
#SBATCH --exclusive
{%- if run_time_max %}
#SBATCH --time={{ [1, run_time_max]|max }}
{%- endif %}
{%- if memory_max %}
#SBATCH --mem={{memory_max}}G
{%- endif %}
#SBATCH --cpus-per-task={{cores}}

source /software/abc123/mambaforge/bin/activate YOURENVNAME


Notice that the environment is activated in this example script using the source …/activate line. Make sure you do this or the queueing system can’t see the environment in which you installed pyiron.

Congrats! We’re almost there.

  1. Now to verify the installation is working; we will conduct a test LAMMPS calculation.

Install the conda-packaged version of LAMMPS:

mamba install -c conda-forge lammps
  1. Create a python script containing the following (anywhere, preferably wherever you usually do calculations, e.g. /scratch). Change the username in the os.system("squeue -u abc123") to your user.

from pyiron_atomistics import Project
import os

pr = Project("test_lammps")
basis = pr.create.structure.bulk('Al', cubic=True)
supercell_3x3x3 = basis.repeat([3, 3, 3])
job = pr.create_job(job_type=pr.job_type.Lammps, job_name='Al_T800K')
job.structure = supercell_3x3x3
job.calc_md(temperature=800, pressure=0, n_ionic_steps=10000)
pot = job.list_potentials()[0]
print ('Selected potential: ', pot)
job.potential = pot

print("If a list of numbers is printed above, running calculations on the head node works!")

# Test the queue submission
job_new = job.copy_to(new_job_name="test2")"queue", delete_existing_job=True)
os.system("squeue -u abc123") # change abc123 to your username
print("If a queue table is printed out above, with the correct amount of resources, queue submission works!")
  1. Call the script with python

If the script runs and the appropriate messages print out, you’re finished! Congratulations! You’re finished with the pyiron install.

If you’re experiencing problems, please click here for frequently encountered issues (coming soon) installation_errors

For more complex tasks, such as configuring VASP or utilising on-cluster module based executables please click here Installation.