Talk:Mod:Hunt Research Group/tlog

From wiki
Jump to navigation Jump to search

tlog.py script

  • see the script itself below
  • run by typing tlog.py logfile_name
  • remove the .log extension from the logfile name

output example

[huntpa@raapoi-login]/nfs/home/huntpa/victoria $ tlog.py vl_emim_fecl4_front_meth_opt
local directory is /nfs/home/huntpa/victoria
tail /nfs/scratch/huntpa/vl_emim_fecl4_front_meth_opt.log
 Initial guess <Sx>= 0.0000 <Sy>= 0.0000 <Sz>= 2.0000 <S**2>= 6.0044 S= 2.0009
 ExpMin= 4.19D-02 ExpMax= 2.58D+05 ExpMxC= 8.89D+03 IAcc=3 IRadAn=         5 AccDes= 0.00D+00
 Harris functional with IExCor=  402 and IRadAn=       5 diagonalized for initial guess.
 HarFok:  IExCor=  402 AccDes= 0.00D+00 IRadAn=         5 IDoV= 1 UseB2=F ITyADJ=14
 ICtDFT=  3500011 ScaDFX=  1.000000  1.000000  1.000000  1.000000
 FoFCou: FMM=F IPFlag=           0 FMFlag=      100000 FMFlg1=           0
         NFxFlg=           0 DoJE=T BraDBF=F KetDBF=T FulRan=T
         wScrn=  0.000000 ICntrl=       500 IOpCl=  0 I1Cent=   200000004 NGrid=           0
         NMat0=    1 NMatS0=      1 NMatT0=    0 NMatD0=    1 NMtDS0=    0 NMtDT0=    0
 Petite list used in FoFCou.
grep -i 'Maximum Force' /nfs/scratch/huntpa/vl_emim_fecl4_front_meth_opt.log 
 Maximum Force            0.025467     0.000450     NO 
 Maximum Force            0.320034     0.000450     NO 
 Maximum Force            0.008068     0.000450     NO 
 Maximum Force            0.010136     0.000450     NO 
grep -i 'Maximum Disp' /nfs/scratch/huntpa/vl_emim_fecl4_front_meth_opt.log 
 Maximum Displacement     2.997730     0.001800     NO 
 Maximum Displacement     1.083519     0.001800     NO 
 Maximum Displacement     0.479466     0.001800     NO 
 Maximum Displacement     1.172016     0.001800     NO 
grep -i 'SCF Done:' /nfs/scratch/huntpa/vl_emim_fecl4_front_meth_opt.log 
 SCF Done:  E(UB3LYP) =  -3449.75312889     A.U. after   36 cycles
 SCF Done:  E(UB3LYP) =  -3449.73737743     A.U. after   37 cycles
 SCF Done:  E(UB3LYP) =  -3449.76351396     A.U. after   33 cycles
 SCF Done:  E(UB3LYP) =  -3449.76662016     A.U. after   31 cycles
cp /nfs/scratch/huntpa/vl_emim_fecl4_front_meth_opt.log /nfs/home/huntpa/victoria/vl_emim_fecl4_front_meth_opta.log 
[huntpa@raapoi-login]/nfs/home/huntpa/victoria $ 

script

#!/usr/bin/env python3
# 
# tlog.py 
#
# script to look at jobs running on scratch
#
import sys
import os
dir_local=os.getcwd()
user=os.getenv("USER")

if len(sys.argv) < 2:
  print('to run the script please type: tlog file_name (without log extension)')
  sys.exit()
else:
  infile=str(sys.argv[1])
  i_infile=infile.find('.log')
  if (i_infile == -1):
    base=infile
  else:
    base=infile[:i_infile]
#endif
  job=base
  s='local directory is '
  print('{0:}{1:}'.format(s,dir_local))
#close if
#
cmd =f"tail /nfs/scratch/{user}/{job}.log"
print(cmd)
os.system(cmd)
#
cmd = f"grep -i 'Maximum Force' /nfs/scratch/{user}/{job}.log "
print(cmd)
os.system(cmd)
#
cmd = f"grep -i 'Maximum Disp' /nfs/scratch/{user}/{job}.log "
print(cmd)
os.system(cmd)
#
cmd = f"grep -i 'SCF Done:' /nfs/scratch/{user}/{job}.log "
print(cmd)
os.system(cmd)
#
cmd = f"cp /nfs/scratch/{user}/{job}.log {dir_local}/{job}a.log"
print(cmd)
os.system(cmd)
#
sys.exit()