-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_cpc.py
executable file
·65 lines (40 loc) · 1.66 KB
/
run_cpc.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
#!/usr/bin/env python
from argparse import *
import glob
import sys
from lib.cpcUtil import CpcUtil
from lib.util import *
from lib.md_tools import *
import os
'''
creates a copernicus project with the same name as this project
sets up an md workflow
submits all available structures to the workflow
Note: assumes there is file named grompp_em.mdp in the project file
'''
iman = "iman" \
""
parser = ArgumentParser()
parser.add_argument("step",choices=['em','equi','prod'],help="what type of simulation to prepare")
parser.add_argument("-max",help="maximum number of cores for each run",default=24,type=int)
args = parser.parse_args()
maxCores = 24
if args.max:
maxCores = args.max
if args.step == "em":
if (not os.path.isfile(FileNames.GROMPP_EM)):
print "File %s is required to proceed"%FileNames.GROMPP_EM
sys.exit(1)
filePathList = glob.glob("%s/%s"%(ProjectDirectories.CONF_DIR,"conf*.pdb"))
filePathList = sorted_nicely(set(filePathList))
CpcUtil.buildMDWorkflow(getEmProjectName(),FileNames.GROMPP_EM,filePathList,maxCores=maxCores)
elif args.step == "prod":
if (not os.path.isfile(FileNames.GROMPP_PROD)):
print "File %s is required to proceed"%FileNames.GROMPP_PROD
sys.exit(1)
print "Starting a prod project"
filePathList = glob.glob("%s/%s"%(ProjectDirectories.EQUILIBRATION_DIR,"conf*.gro"))
filePathList = sorted_nicely(set(filePathList))
# cmdLine = "\"-npme 42\""
# CpcUtil.buildMDWorkflow(getProjectName(),FileNames.GROMPP_PROD,filePathList,maxCores=maxCores,cmdLine=cmdLine)
CpcUtil.buildMDWorkflow(getProjectName(),FileNames.GROMPP_PROD,filePathList,maxCores=maxCores)