User Tools

Site Tools


howto:atat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:atat [2018/01/11 14:08]
alopis
howto:atat [2021/12/09 16:42] (current)
Line 1: Line 1:
-This describes the use of ATAT on CHPC Lengau cluster employing QE (Quantum Espresso 6.1.0).  Anton Lopis  11 Jan 2017+====== Running ATAT (The Alloy-Theoretic Automated Toolkit======
  
-The user must make sure to be using one of their subdirectories on lustre, that is  /mnt/lustre/users/<userid>/ 
  
 +[[http://www.brown.edu/Departments/Engineering/Labs/avdw/atat/]]
  
-One needs the following files:+ 
 +This describes the use of ATAT on Lengau and employs QE (Quantum Espresso 6.1.0).  Anton Lopis  11 Jan 2017 
 + 
 +Please find the files at   **/apps/chpc/chem/ATAT/3.36/CHPC_Running** including pbs submission/bash script and input files (see below as well). 
 + 
 + 
 +The user must make sure to be using one of their **subdirectories on lustre, that is  /mnt/lustre/users/<userid>/** 
 + 
 + 
 +===== One needs the following files: =====
  
 1. maps.pbs 1. maps.pbs
Line 11: Line 20:
  
 3. lat.in 3. lat.in
 +
 4. qe.param 4. qe.param
 +
 5. A directory named for example "Pseudo" containing the required pseudopotential files 5. A directory named for example "Pseudo" containing the required pseudopotential files
  
-One needs to edit the pbs submit script file maps.pbs appropriately: + 
-1. Choose the number of nodes that QE will run most efficiently on for your size of QM problem. In the listed example I have specified 2 nodes, however I have not checked, and perhaps only one node might have been more efficient. + 
-2. Choose appropriate walltime.+===== One needs to edit the pbs submit script file maps.pbs appropriately: ===== 
 + 
 + 
 + 
 + 
 + 
 + 
 +1.** Choose the number of nodes that QE will run most efficiently on for your size of QM problem**. In the listed example I have specified 2 nodes, however I have not checked, and perhaps only one node might have been more efficient. 
 + 
 +2. **Choose appropriate walltime.** 
 3. Choose queue, "smp" if one is using only one node, "normal" if one is using more. 3. Choose queue, "smp" if one is using only one node, "normal" if one is using more.
 +
 4. Make sure to edit the name of the lustre directory used for the standard "error" and standard "output" files. 4. Make sure to edit the name of the lustre directory used for the standard "error" and standard "output" files.
 +
 5. The modules are loaded. One would need the same modules if using an interactive job on a compute node. 5. The modules are loaded. One would need the same modules if using an interactive job on a compute node.
 +
 6. Edit in your working directory, normally the same directory as in 4 above (the "pushd" line). 6. Edit in your working directory, normally the same directory as in 4 above (the "pushd" line).
 +
 7. Edit in the same working directory in the pollmach command (ATAT seems to always to want to use one's home directory). 7. Edit in the same working directory in the pollmach command (ATAT seems to always to want to use one's home directory).
 +
 8. I've included the "touch stop" in order to stop maps just in case it does not stop itself when walltime is exceeded. 8. I've included the "touch stop" in order to stop maps just in case it does not stop itself when walltime is exceeded.
  
  
-One needs to edit the file "runstruct_qe" appropriately:+ 
 +===== One needs to edit the file "runstruct_qe" appropriately: ===== 
 + 
 + 
 1. The appropriate PseudoDIR (it could remain as one used for all jobs). 1. The appropriate PseudoDIR (it could remain as one used for all jobs).
 +
 2. The appropriate choises for the QE setings of cutoffs and degauss. My choices here are quite arbitrary and not best for you to use except maybe for testing. 2. The appropriate choises for the QE setings of cutoffs and degauss. My choices here are quite arbitrary and not best for you to use except maybe for testing.
 3. The parameter file name and directory, most likely in your working directory. 3. The parameter file name and directory, most likely in your working directory.
 +
 4. Note QE will run over all the specified nodes, while maps is likely to use one core of the first node chosen. The QE jobs appear to run sequentially, that is one at a time, and not simultaneously. 4. Note QE will run over all the specified nodes, while maps is likely to use one core of the first node chosen. The QE jobs appear to run sequentially, that is one at a time, and not simultaneously.
  
  
 +<file bash maps.pbs>
 +#!/bin/bash
 +#PBS -P RCHPC   
 +#PBS -N test_ATAT
 +#PBS -l select=2:ncpus=24:mpiprocs=24
 +#PBS -l place=excl
 +#PBS -l walltime=15:00:00
 +#PBS -q normal
 +#PBS -m be
 +#PBS -M none
 +#PBS -o /mnt/lustre/users/alopis/ATAT_testing.out 
 +#PBS -e /mnt/lustre/users/alopis/ATAT_testing.error
 +#PBS
 +
 +module purge
 +module load gcc/5.1.0
 +module load chpc/openmpi/1.8.8/gcc-5.1.0
 +module load chpc/qespresso/6.1.0/openmpi-1.8.8/gcc-5.1.0
 +module load gcc/6.1.0
 +module load chpc/atat/3.36/gcc-6.1.0
 +
 +nproc=`cat $PBS_NODEFILE | wc -l`
 +
 +export QESPRESSO=/apps/chpc/chem/qespresso/6.1.0
 +
 +pushd /mnt/lustre/users/alopis/ATAT_testing
 +
 +maps -d &
 +
 +pollmach /mnt/lustre/users/alopis/ATAT_testing/runstruct_qe
 +
 +touch stop
 +</file>
 +
 +
 +<file bash runstruct_qe>
 +
 +#!/bin/bash
 +# This bash scrpit is for the interface between ATAT and Quantum-ESPRESSO v5.0
 +# The final result will be in eV unit
 +# Produced by GAO Zhe, Mater. Sci & Eng, Seoul Nat'l Univ., S. Korea
 +# email to gaozhe1983(a)snu.ac.kr
 +
 +# Set the k-points density in reciprocal space
 +KPPRA=1000
 +
 +# Set the command to run pw.x, for example,
 +# if you wanna run it with 4 cores/cpus, set it
 +# as "$MPI_PATH/mpirun -n 4 $QE_PATH/pw.x"
 +
 +#export QESPRESSO=/apps/chpc/chem/qespresso/6.1.0
 +
 +PWCOMMAND="$QESPRESSO/bin/pw.x"
 +
 +# Set some calculation parameters here, which contents:
 +# cut-off energy for wave-functions and charge density;
 +# gaussian broadening parameter for smearing;
 +# especially, the directory where restore your pseudo-potential files.
 +# Definitely, you can directly set these and some other parameters
 +# in the input file-creating part.
 +########################################################################
 +# Recommand from the official manual of Quantum-ESPRESSO:              #
 +# for Norm-Conserving pseudo-potential, the cut-off for charge density #
 +# does not need to be setted (or, 4 times of ecutwfc).                 #
 +# But for ultrasoft pseudo-potential, set the cut-off for charge       #
 +# density to 8~10 times of cut-off for wavefunctions.                  #
 +########################################################################
 +PseudoDIR=/mnt/lustre/users/alopis/ATAT_testing/Pseudo
 +CUT_WFC=50
 +CUT_CHG=520
 +DEGAUSS=0.5
 +
 +# Try to find the parameter setting file, which contents the 
 +# information for species of elements
 +# If this file does not exist, the script will stop
 +ParamFile=/mnt/lustre/users/alopis/ATAT_testing/qe.param
 +if [ ! -e $ParamFile ]; then
 +  ParamFile="../qe.param"
 +  if [ ! -e $ParamFile ]; then
 +    ParamFile="../../qe.param"
 +    if [ ! -e $ParamFile ]; then
 +     echo " Cannot find the param file qe.param, stop the code!"
 +     exit 1
 +    fi
 +  fi
 +fi
 +
 +# Create the fist part of input file for QE v5.0
 +cat > pwscf.in <<EOF
 +&control
 +   calculation = 'vc-relax' ,
 +   prefix = 'pwscf' ,
 +   outdir = './temp/' ,
 +   pseudo_dir = '$PseudoDIR/' ,
 +   disk_io = 'none' ,
 +   etot_conv_thr = 1.0d-10 ,
 +   forc_conv_thr = 1.0d-5 ,
 +/
 +&system
 +   ibrav = 0 ,
 +   celldm(1) = 1.889725989 ,
 +   ecutwfc = ${CUT_WFC} ,
 +   ecutrho = ${CUT_CHG} ,
 +   occupations = 'smearing' ,
 +   smearing = 'mv' ,
 +   degauss = ${DEGAUSS} ,
 +EOF
 +
 +# Find the atom number and elements number
 +# Then, write them into the input file
 +NAT=`cellcvrt -f < str.out | tail -n +7 | wc -l`
 +NTYPE=`cellcvrt -f < str.out | tail -n +7 | awk '{print $4}' | sort -u | wc -l`
 +echo "   nat = $NAT , " >> pwscf.in
 +echo "   ntyp = $NTYPE , " >> pwscf.in
 +
 +# Create the temp input file, which corresponds to
 +# the second big part. After creating, it will be 
 +# attached follow the former one and deleted.
 +cat > pwscf.tmp <<EOF
 +/
 +&electrons
 +   conv_thr = 1.0d-10 ,
 +   diagonalization = 'david' ,
 +   mixing_mode = 'plain' ,
 +   startingpot = 'atomic' ,
 +   startingwfc = 'atomic+random' ,
 +   mixing_beta = 0.6 ,
 +/
 +&ions
 +   ion_dynamics = 'bfgs' ,
 +/
 +&cell
 +   cell_dynamics = 'bfgs' ,
 +   cell_factor = 2.0 ,
 +   press = 0.0 ,
 +   press_conv_thr = 1.0d-3 ,
 +/
 +CELL_PARAMETERS alat
 +EOF
 +cat pwscf.tmp >> pwscf.in
 +rm -f pwscf.tmp
 +
 +# Find and write the lattice vector information
 +cat str.out | cellcvrt -c -sig=9 | tail -n +4 | head -3 >> pwscf.in
 +
 +# Find and write the information for element type, mass
 +# and pseudo-potential files' name
 +echo "ATOMIC_SPECIES" >> pwscf.in
 +INT=1
 +while [ "$INT" -le "$NTYPE" ]; do
 +  KIND=pp`cellcvrt -f < str.out | tail -n +7 | awk '{print $4}' | sort -u | head -${INT} | tail -1`
 +  grep "$KIND" $ParamFile | awk '{print "  " $2, $3, $4}' >> pwscf.in
 +  let "$((INT++))"
 +done
 +
 +# Find and write the atoms' position to input file
 +echo "ATOMIC_POSITIONS angstrom" >> pwscf.in
 +cat str.out | cellcvrt -c -sig=9 | tail -n +7 | awk '{print "  " $4,  $1,  $2,  $3 }' >> pwscf.in
 +
 +# Find the k-points mesh, the mesh will be created
 +# by Monkhorst-Pack method
 +echo "K_POINTS automatic" >> pwscf.in
 +nbat=`cellcvrt -pn < str.out`
 +echo "  " `( echo $KPPRA $nbat | awk '{print $1/$2}' ; cat str.out | cellcvrt -f | head -3 ) | kmesh -q -r`    0  0 >> pwscf.in
 +
 +# Run pw.x for calculation
 +
 +
 +nproc=`cat $PBS_NODEFILE | wc -l`
 +
 +#mpirun -np 24 $PWCOMMAND < pwscf.in > pwscf.out
 +mpirun -np $nproc $PWCOMMAND < pwscf.in > pwscf.out
 +
 +# Abstract the final total energy to "energy" file
 +# in the unit of eV
 +FERy=`grep '!' pwscf.out | tail -1 | cut -c 35-50`
 +FEeV=`echo "scale=15; $FERy*13.605698066" | bc -l`
 +echo "$FEeV" > energy
 +
 +</file>
 +
 +
 +<file txt lat.in>
 +
 +3.155  3.155  3.155  90  90  90
 + 0.5   0.5   0.5
 +-0.5   0.5   0.5
 +-0.5  -0.5   0.5
 +0.0  0.0  0.0  Mo,W                
 +</file>
 +
 +
 +<file txt qe.param>
 +
 +# The rule for make atomic_species card:
 +# set the ppXXX as the name of certain line
 +# then, write down the elemental symbol, mass
 +# and pseudo-potential name info.
 +
 +ppW       183.80   W.GTH_LDA.UPF
 +ppMo    Mo  12.011   Mo.GTH_LDA.UPF
 +                                      
 +</file>
/app/dokuwiki/data/attic/howto/atat.1515672508.txt.gz · Last modified: 2021/12/09 16:42 (external edit)