Skip to content

Configuration of atomate2

atomate2 consists of several different workhorse packages, that need to be properly configured to work well with each other. In this part of the tutorial, adapted from the corresponding section of the atomate2 tutorial, we will configure them one by one.

Pymatgen

Pymatgen configuration is by default stored in YAML format in ~/.config/.pmgrc.yaml file. If you plan to use Pymatgen to create input files for FHI-aims, it has to know where the species defaults are located. Please check Pymatgen tutorial to find out how it can be done.

Database

To configure atomate2 to use MongoDB, the database with several collections needs to be created. We will use the database named atomate2 with two collections: outputs for calculation outputs and output_blobs for large files. To do that, log in to the MongoDB server with the command mongosh and run the following.

use atomate2;
db.createCollection("outputs");
db.createCollection("outputs_blobs");

Alternatively, the DB and collections inside can be created through MongoDB Compass.

MongoDB access control management system can be used to add the user to the database, set the password for the user and grant the user the rights to the DB. Here all the relevant information can be found.

atomate2 itself

atomate2 needs to know the command to run FHI-aims. To specify it, we create a YAML config file. The file can be named and place anywhere; I will put it under the path ~/atomate2-workflows/config/atomate2.yaml.

AIMS_CMD: mpirun aims.x > aims.out

Here, aims.x is the FHI-aims binary. Consider adding the location of aims.x to the $PATH environmental variable to provide global access to it.

The location of this file is added to the ~/.bashrc file (~/.zshrc on a Mac) as,

export ATOMATE2_CONFIG_FILE="${HOME}/atomate-workflows/config/atomate2.yaml"

Running locally: jobflow

jobflow is the workflow library that can execute workflows either locally or remotely through Fireworks workflow engine. To run atomate2 workflows, we need to tell jobflow the DB credentials that we created. It is done through another YAML file, put under the path ~/atomate2-workflows/config/jobflow.yaml:

JOB_STORE:
  docs_store:
    type: MongoStore
    database: atomate2
    host: localhost
    port: 27017
    collection_name: outputs
  additional_stores:
    data:
      type: GridFSStore
      database: atomate2
      host: localhost
      port: 27017
      collection_name: outputs_blobs

Here also username and password can be specified for access control. The localtion of this file also has to be added to ~/.bashrc:

export JOBFLOW_CONFIG_FILE="${HOME}/atomate-workflows/config/jobflow.yaml"

For running atomate2 workflows remotely, please consult corresponding tutorial.