🧠 AiiDA setup instructions
⚙️ Basic Installation
python3 is already installed in the vps (Ubuntu) system, so you need to use python as alias python3:
sudo apt update sudo apt install python-is-python3creating virtual environment using already existing from aiida-core, which you can clone from the github (https://github.com/aiidateam/aiida-core.git):
python3 -m venv aiida-venv source ~/aiida-core/aiida-venv/bin/activateinstall&upgrade pip
sudo apt install python3-pip pip install --upgrade pipinstall aiida-core
pip install .install some external packages if necessary; atomic_tools are useful tools for atomistic simulations that AiiDA uses for converting, generating, or visualizing structures:
pip install aiida-core[atomic_tools,docs]install ‘RabbitMQ’
sudo apt install rabbitmq-servercreate a profile, I used core.sqlite_dos storage plugins type, due to simplicity and adequate to my purpose which is not performance related calculations:
verdi profile setup core.sqlite_doscheck the status:
verdi status verdi daemon start
you will see some warning when you check the status of your connection with the command “verdi status”, the warnings:
Warning: RabbitMQ v3.12.1 is not supported and will cause unexpected problems! Warning: It can cause long-running workflows to crash and jobs to be submitted multiple times. Warning: See https://github.com/aiidateam/aiida-core/wiki/RabbitMQ-version-to-use for details.
- you can get rid of this warning by applying these steps:
Become the root user (sudo su root)
Create /etc/rabbitmq/advanced.config with content
sudo su root nano /etc/rabbitmq/advanced.configAdd:
%% advanced.config [ {rabbit, [ {consumer_timeout, undefined} ]} ].Restart RabbitMQ:
service rabbitmq-server restartCheck that the configuration was properly picked up
sudo rabbitmqctl environment | grep consumer_timeout sudo rabbitmq-diagnostics statusFinally, run rabbitmq-diagnostics status (you may need to open a new terminal first) and check that your new configuration file is listed under the “Config files” section.
Once RabbitMQ is properly configured, the warning of the version that is not supported can be suppressed through (you need to change the user from root to your user and activate the virtual env) and give the last comment which is below:
verdi config set warnings.rabbitmq_version false
🌐 SSH Connection
create a passwordless SSH key
ssh-keygen -t rsa -b 4096 -f ~/.ssh/aiidaCopy the public key to the remote machine, normally this will add the public key to the remote machine’s “~/.ssh/authorized_keys”
ssh-copy-id -i ~/.ssh/aiida user@remote.hostAdd the following lines to your ~/.ssh/config file (or create it, if it does not exist) –> just write the command “nano ~/.ssh/config” and add lines as:
Host tub HostName cluster.math.tu-berlin.de User oeztuerk IdentityFile ~/.ssh/aiidaFinally, if you are planning to use a batch scheduler on the remote computer, try also:
ssh tub squeue
🖥️ Computer Setup
- computer yaml file:
Computer means not a PC in AiiDA setup, but an abstraction that defines a remote or local computational resource where jobs will be executed.
--- label: "Computer-70" hostname: "cluster.math.tu-berlin.de" transport: "core.ssh" scheduler: "core.slurm" work_dir: "/work/oeztuerk/static_epsilon/AiiDA/" mpirun_command: "mpirun -np {tot_num_mpiprocs}" mpiprocs_per_machine: "2" prepend_text: | ---
instead of writing same setup details every time, you can use yaml file:
verdi computer setup --config computer.ymlconnect the compuer to ssh connection:
verdi -p group_name computer configure core.ssh "computer_name"check if you see the setup computer on the computer list:
verdi computer listif you want to see details:
verdi computer show Computer-70if you want to relabel:
verdi computer rename old_label new_labelfor more commands about computer:
verdi computer delete computer_label
🧩 Code Setup
for each calculation you need separate codes
again you can use the yaml file to setup the code which is easy:
verdi code create core.code.installed --with-mpi --config code-pw.ymlyaml file:
--- label: 'qe-7.3.1-pw' description: 'quantum_espresso v7.3.1-pw.x' default_calc_job_plugin: 'quantumespresso.pw' filepath_executable: '/work/oeztuerk/Build/qe-7.3.1/bin/pw.x' computer: 'Computer-70' prepend_text: | module unload ompi intel pgi module load intel/2019.3 ompi/intel/4.0.4 fftw/3.3.9.intel-ompi404 hdf5/1.8.21.intel export LD_LIBRARY_PATH=/work/oeztuerk/Applications/libxc-6.2.2/lib:$LD_LIBRARY_PATH append_text: | ---after you create the code, check “verdi code list”, you should see the code is created as:
please check for further commands:
verdi code --help
📦 Installing Other Modules
Install the following AiiDA plugins:
git clone <module-url>
cd module-directory
pip install -e .- aiida-quantumespresso
- aiida-wannier90-workflows
- aiida-pseudo
After cloning, install SSSP:
aiida-pseudo install sssp
- aiida-workgraph
✅ You’re Ready!
With these steps, AiiDA should be fully configured on your VPS/local computer and ready to launch workflows 🚀.