added non-slurm calculations

main
Aditya Wibawa Sakti 2 years ago
parent 64a32ccbc6
commit 500f7c3fd1
  1. BIN
      .DS_Store
  2. 245
      bin/cmmde.py
  3. BIN
      lib/__pycache__/cmmde_dcdftb.cpython-39.pyc
  4. BIN
      lib/__pycache__/cmmde_dftb.cpython-39.pyc
  5. BIN
      lib/__pycache__/cmmde_dock.cpython-39.pyc
  6. BIN
      lib/__pycache__/cmmde_hubbard.cpython-39.pyc
  7. BIN
      lib/__pycache__/cmmde_mass.cpython-39.pyc
  8. BIN
      lib/__pycache__/cmmde_mdpro.cpython-39.pyc
  9. BIN
      lib/__pycache__/cmmde_nw.cpython-39.pyc
  10. BIN
      lib/__pycache__/cmmde_orca.cpython-39.pyc
  11. BIN
      lib/__pycache__/cmmde_qe.cpython-39.pyc
  12. BIN
      lib/__pycache__/cmmde_xtb.cpython-39.pyc
  13. 1
      lib/cmmde_hubbard.py
  14. 16
      lib/cmmde_xtb.py

BIN
.DS_Store vendored

Binary file not shown.

