EPAW: A code for evolutionary optimization of PAW datasets especially for high-pressure applications
[TOC]
The associated paper is published on Computer Physics Communications.
Please cite this article as: Sarkar, Kanchan, N. A. W. Holzwarth, and Renata M. Wentzcovitch. "EPAW-1.0 code for evolutionary optimization of PAW datasets especially for high-pressure applications." Computer Physics Communications 233 (2018): 110-122.
ATOMPAW- Quantum ESPRESSO
- Python
gnuplot- at least 10*neos processors/cores, where neos is the number of volume points at which SCF calculations will be performed at each generation/iteration step using Quantum ESPRESSO.
There are two parent directories:
SOURCE: having three subdirectories containing the source files and one script filecompileto compile the source files.EXAMPLE: contains the necessary files to run the executables.
-
-
Go to directory
SOURCE. -
Change the compiler (
ifortorgfortran) according to preference in the filecompile. -
Make the file
compilereadable, writable and executable with the following command:chmod 777 compile
-
Run the file 'compile' with the following command:
./compile
It will compile the fortran codes located in the subdirectories using
gfortran/ifortcompiler and create three executables:EPAWsetup.exe,EPAWsetup.exe,EPAWopt.exeand move them to the parent directorySOURCE. -
Create a working folder/directory in which optimizations will be performed.
-
Set Your
$PATHenvironment variable permanently using.bashrcor place the executables to theEXAMPLEdirectory. -
Copy all the contents of the
EXAMPLEdirectory to your working directory.
-
-
Go to the working directory to execute following steps:
-
open the file named as
APAW.sh, replace theatompawcommand (command to RUNATOMPAWprogram), if required, according to your settings. -
edit the contents of the following files based on the system under consideration:
INPUT_FILES,IN_TARGET,INITIAL_ATOMPAW,IN_DUMMY,script.py,USER_INPUTSas follows:-
INPUT_FILES: Contains names for the required/optional input files (We recommend not to change the names to avoid unnecessary complicacies.#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INITIAL_ATOMPAW -MUST #|File name for Initial standard PAW dataset generator IN_DUMMY -MUST #|File name for dummy indexes of standard PAW dataset generator IN_PARENT -OPTIONAL #|File name for Initial parent population IN_GAPRMTR -OPTIONAL #|File name for GAs parameters to start with IN_TARGET -MUST/OPTIONAL #|File name for TARGET EoS #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
INITIAL_ATOMPAW: The initial guess ofATOMPAWinput file, we recommend use a standard library file (e.g., JTH data-set library) to start with. Here an example file for the atom Calcium is included. -
IN_DUMMY: Contains dummy indexes to recognize variables, parameters and keywords in theINITIAL_ATOMPAWfile. This data needs careful preparation as follows. Here an example file for the atom Calcium is included:-
copy the
INITIAL_ATOMPAWfile toIN_DUMMY. -
put
0for the keywords or for the entries in theINPUT_DATASETdata that will not change in the course of optimization. -
put
7for redundant lines in theINPUT_DATASETfile. -
set
1,2,3,4depending upon the number of iradial value entries in theINPUT_DATASETfile (e.g.,rc,rshape,rvloc,rcore)1 if rc 2 if rc, rshape 3 if rc, rshape, rvloc 4 if rc, rshape, rvloc, rcore -
put
5for energies for additional basis function. -
put
6for matching radius for partial waves.
-
-
IN_PARENT: Contains initial population of trial solution vector comprising ofrc,rshape,rvloc,rcore, matching radii for pseudo and projector functions, reference energies for additional wave functions. i.e., a population ofnpop(10, for this version of the code) numbers different dataset. One with proficient expertise inATOMPAWcode should prepare this file otherwise choose not to provide any data and there should not be anyIN_PARENTfile. The code will extract the solution vector from theINITIAL_ATOMPAWfile and replicate thatnpoptimes to start with. -
IN_GAPRMTR: Contains essential parameters to run genetic algorithms. Again to play with these settings one need some expertise in global optimization algorithms. -
USER_INPUTS: One can run the codes interactively, but we recommend to use this fil to avoid unnecessary complicacies.
Put 0 for EoS; 1 for Delta optimization # This version of code supports only 0 Put 0 for scratch; 1 for predefined parent population Put Cardinality of parent population (e.g. 10) # This version of code supports 10 Put Maximum allowed value for r_c >= r_{MT} (INPUT_DATASET) MT= muffin-tin Put Minimum allowed value for r_c_ must be >=r_{MT}/2 Put Minimum allowed value (other distance parameters) Put 1.00 for all of these if no preferenece for any pressure region. or e.g. P_ext=1.00d0,P_h=1.00d0,P_m=1.00d0,P_l=0.95 Put tolerance limit for wf and PSwf < 10 Put Number of volume points at which electronic structure calculations will be performed Put No. of PV data in < IN_TARGET > file = 400 Put E0, V0, B0, B0p guess for WIEN2k # although never used; Put Vmin, Vmax for WIEN2k # required only if IN_ELAST file is used Put 0 for default; 1 for manual entry for rc constraints of each member of parent population # 0 is recommended; if 1 then put Rc max; Rc min; Rci min for each solution in the population-
IN_TARGET: Contains 400 (should be same as mentioned in the aboveUSER_INPUTSfile: line number 10) equally spaced EoS data (volume and pressure) of the reference that the optimization attempts to achieve. In this work, we take theWIEN2kresults as our target reference. There are other two alternative file options:EvsVRyBohr.datfile containing volume and energy data obtained from all-electron calculations orIN_ELASTfile containing equilibrium volume ($V_0$ ), Bulk modulus ($B_0$ ) and its derivative ($B'$ ) from the reference all electron calculation.
-
-
Edit the file
makeEoSinputs.py(with descriptive commentary) according to the system under consideration. Specially the following line numbers: line number12,17,19,20, (20, if20),35-38,45(adding more lnes here will change the following line numbers. so we recommend to change it at the end),68-69(according to the available system settings),72-73,78(uncomment whenibrav=0),79(comment when79),80(check ntyp, nspin),81(ecutwfc= kinetic energy cutoff (Ry) for wavefunctions, ecutrho= Kinetic energy cutoff (Ry) for charge density and potential),82(smearing),87(mixing_beta),90(Convergence threshold for selfconsistency),91,101(atomic Symbol),106-110(uncomment when ibrav=0),113(atomic Symbol),132(0.78-1.06, scale of contraction to expansion of equilibrium lattice constant according to the target all-electron reference calculation)
-
-
Change the shell script
SETUP_FILESas executable withchmod 777 SETUP_FILESand run the shell script. It will create necessary folders, run the first fortran executableEPAWsetup.exein the folder1_FORMAT_FILESto format necessary files for the next stepsi and finally copy required files to the necessary folders. It will create the files:PARAMETERS,CONSTRAINTS, and if not present:IN_GAPRMTR,IN_PARENT,IN_TARGET. -
The next step is to make diverse parents. In that case, this step will help to create a good initial populationi using the single string based code
CARMHC.This step is necessary if one find difficulties in optimizing data-sets in the final step.
Go to the directory
2_MAKE_PARENT/and run the following command:./EPAWmparent.exe < USER_INPUTSIt will create the output files
log_ARCHV,log_EVOLFITNESS,log_EVOLINTNSTY,log_EVOLPROB.log_ARCHVstores best npop number of solutions in terms of minimum area under the logarithmic derivative curves generated by all electron and PAW calculations for each angular momentum quantum number, while maintaining the constraints on the basis sets and logarithmic derivative curves.log_EVOLFITNESSstores the objetive values of the npop best string in each generation/iteration step.log_EVOLINTNSTY,log_EVOLPROBstore the mutation intesity and mutation probability if restart is required. Besides these data show how the parameters varies and based on that one can set a better mutation intesity and mutation probability to start with.Copy
log_ARCHVasIN_PARENT:cp log_ARCHV IN_PARENTCopy
IN_PARENTto the directory3_EOSOPTIMIZE:cp IN_PARENT ../3_EOSOPTIMIZE/Upto this point, everything is serial implementation. The final step requires access to multiple cores as mentioned earlier.
-
Go to the directory
3_EOSOPTIMIZE-
run the python script
makeEoSinputs.py:python makeEoSinputs.py. It will create directories (pot$f), subdirectories (eos$e), SCF input files and script files and amaketmpscript. Edit themaketmpscript according to the system settings. Eachpot$ffolder will have neos number ofeos$esubfolder. Eacheos$esubfolder contains onescf.infile. Manually check all thescf.infile for one arbitrarypot$ffolder. If changes require, do it for all theeos$e/scf.infile and copy the contents of thepot$ffolder to otherpot$ffolders. Specially check the location of the temporary file for Quantum ESPRESSO. -
open the file named as
scf_script.shand replace the following lines, if required, according to your settings.orig=0 for j in `seq 1 10`; do # j is the dummy index for the number of data-sets in each iteration, i.e., cardinality of the GA population. for i in `seq 1 15`; do # i is the dummy index for the number of volume points at which electronic structure calculations will be performed in each iteration/generation. cd pot$j/eos$i/ rm -r tmp ibrun -n 4 -o $orig pw.x -nk 2 -in scf.in >scf.out & # here and beneath 4 is the number of cores per SCF calculations. orig=`echo "$orig + 4" | bc` sleep 1 cd ../../ done done wait # For the above setting we need at least 10*15*4=600 cores/processors in each iteration steps. # We recommend not to change the cardinality of the GA population, i.e., npop=10. # Now if one reduce the number of volume points at which electronic structure calculations will be performed to 7, and assign one core per job then the total number of required processors will be # 10*7*1=70 # Therefore, according to the available system adjust the numbers.
The rest of the part should be unaltered.
-
change the number of nodes and tasks-per-node in the
jobscriptfile. This is the final step: submission of thejobscript. It will create aSUPERINDIVIDUALfolder that will store the best data-set in each generation alongwithO_ARCHV,O_EVOLFITNESS,O_SUPERINDV.O_ARCHVstores best npop number of solutions in terms of minimum area under the EoS curves generated by refernce all electron approach and PAW calculations whereasO_SUPERINDVstores the best solution vector alongwith its objective value,O_EVOLFITNESSstores the objetive values of the npop best string in each generation/iteration step.
-
chmod 777 Goodness.py
./Goodness.py