-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
83 lines (58 loc) · 1.76 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import random
import shutil
import os
def sbatch(filename):
"""
Submit a job and get the job id returned
"""
submit = os.popen("sbatch %s"%(filename)).read()
subId = submit.split()[3].replace("\n","")
return subId
def makeinp(Fold= "./"):
fob = open(Fold+"/params.in","w+")
nstep = 3000
fob.write(str(nstep) + "\t" + "nstep" + "\n")
ntraj = 5000
fob.write(str(ntraj) + "\t" + "ntraj" + "\n")
nmc = 1000
fob.write(str(nmc) + "\t" + "nmc" + "\n")
beta = 16.0
fob.write(str(beta) + "\t" + "beta" + "\n")
mnuc = 1.0
fob.write(str(mnuc) + "\t" + "mnuc" + "\n")
k1 = 1.0
fob.write(str(k1) + "\t" + "k1" + "\n")
kappa = 0.1/2
fob.write(str(kappa) + "\t" + "kappa" + "\n")
alpha = -0.5
fob.write(str(alpha) + "\t" + "alpha" + "\n")
delta = 0.10
fob.write(str(delta) + "\t" + "delta" + "\n")
dt = 0.01
fob.write(str(dt) + "\t" + "dt" + "\n")
ourseed = random.randint(0,1E6)
fob.write(str(ourseed) + "\t" + "ourseed" + "\n")
fob.close()
fob = open(Fold+"/steps.in","w+")
fob.write("0.5d0\t,0.1d0\t,0.1d0\n")
fob.write("step(1)\t,step(2)\t,step(3)\n")
# fob.write("413000\t413000\t20\t200\t %s\t %s\n"%(str(G),str(random.randint(0,10E6))))
# fob.write("runtime\tnsteps\tmappingsteps\ttrajectory\tG(eV)\tRandom\n")
def md(folder):
try:
os.mkdir(folder)
except:
print "Folder exists:", folder
def cp(filename,folder):
shutil.copy2(filename,folder)
nfold = 100
for i in range(nfold):
main = "mapp-" + str(i)
md(main)
makeinp(main)
cp('mat_1d.exe',main)
cp('submit.sbatch',main)
os.chdir(main)
#sbatch("submit.sbatch")
os.system("sbatch submit.sbatch")
os.chdir("../")