@ -28,7 +28,7 @@ parser.add_argument('-m','--method',type=str,default='XTB2',help='Metode yang di
parser.add_argument('-sfreq','--scalefreq',type=float,default=1, help='Faktor skala frekuensi yang digunakan.') parser.add_argument('-sfreq','--scalefreq',type=float,default=1, help='Faktor skala frekuensi yang digunakan.')
# Input yang berkaitan dengan perhitungan menggunakan software DCDFTBMD # Input yang berkaitan dengan perhitungan menggunakan software DCDFTBMD
parser.add_argument('-disp','--dispersion',type=str,default='None', help='Model koreksi dispersi jika menggunakan software DCDFTB. Pilihan: None, D3, D3BJ, D3H5.') parser.add_argument('-disp','--dispersion',type=str,default='None', help='Model koreksi dispersi jika menggunakan software DCDFTB. Pilihan: None, D3, D3BJ, D3H5.')
parser.add_argument('-para','--parapath',type=str,default='/home/adit/opt/dftbplus/external/slakos/origin/3ob-3-1',help='Lokasi folder berisikan himpunan parameter DFTB yang akan digunakan.') parser.add_argument('-para','--parapath',type=str,default='/Users/adit/opt/dftbplus/external/slakos/origin/3ob-3-1',help='Lokasi folder berisikan himpunan parameter DFTB yang akan digunakan.')
parser.add_argument('-iter','--iter',type=int,default=9999, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya') parser.add_argument('-iter','--iter',type=int,default=9999, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya')
parser.add_argument('-ens','--ensembel',type=str,default='NVE', help='Ensembel yang digunakan dalam simulasi dinamika molekul. Pilihan: NVE, NVT, dan NPT.') parser.add_argument('-ens','--ensembel',type=str,default='NVE', help='Ensembel yang digunakan dalam simulasi dinamika molekul. Pilihan: NVE, NVT, dan NPT.')
parser.add_argument('-tstat','--thermostat',type=str,default='andersen', help='Termostat yang digunakan dalam simulasi NVT. Pilihan: andersen,berendsen,dan nose') parser.add_argument('-tstat','--thermostat',type=str,default='andersen', help='Termostat yang digunakan dalam simulasi NVT. Pilihan: andersen,berendsen,dan nose')
@ -180,6 +180,7 @@ parser.add_argument('-cpress','--cellpress',type=float,default=0.0,help='Tekanan
parser.add_argument('-press_conv','--press_conv_thr',type=float,default=0.5,help='Kriteria konvergensi untuk tekanan sel. Default=0.5 kbar.') parser.add_argument('-press_conv','--press_conv_thr',type=float,default=0.5,help='Kriteria konvergensi untuk tekanan sel. Default=0.5 kbar.')
parser.add_argument('-nband','--nband',type=int,default=8,help='Jumlah tingkat energi yang ingin diplot dalam DOS.') parser.add_argument('-nband','--nband',type=int,default=8,help='Jumlah tingkat energi yang ingin diplot dalam DOS.')
parser.add_argument('-occ','--occ',type=str,default='tetrahedra',help='Metode smearing yang digunakan. Default: tetrahedra. Pilihan: smearing, tetrahedra_lin, tetrahedra_opt, fixed, from_input.') parser.add_argument('-occ','--occ',type=str,default='tetrahedra',help='Metode smearing yang digunakan. Default: tetrahedra. Pilihan: smearing, tetrahedra_lin, tetrahedra_opt, fixed, from_input.')
parser.add_argument("-slurm","--slurm",type=str,default="true",help="Apakah akan menggunakan slurm atau tidak. Default: true")
opt=parser.parse_args(sys.argv[1:]) opt=parser.parse_args(sys.argv[1:])
@ -187,8 +188,9 @@ opt=parser.parse_args(sys.argv[1:])
if ('.xyz' or '.pdb' or 'POSCAR' or '.vasp' or '.poscar') in opt.input: if ('.xyz' or '.pdb' or 'POSCAR' or '.vasp' or '.poscar') in opt.input:
geom = opt.input geom = opt.input
elif '.mol2' in opt.input: elif '.mol2' in opt.input:
with open('run_babel.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run_babel.sh','w') as fout:
print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
#SBATCH --ntasks=1 #SBATCH --ntasks=1
#SBATCH --cpus-per-task=1 #SBATCH --cpus-per-task=1
@ -196,20 +198,37 @@ elif '.mol2' in opt.input:
export OMP_NUM_THREADS={} export OMP_NUM_THREADS={}
cd $PWD cd $PWD
obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout) obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout)
os.system('sbatch run_babel.sh') os.system('sbatch run_babel.sh')
else:
with open('run_babel.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout)
os.system("chmod +x run_babel.sh")
os.system('./run_babel.sh')
geom = 'geom.xyz' geom = 'geom.xyz'
elif ('.mol2' not in opt.input and '.xyz' not in opt.input and '.pdb' not in opt.input and '.vasp' not in opt.input and '.poscar' not in opt.input and 'POSCAR' not in opt.input and '.gen' not in opt.input): elif ('.mol2' not in opt.input and '.xyz' not in opt.input and '.pdb' not in opt.input and '.vasp' not in opt.input and '.poscar' not in opt.input and 'POSCAR' not in opt.input and '.gen' not in opt.input):
os.system("echo '{}' > geom.smi".format(opt.input)) os.system("echo '{}' > geom.smi".format(opt.input))
with open('run_babel.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run_babel.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task=1 #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task=1
export OMP_NUM_THREADS={} #SBATCH --time=168:0:0
cd $PWD export OMP_NUM_THREADS={}
obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout) cd $PWD
os.system('sbatch run_babel.sh') obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout)
os.system('sbatch run_babel.sh')
else:
with open('run_babel.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout)
os.system("chmod +x run_babel.sh")
os.system('./run_babel.sh')
while not os.path.exists('geom.xyz'): while not os.path.exists('geom.xyz'):
time.sleep(3) time.sleep(3)
geom = 'geom.xyz' geom = 'geom.xyz'
@ -236,6 +255,7 @@ if opt.software == 'dock':
addcharge(opt.input,opt.chargetype) addcharge(opt.input,opt.chargetype)
if opt.job == 'sphgen': if opt.job == 'sphgen':
sphgen(opt.input) sphgen(opt.input)
if opt.slurm == 'true':
with open('run_sphgen.sh','w') as fout: with open('run_sphgen.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -247,46 +267,81 @@ cd $PWD
$DOCK_DIR/sphgen $DOCK_DIR/sphgen
$DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout) $DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout)
os.system("sbatch run_sphgen.sh") os.system("sbatch run_sphgen.sh")
else:
with open('run_sphgen.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/sphgen
$DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout)
os.system("chmod +x run_sphgen.sh")
os.system("./run_sphgen.sh")
if opt.job == 'showsphere': if opt.job == 'showsphere':
showsphere() showsphere()
if opt.job == 'gridgen': if opt.job == 'gridgen':
gridgen(opt.input) gridgen(opt.input)
with open('run_grid.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run_grid.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task=1 #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task=1
export OMP_NUM_THREADS={} #SBATCH --time=168:0:0
cd $PWD export OMP_NUM_THREADS={}
$DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout) cd $PWD
os.system("sbatch run_grid.sh") $DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout)
os.system("sbatch run_grid.sh")
else:
with open('run_grid.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout)
os.system("chmod +x run_grid.sh")
os.system("./run_grid.sh")
if opt.job == 'rigiddock': if opt.job == 'rigiddock':
rigiddock(opt.ligand,opt.calcrmsd) rigiddock(opt.ligand,opt.calcrmsd)
with open('run_rigiddock.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run_rigiddock.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task=1 #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task=1
export OMP_NUM_THREADS={} #SBATCH --time=168:0:0
cd $PWD export OMP_NUM_THREADS={}
$DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout) cd $PWD
os.system("sbatch run_rigiddock.sh") $DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout)
os.system("sbatch run_rigiddock.sh")
else:
with open('run_rigiddock.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout)
os.system("chmod +x run_rigiddock.sh")
os.system("./run_rigiddock.sh")
if opt.job == 'flexdock': if opt.job == 'flexdock':
flexdock(opt.ligand,opt.calcrmsd) flexdock(opt.ligand,opt.calcrmsd)
with open('run_flexdock.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run_flexdock.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task=1 #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task=1
export OMP_NUM_THREADS={} #SBATCH --time=168:0:0
cd $PWD export OMP_NUM_THREADS={}
$DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout) cd $PWD
os.system("sbatch run_flexdock.sh") $DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout)
os.system("sbatch run_flexdock.sh")
else:
with open('run_flexdock.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout)
os.system("chmod +x run_flexdock.sh")
os.system("./run_flexdock.sh")
if opt.job == 'translig': if opt.job == 'translig':
translig(opt.ligand) translig(opt.ligand)
@ -312,17 +367,27 @@ if opt.software == 'dftb':
geom = 'in.gen' geom = 'in.gen'
dftb(geom,opt.job,opt.activeatoms,opt.method,opt.parapath,opt.dispersion,opt.kpts,opt.hcorr) dftb(geom,opt.job,opt.activeatoms,opt.method,opt.parapath,opt.dispersion,opt.kpts,opt.hcorr)
with open('run.sh','w') as fout: if opt.slurm == "true":
print("""#!/bin/bash with open('run.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task=1 #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task=1
export OMP_NUM_THREADS={} #SBATCH --time=168:0:0
cd $PWD export OMP_NUM_THREADS={}
cp cmmd.in dftb_in.hsd cd $PWD
$DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout) cp cmmd.in dftb_in.hsd
os.system('sbatch run.sh') $DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
cp cmmd.in dftb_in.hsd
$DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'qe': if opt.software == 'qe':
@ -330,33 +395,47 @@ if opt.software == 'qe':
# RUNNING SCRIPT # RUNNING SCRIPT
if opt.software == 'orca': if opt.software == 'orca':
with open('run.sh','w') as fout: if opt.slurm=="true":
print("""#!/bin/bash with open('run.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task={} #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task={}
export LD_LIBRARY_PATH=/home/adit/opt/openmpi411/lib:$LD_LIBRARY_PATH #SBATCH --time=168:0:0
export PATH=/home/adit/opt/openmpi411/bin:$PATH export LD_LIBRARY_PATH=/home/adit/opt/openmpi411/lib:$LD_LIBRARY_PATH
export OMP_NUM_THREADS=1 export PATH=/home/adit/opt/openmpi411/bin:$PATH
cd $PWD export OMP_NUM_THREADS=1
$ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""".format(opt.nproc),file=fout) cd $PWD
os.system('sbatch run.sh') $ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""".format(opt.nproc),file=fout)
os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
cd $PWD
$ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""",file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'nwchem': if opt.software == 'nwchem':
with open('run.sh','w') as fout: if opt.slurm=="true":
print("""#!/bin/bash with open('run.sh','w') as fout:
#SBATCH --nodes=1 print("""#!/bin/bash
#SBATCH --ntasks=1 #SBATCH --nodes=1
#SBATCH --cpus-per-task={} #SBATCH --ntasks=1
#SBATCH --time=168:0:0 #SBATCH --cpus-per-task={}
export LD_LIBRARY_PATH=/home/adit/opt/openmpi411/lib:$LD_LIBRARY_PATH #SBATCH --time=168:0:0
export PATH=/home/adit/opt/openmpi411/bin:$PATH export LD_LIBRARY_PATH=/home/adit/opt/openmpi411/lib:$LD_LIBRARY_PATH
export OMP_NUM_THREADS=1 export PATH=/home/adit/opt/openmpi411/bin:$PATH
cd $PWD export OMP_NUM_THREADS=1
$NWCHEM_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout) cd $PWD
os.system('sbatch run.sh') $NWCHEM_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
cd $PWD
$NWCHEM_COMMAND cmmd.in > cmmd.out""",file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'qe': if opt.software == 'qe':
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
@ -403,4 +482,4 @@ if opt.job == 'ligprep' and opt.software == 'gmx':
# Program XTB Standalone # Program XTB Standalone
if opt.software == 'xtb': if opt.software == 'xtb':
xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan,opt.solvent,opt.charge,opt.mult,opt.method,opt.fixedatoms,opt.fixedelements) xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan,opt.solvent,opt.charge,opt.mult,opt.method,opt.fixedatoms,opt.fixedelements,opt.slurm)

@ -2,6 +2,7 @@ def azimuth(element):
# Pemetaan bilangan kuantum azimut maksimum untuk masing-masing unsur # Pemetaan bilangan kuantum azimut maksimum untuk masing-masing unsur
azimuth = { azimuth = {
'Cl' : '3', 'Cl' : '3',
'Al' : '3',
'H': '1', 'H': '1',
'Cu': '3', 'Cu': '3',
'O' : '2', 'O' : '2',

@ -1,14 +1,18 @@
# CMMDE function for xTB standalone program # CMMDE function for xTB standalone program
import os import os
def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan,solvent,charge,mult,method,fixedatoms,fixedelements): def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan,solvent,charge,mult,method,fixedatoms,fixedelements,slurm):
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash if slurm == "true":
print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
#SBATCH --ntasks=1 #SBATCH --ntasks=1
#SBATCH --cpus-per-task=1 #SBATCH --cpus-per-task=1
#SBATCH --time=168:0:0 #SBATCH --time=168:0:0
export OMP_NUM_THREADS={} export OMP_NUM_THREADS={}
cd $PWD""".format(nproc),file=fout) cd $PWD""".format(nproc), file=fout)
else:
print("""#!/bin/bash
export OMP_NUM_THREADS={}""".format(nproc),file=fout)
meth = '' meth = ''
if 'GFN-FF' in method or 'gfnff' in method: if 'GFN-FF' in method or 'gfnff' in method:
meth += '--gfnff' meth += '--gfnff'
@ -108,8 +112,12 @@ $end""".format(nrun,npoint,anopt,kpush,kpull,ppull,alp),file=f)
print("""$opt print("""$opt
maxcycle = {}""".format(maxiter),file=f) maxcycle = {}""".format(maxiter),file=f)
if slurm == "true":
os.system('sbatch run.sh')
else:
os.system('chmod +x run.sh')
os.system('./run.sh')
os.system('sbatch run.sh')

Loading…
Cancel
Save