-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark_gpu.py
75 lines (61 loc) · 2.25 KB
/
benchmark_gpu.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
from radical import entk
import os
import argparse, sys
class BENCHMARK(object):
def __init__(self):
self._set_rmq()
self.am = entk.AppManager(hostname=self.rmq_hostname, port=self.rmq_port)
self.p = entk.Pipeline()
self.s = entk.Stage()
def _set_rmq(self):
self.rmq_port = int(os.environ.get('RMQ_PORT', 33239))
self.rmq_hostname = os.environ.get('RMQ_HOSTNAME', 'two.radical-project.org')
def set_resource(self, res_desc):
res_desc["schema"] = "local"
self.am.resource_desc = res_desc
def sim(self, task_count):
gromacs_path = '/gpfs/alpine/world-shared/csc393/hrlee/gromacs-5.1.5/build/bin/gmx'
gromacs_example_path = '/gpfs/alpine/world-shared/csc393/hrlee/'
for i in range(1, task_count + 1):
t = entk.Task()
grompp_bin = (gromacs_path + ' grompp -f ' +
(' %s/gromacs_example/inp_files/grompp.mdp' % gromacs_example_path) +
' -c ' +
(' %s/gromacs_example/inp_files/input.gro' % gromacs_example_path) +
' -p ' +
(' %s/gromacs_example/inp_files/topol.top' % gromacs_example_path) +
' &> grompp.log')
t.pre_exec = ["module load gcc/8.1.1", grompp_bin]
t.executable = gromacs_path
t.arguments = ['mdrun']
t.post_exec = []
t.cpu_reqs = {
'processes': 1,
'process_type': None,
'threads_per_process': 4,
'thread_type': 'OpenMP'
}
t.gpu_reqs = {
'processes': 1,
'process_type': None,
'threads_per_process': 1,#4
'thread_type': 'CUDA'
}
self.s.add_tasks(t)
self.p.add_stages(self.s)
def run(self):
self.am.workflow = [self.p]
self.am.run()
if __name__ == "__main__":
benchmark = BENCHMARK()
n_nodes = 1
benchmark.set_resource(res_desc = {
'resource': 'ornl.summit',
'queue' : 'batch',
'walltime': 1440, #MIN
'cpus' : 168 * n_nodes,
'gpus' : 6 * n_nodes,
'project' : 'MED110'
})
benchmark.sim(task_count=6)
benchmark.run()