Package: pynta-flow
Pyntapyntais an automated workflow for reaction path exploration on metallic surfaces.Thepyntacode is designed to automatically characterize chemical reactions
relevant to heterogeneous catalysis. In particular, it spawns and processes a
large number of ab initio quantum chemistry calculations to study gas-phase
reactions on crystal facets. It is designed to run on petascale and upcoming
exascale machines.The code systematically places adsorbates on crystal facets, by enumerating the
various unique crystal sites and considering the symmetry of the adsorbates and
the surface. The structures are systematically perturbed, to try to investigate
all possible adsorption geometries. Following this, the code performs
modifications to these structures and searches for saddle points on the
potential energy landscape in order to characterize the reactions these
adsorbates can undergo. After a series of such calculations the code arrives at
well-characterized reaction pathways, which can be in turn used to calculate
rate coefficients and can be implemented in microkinetic mechanisms/models.pyntais designed to work with the workflow codebalsam, which
enables a seamless running of embarrassingly parallel computations on
supercomputers.pyntaincludes several so-called apps that are run throughbalsam, and appear as one monolithic job submission in the queue system.
Another level of parallelism is gained from the ab initio programs, which may
or may not include GPU acceleration. We use the Atomic Simulation Environment
(ASE) that enables coupling to a large variety of ab initio quantum
chemistry codes.1. InstallationThe following instruction assumes that you have several softwares installed on your system, such as:A queue system e.g.Slurm,PBSorCobaltAn MPI e.g.OpenMPIA math library e.g.OpenBlas/LAPACKorIntel's MKLA compilier suite e.g.GCCorIntel1.1 Install all prerequisites1.1.1 Set the location you want to use forpyntabuild. It is suggested to create a virtual environment e.g 'pynta':cd<path/whr/to/build/pynta>
python3-mvenvpynta1.1.2 Activate your virtual environment:sourcepynta/bin/activate1.1.3 (Optional) Install required python packages (if you skip this process,pyntainstaller will do this later.)pip3installmatplotlib<3.2spglib==1.14.1.post0networkx<2.4ase==3.19.0scipy==1.3.1numpy==1.18.1PyYAML==5.3.1sella==1.0.31.1.4 DownloadPostgreSQLprecompiled binaries that suits your system and addpath_to_PostgreSQL/pgsql/binto yourPATHby modifying~/.bashrcecho'export PATH=path_to_PostgreSQL/pgsql/bin:$PATH'>>~/.bashrc1.1.5 Installmpi4py:gitclonehttps://github.com/mpi4py/mpi4py.gitcdmpi4py
python3setup.pyinstallcd../Make sure it works by running>>>mpirun-n2python3-c'from mpi4py import MPI; print(MPI.COMM_WORLD.Get_rank())'011.1.6 Installbalsamusingserial-mode-perfbranch.gitclonehttps://github.com/balsam-alcf/balsam.git-bserial-mode-perfcdbalsam
python3setup.pyinstallcd../Make sure it works by running tests posted on thebalsamGitHub page.1.1.7 InstallxTB-pythonfollowing instruction provided there. Make sure to correctly link all required libraries. For example:usingOpenBlasandGNUbased compilers:gitclonehttps://github.com/grimme-lab/xtb-python.gitcdxtb-python
gitsubmoduleupdate--initLDFLAGS="-L/opt/custom/OpenBLAS/0.3.7/lib"mesonsetupbuild--prefix=$PWD--libdir=xtb/xtb--buildtyperelease--optimization2-Dla_backend=openblas
ninja-Cbuildinstall
pipinstall-e.usingMKLand Intel Compilers:gitclonehttps://github.com/grimme-lab/xtb-python.gitcdxtb-python
gitsubmoduleupdate--init# (ALCF's Theta specific)# conda instal cffi# module swap PrgEnv-intel PrgEnv-cray; module swap PrgEnv-cray PrgEnv-intelCC=iccCXX=icpcFC=ifortmesonsetupbuild--prefix=$PWD--libdir=xtb-Dla_backed=mkl-Dpy=3--buildtyperelease--optimization2ninja-Cbuildinstall
python3setup.pyinstall
ln-s./xtb/xtb/_libxtb*.so./xtbMake sure it works by running:>>>fromxtb.ase.calculatorimportXTB>>>fromase.buildimportmolecule>>>frommathimportisclose>>>atoms=molecule('H2O')>>>atoms.calc=XTB(method="GFN2-xTB")>>>total_ener=atoms.get_potential_energy()>>>is_close=isclose(total_ener,-137.9677758730299)>>>print(total_ener)# True -> that's good; False -> something is wrongWarning - You might be getting SEGFAULT error -Segmentation Fault (Core dumped)while executing anyxTB-pythonjob, especially for a relatively large molecules. The easiest solution is to unlimit the system stack to avoid stack overflows. Inbashtry:ulimit -s unlimitedIfxTB-pythonstill fails, try to installxtband testxTBitself for any errors.gitclonehttps://github.com/grimme-lab/xtb.gitcdxtb
mkdirbuildpushdbuild
cmake-DCMAKE_BUILD_TYPE=Release-DCMAKE_C_COMPILER=icc-DCMAKE_CXX_COMPILER=icpc-DCMAKE_FC_COMPILER=ifort..
make
ctestpopdecho'export LD_LIBRARY_PATH=path/to_xtb/xtb/build:$LD_LIBRARY_PATH'>>~/.bashrcecho'export PATH=$HOME/.local/bin:\$PATH'>>~/.bashrcThen, rebuildxTB-pythonon your system ignoringgit submodule update --initand linking you currentxTBinstallation.1.2 Installpynta1.2.1 Clone the project in your preferable location.git clone https://github.com/zadorlab/pynta.gitUsually,masterbranch should be fine. If somehow it is not working, make sure to switch to the latest stable release version by checking the tags.1.2.2 Go topyntadirectorycd pynta1.2.3a Installpynta:python setup.py install1.2.3b (optional) If you do not have admin privileges (e.g. you will be usingpyntaon a supercomputer), do the following instead of 1.2.3a:python setup.py install --userYou should be good to go withpyntaOnce finished using the workflow, type:cd pynta
deactivate2. How to runBefore you run anypyntacalculations, make sure yourbalsamDB is initialized and activated, e.g.balsaminit~/myWorkflowsourcebalsamactivate~/myWorkflowYour prompt should change to something like:~[BalsamDB:myWorkflow]<username>@<host>:You will need4files to run the workflow:run_me.pya python script that executes the workflow or alternatively,restart_me.pyto restart unfinished calculationsrun_me.sha bash script that submits jobs to thebalsamdatabaseinput.jsona json file holding all user-modifiable parameters of thepyntareactions.yamla yaml file with all reactions to be studiedAn examplerun_me.pyfile:#!/usr/bin/env python3frompynta.mainimportWorkFlowdefrun():# instantiate a WorkFlow() classworkflow=WorkFlow()# create all input filesworkflow.gen_job_files()# execute the workflowworkflow.execute_all()if__name__=='__main__':run()An examplerun_me.pyfile:#!/usr/bin/env python3frompynta.mainimportWorkFlowdefrestart():returnWorkFlow().restart()if__name__=='__main__':restart()An examplerun_me.shfile:#!/bin/bash#SBATCH -J job_name        # name of the job e.g job_name = pynta_workflow#SBATCH --partition=queue  # queue name e.g. queue = day-long-cpu#SBATCH --nodes=x          # number of nodes e.g. x = 2#SBATCH --ntasks=y         # number of CPUs e.g. 2 x 48 = y = 96#SBATCH -e %x.err          # error file name#SBATCH -o %x.out          # out file name# load your quantum chemistry calculation package or provide a path to the# executable in 'inputR2S.py'moduleloadespresso# activate balsam environment, e.g.sourcebalsamactivate~/myWorkflow# run python executable scriptpython3$PWD/run_me.py# required environment variable if using balsam branch serial-mode-perf and SLURMexportSLURM_HOSTS=$(scontrolshowhostname)# launch serial jobsbalsamlauncher--job-mode=serial--wf-filter_--limit-nodes=1--num-transition-threads=1&# wait a bit to prevent timeing out you jobs before the sockets are readysleep45# launch mpi jobsbalsamlauncher--job-mode=mpi--wf-filterQE_Sock--offset-nodes=x-1--num-transition-threads=1&# wait until finishedwait# deactivate balsam environmentsourcebalsamdeactivateAn examplereactions.yamlfile:-index:0reaction:OHX + X <=> OX + HXreaction_family:Surface_Abstractionreactant:|multiplicity -1871 *1 O u0 p0 c0 {2,S} {4,S}2 *2 H u0 p0 c0 {1,S}3 *3 X u0 p0 c04    X u0 p0 c0 {1,S}product:|multiplicity -1871 *1 O u0 p0 c0 {4,S}2 *2 H u0 p0 c0 {3,S}3 *3 X u0 p0 c0 {2,S}4    X u0 p0 c0 {1,S}-index:1reaction:H2OX + X <=> OHX + HXreaction_family:Surface_Abstractionreactant:|multiplicity -1871 *1 O u0 p0 c0 {2,S} {3,S} {4,S}2 *2 H u0 p0 c0 {1,S}3    H u0 p0 c0 {1,S}4    X u0 p0 c0 {1,S}5 *3 X u0 p0 c0product:|multiplicity -1871 *1 O u0 p0 c0 {2,S} {4,S}2 *2 H u0 p0 c0 {1,S}3    H u0 p0 c0 {5,S}4    X u0 p0 c0 {1,S}5 *3 X u0 p0 c0 {3,S}An exampleinputR2S.pyfile:{"quantum_chemistry":"espresso","optimize_slab":true,"surface_types_and_repeats":{"fcc111":[[3,3,1],[1,1,4]]},"metal_atom":"Cu","a":3.6,"vacuum":8.0,"pseudo_dir":"/home/mgierad/espresso/pseudo","pseudopotentials":"dict(Cu='Cu.pbe-spn-kjpaw_psl.1.0.0.UPF',H='H.pbe-kjpaw_psl.1.0.0.UPF',O='O.pbe-n-kjpaw_psl.1.0.0.UPF',C='C.pbe-n-kjpaw_psl.1.0.0.UPF',N='N.pbe-n-kjpaw_psl.1.0.0.UPF')","executable":"/home/mgierad/00_codes/build/q-e-qe-6.4.1/build/bin/pw.x","node_packing_count":48,"balsam_exe_settings":{"num_nodes":1,"ranks_per_node":48,"threads_per_rank":1},"calc_keywords":{"kpts":[3,3,1],"occupations":"smearing","smearing":"marzari-vanderbilt","degauss":0.01,"ecutwfc":40,"nosym":true,"conv_thr":1e-11,"mixing_mode":"local-TF"},"yamlfile":"reactions.yaml","scfactor":1.4,"scfactor_surface":1.0,"scaled1":false,"scaled2":false}For meaning of theses keywords, please checkdocumentationAn example input files are also located at./pynta/example_run_files/3. DocumentationA full documentation is availablehere.AcknowledgmentsIf you are usingpyntaor you wish to use it, let me know!Copyright NoticeFor five (5) years from 1/19/2021 the United States Government is granted for
itself and others acting on its behalf a paid-up, nonexclusive, irrevocable
worldwide license in this data to reproduce, prepare derivative works, and
perform publicly and display publicly, by or on behalf of the Government. There
is provision for the possible extension of the term of this license. Subsequent
to that period or any extension granted, the United States Government is
granted for itself and others acting on its behalf a paid-up, nonexclusive,
irrevocable worldwide license in this data to reproduce, prepare derivative
works, distribute copies to the public, perform publicly and display publicly,
and to permit others to do so. The specific term of the license can be
identified by inquiry made to National Technology and Engineering Solutions of
Sandia, LLC or DOE.NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF
ENERGY, NOR NATIONAL TECHNOLOGY AND ENGINEERING SOLUTIONS OF SANDIA, LLC, NOR
ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
LEGAL RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY
INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS
USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.Any licensee of this software has the obligation and responsibility to abide by
the applicable export control laws, regulations, and general prohibitions
relating to the export of technical data. Failure to obtain an export control
license or other authority from the Government may result in criminal liability
under U.S. laws.License NoticeCopyright 2021 National Technology & Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
U.S. Government retains certain rights in this software.