-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheterogeneous.py
More file actions
executable file
·49 lines (41 loc) · 1.61 KB
/
heterogeneous.py
File metadata and controls
executable file
·49 lines (41 loc) · 1.61 KB
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
#!/usr/bin/env python
import os
from random import randint, choice
import radical.pilot as rp
# ------------------------------------------------------------------------------
#
if __name__ == '__main__':
session = rp.Session()
try:
pmgr = rp.PilotManager(session=session)
pd_init = {'resource' : 'xsede.stampede2_srun',
'queue' : 'normal',
'project' : 'TG-MCB090174',
'queue' : 'development',
'access_schema' : 'gsissh',
'runtime' : 60,
'exit_on_error' : True,
'cores' : 68
}
pdesc = rp.ComputePilotDescription(pd_init)
pilot = pmgr.submit_pilots(pdesc)
umgr = rp.UnitManager(session=session)
umgr.add_pilots(pilot)
cuds = list()
for i in range(512):
cud = rp.ComputeUnitDescription()
cud.executable = '/home1/02855/mturilli/bin/hello_rp.sh'
cud.arguments = [randint(5, 10) * 1]
cud.cpu_threads = randint(1, 8)
cud.cpu_processes = randint(1, 8) # * 10
# cud.gpu_processes = choice([0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4])
# cud.gpu_process_type = rp.POSIX # rp.MPI
cud.cpu_process_type = rp.MPI # rp.POSIX # rp.MPI
cud.cpu_thread_type = rp.POSIX
cuds.append(cud)
umgr.submit_units(cuds)
umgr.wait_units()
session.close(download=True)
except:
session.close(download=False)
raise