Skip to content

Commit

Permalink
adding in placentia files
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Tamblyn committed Oct 26, 2012
1 parent ba075e8 commit c3290dd
Show file tree
Hide file tree
Showing 33 changed files with 1,818 additions and 12 deletions.
8 changes: 8 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/tcsh

foreach machine (cl001 cl002 cl003 cl004 cl005 cl006)

echo $machine
ssh $machine /usr/local/bin/qclean-mx.sh

end
8 changes: 8 additions & 0 deletions convert_coor_TRAJEC.lithium-no_com.pwscf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/csh

set acell=`grep celldm lithium.pw.inp | awk '{print $3}' | sed s/,//g`
set natoms=`grep nat lithium.pw.inp | tail -1 | awk '{print $3}' | sed s/,//g`

touch output/fake.out

grep -A $natoms ATOMIC_POSITIONS output/*.out | awk '/Li/{print $2," ",$3," ",$4}' | sed s/"\-"/" \-"/g | awk -f ~/scripts/utils/convert_coor_TRAJEC.awk acell=$acell natoms=$natoms > TRAJEC.xyz
3 changes: 3 additions & 0 deletions extract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/csh

grep -A 28 Summary output.log | grep "\." | awk '{print $2,$3 }' > energy.dat
8 changes: 8 additions & 0 deletions form.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/tcsh

set file=$1

setenv g09root /usr/local/gaussian
setenv GAUSS_SCRDIR /globalscratch/$USER/
source /usr/local/gaussian/g09/bsd/g09.login
formchk $file
39 changes: 39 additions & 0 deletions gPressure.cpmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/tcsh

set timeStep = $1

awk '/STRESS/{n+=1;a=0;getline;a=$1/10;getline;a+=$2/10;getline;a+=$3/10;print n " " a/3}' STRESS > outPressure_GPa

ln -s outPressure_GPa outPressure_GPa.250
ln -s outPressure_GPa outPressure_GPa.500
ln -s outPressure_GPa outPressure_GPa.1000

~/scripts/utils/running-average.py outPressure_GPa.250 2 250 &
~/scripts/utils/running-average.py outPressure_GPa.500 2 500 &
~/scripts/utils/running-average.py outPressure_GPa.1000 2 1000 &

wait

set cmd="gnuplot.scr"
cat > $cmd << END
set data style linespoints
set xlabel "Time (ps)"
set ylabel "Pressure (GPa)"
set yrange [*:*]
set terminal png
set output 'pressure.png'
#plot "outPressure_GPa" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "pressure (GPa)" with linespoints, "outPressure_GPa.250.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 250 steps", "outPressure_GPa.500.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 500 steps", "outPressure_GPa.1000.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 1000 steps"
set terminal x11
#plot "outPressure_GPa" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "pressure (GPa)" with linespoints, "outPressure_GPa.250.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 250 steps", "outPressure_GPa.500.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 500 steps", "outPressure_GPa.1000.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 1000 steps"
plot "outPressure_GPa" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "pressure (GPa)" with linespoints, "outPressure_GPa.250.running" u (\$1*$timeStep*2.4188E-17/1.0E-12):2 t "running pressure (GPa), 250 steps"
pause -1 "Showing pressure.\nPress enter to quit"
quit
END

gnuplot $cmd

\rm $cmd

~/bin/blocker outPressure_GPa 2 | grep Final

rm outPressure_GPa.*
24 changes: 24 additions & 0 deletions getEnergy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/python

import sys, commands

combined_energy = float(commands.getoutput('grep "Convergence criterion met" ../output.out | tail -1 ').split()[1])
iso_counter = int(commands.getoutput('grep "Convergence criterion met" output.out | wc -l '))

iso_energy_line = commands.getoutput('grep "Convergence criterion met" output.out').split()

total = combined_energy



iso_energy = []

for i in range(iso_counter):

iso_energy.append(float(iso_energy_line[1 + i*6]))
total -= iso_energy[-1]

print combined_energy, iso_energy
print -total*627.509469


33 changes: 33 additions & 0 deletions machinesfilescript/hostlist.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Warning: no access to tty; thus no job control in this shell...
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
Thu Aug 9 20:49:27 NDT 2007
PE_HOSTFILE is /var/spool/sge/cl012/active_jobs/88217.1/pe_hostfile and contains:
-----------------------------
cl012 16 all.q@cl012 <NULL>
-----------------------------
HOSTNAME is cl012
NHOSTS is 1
NSLOTS is 16
TMPDIR is /tmp/88217.1.all.q
JOB_ID is 88217
SGE_O_WORKDIR is /home/itamblyn/machinesfilescript
/tmp/88217.1.all.q/machines contains:
-----------------------------
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
cl012
-----------------------------
logout
25 changes: 25 additions & 0 deletions machinesfilescript/hostlist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
#$ -S /bin/csh
#$ -cwd
#$ -N hostlist
#$ -j y
#$ -o hostlist.out
#$ -pe openmp 16
#$ -l h_vmem=250M,h_rt=00:01:00
date
echo PE_HOSTFILE is $PE_HOSTFILE and contains:
echo -----------------------------
cat $PE_HOSTFILE
echo -----------------------------
echo HOSTNAME is $HOSTNAME
echo NHOSTS is $NHOSTS
echo NSLOTS is $NSLOTS
echo TMPDIR is $TMPDIR
echo JOB_ID is $JOB_ID
echo SGE_O_WORKDIR is $SGE_O_WORKDIR
# You might want to adjust this next path to your liking...
$SGE_O_WORKDIR/startmpi.sh $PE_HOSTFILE
echo $TMPDIR/machines contains:
echo -----------------------------
cat $TMPDIR/machines
echo -----------------------------
46 changes: 46 additions & 0 deletions machinesfilescript/startmpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh
#
# preparation of the mpi machine file
#
# usage: startmpi.sh <pe_hostfile>
#

PeHostfile2MachineFile()
{
cat $1 | while read line; do
host=`echo $line|cut -f1 -d" "|cut -f1 -d"."`
nslots=`echo $line|cut -f2 -d" "`
i=1
while [ $i -le $nslots ]; do
echo $host
i=`expr $i + 1`
done
done
}

#
# on success the job will find a machine-file in $TMPDIR/machines
#

me=`basename $0`

# test number of args
if [ $# -ne 1 ]; then
echo "$me: got wrong number of arguments" >&2
exit 1
fi

# get arguments
pe_hostfile=$1

# ensure pe_hostfile is readable
if [ ! -r $pe_hostfile ]; then
echo "$me: can't read $pe_hostfile" >&2
exit 1
fi

machines="$TMPDIR/machines"
PeHostfile2MachineFile $pe_hostfile >> $machines

# signal success to caller
exit 0
7 changes: 3 additions & 4 deletions monitor.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/tcsh

foreach machine ( selenium tellurium beryllium carbon neon nitrogen fluorine oxygen )
foreach machine (cl001 cl002 cl003 cl004 cl005 cl006)

echo -n $machine " "

ssh ${machine} top -b -n1 | awk '/load/{print $10, $11, $12, "(5 min)", $14, "(15 min)"}' | sed s/,//g
echo $machine
ssh $machine /usr/local/bin/qclean-mx.sh

end
10 changes: 10 additions & 0 deletions myrinet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

qstat -u \* -f | awk '/cl00/{print $0} /cl010/{print $0} /cl011/{print $0} /cl012/{print $0}' | awk '/short/{print $1, $3, $4}' > out.tmp
cat out.tmp
echo
echo -n "Total slots in use: "
sed s/@/" "/g out.tmp | sed s/"\/"/" "/g | awk '{nslots+=$3; print nslots}' | tail -1
echo -n "Open slots: "
sed s/@/" "/g out.tmp | sed s/"\/"/" "/g | awk '{nslots+=$3; print 192 - nslots}' | tail -1
rm out.tmp
120 changes: 120 additions & 0 deletions pdos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env python

import sys
sys.path.append("/usr/local/numpy.1.0.4/lib64/python2.3/site-packages/")
import numpy
import commands

try:
input_filename = sys.argv[1]
except IndexError:
print '\nusage: ' + sys.argv[0] + ' input_filename'
print '\nexiting...\n'
sys.exit(0)

core_valence_divide = 401 # <- this corresponds to -20 eV

command_line_counter = commands.getoutput('wc -l ' + input_filename).split()

if len(command_line_counter) != 2:
print 'Error determining file size'
else:
number_of_lines = int(command_line_counter[0])

outputFile_dos = open('dos.dat', 'w')
outputFile_pdos = open('pdos.dat', 'w')

inputFile = open(input_filename, 'r')

for i in range(5):
inputFile.readline()

inline_total = inputFile.readline()

emin_total = float(inline_total.split()[1])
emax_total = float(inline_total.split()[0])
enum_total = int(inline_total.split()[2])
efermi_total = float(inline_total.split()[3])

dos = numpy.zeros((enum_total, 3), dtype = numpy.float) # E, dos, idos

for i in range(enum_total):
inline_total = inputFile.readline().split()
dos[i][0] = float(inline_total[0]) #- efermi_total
# dos[i][0] = float(inline_total[0]) - efermi_total
dos[i][1], dos[i][2] = float(inline_total[1]), float(inline_total[2])

for row in dos:
for element in row:
outputFile_dos.write(str(element) + ' ')
outputFile_dos.write('\n')

############

inline_project = inputFile.readline()

emin_project = float(inline_project.split()[1])
enum_project = int(inline_project.split()[2])
efermi_project = float(inline_project.split()[3])

spacing = (emax_total - emin_total)/enum_total
efermi_bin = int((efermi_total - emin_total)/spacing)

pdos = numpy.zeros((enum_project, 1 + 3*2), dtype = numpy.float) # E, s, p, d

for i in range(len(pdos)):

pdos[i][0] = dos[i][0] # fills in the E column of pdos

for i in range(enum_project):
inline_project = inputFile.readline().split()
pdos[i][1] += float(inline_project[1])
pdos[i][2] += float(inline_project[2])
pdos[i][3] += float(inline_project[3])

for i in numpy.arange(1,enum_project):
pdos[i][4] = pdos[i - 1][4] + pdos[i][1]
pdos[i][5] = pdos[i - 1][5] + pdos[i][2]
pdos[i][6] = pdos[i - 1][6] + pdos[i][3]


energies = numpy.transpose(pdos)[0]
s_project = numpy.transpose(pdos)[1]
p_project = numpy.transpose(pdos)[2]
d_project = numpy.transpose(pdos)[3]

energies_core = energies[0:core_valence_divide]
s_project_core = s_project[0:core_valence_divide]
p_project_core = p_project[0:core_valence_divide]
d_project_core = d_project[0:core_valence_divide]


energies_valence = energies[core_valence_divide:efermi_bin]
s_project_valence = s_project[core_valence_divide:efermi_bin]
p_project_valence = p_project[core_valence_divide:efermi_bin]
d_project_valence = d_project[core_valence_divide:efermi_bin]

spd_sum_core = sum(s_project_core) + sum(p_project_core) + sum(d_project_core)
spd_sum_valence = sum(s_project_valence) + sum(p_project_valence) + sum(d_project_valence)

s_fraction_core = sum(s_project_core)/spd_sum_core
p_fraction_core = sum(p_project_core)/spd_sum_core

s_fraction_valence = sum(s_project_valence)/spd_sum_valence
p_fraction_valence = sum(p_project_valence)/spd_sum_valence

print
print "%s core", s_fraction_core*100
print "%p core", p_fraction_core*100
print
print "%s valence", s_fraction_valence*100
print "%p valence", p_fraction_valence*100
print
print "efermi_total = ", efermi_total
print "spacing = ", spacing
print

for row in pdos:
for element in row:
outputFile_pdos.write(str(element) + ' ')
outputFile_pdos.write('\n')
Loading

0 comments on commit c3290dd

Please sign in to comment.