-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.py
More file actions
35 lines (29 loc) · 777 Bytes
/
test.py
File metadata and controls
35 lines (29 loc) · 777 Bytes
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
from multiprocessing import Process, Semaphore
from od.misc.interest import InterestConfig
import multiprocessing
from od.network.types import ResourceAllocatorType
import single
def Worker(s, target, *args):
target(*args)
s.release()
def main():
s = multiprocessing.Semaphore(0)
p = []
for i in range(20):
p.append(
Process(
target=Worker,
args=(
s,
single.main,
InterestConfig(True, ResourceAllocatorType.NOMA_OPT, True, 1.4, i)
)
)
)
p[-1].start()
for _p in p:
s.acquire()
_p.join()
if __name__ == "__main__":
multiprocessing.set_start_method("forkserver")
main()