-
Notifications
You must be signed in to change notification settings - Fork 4
/
tellme.py
49 lines (38 loc) · 1.32 KB
/
tellme.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
from __future__ import print_function
import multiprocessing as mp
import subprocess
from multiprocessing import Pool
import time
import sys
def win_get_core():
try:
import winappdbg
return int(winappdbg.win32.kernel32.GetCurrentProcessorNumber())
except:
return 0
print('CPU COUNT', mp.cpu_count())
print("main process initializing", mp.current_process())
print('main process on CPU', win_get_core())
from subprocess import Popen
import os
print('starting p1')
p2 = Popen(['start', '/affinity', '0x1', '/b', '/wait', '/realtime', sys.executable, 'whatcore.py'], shell=True)
p2.wait()
print('p1', p2.returncode)
print('starting p2')
p2 = Popen(['start', '/affinity', '0xe', '/b', '/wait', '/realtime', sys.executable, 'whatcore.py'], shell=True)
p2.wait()
print('p2', p2.returncode)
print('starting p2')
p2 = Popen(['start', '/affinity', '0xc', '/b', '/wait', '/realtime', sys.executable, 'whatcore.py'], shell=True)
p2.wait()
print('p2', p2.returncode)
print('starting p2')
p2 = Popen(['start', '/affinity', '0xd', '/b', '/wait', '/realtime', sys.executable, 'whatcore.py'], shell=True)
p2.wait()
print('p2', p2.returncode)
print('starting p2')
p2 = Popen(['start', '/affinity', '0x1', '/b', '/wait', '/realtime', sys.executable, 'whatcore.py'], shell=True)
p2.wait()
print('p2', p2.returncode)
print('done')