Skip to content

Commit 6dc5ddf

Browse files
committed
Added a python script to generate CPU masks for SLURM, etc
1 parent 17707f9 commit 6dc5ddf

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

scripts/gen_mask.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
3+
#Provide a comma-separated list of CPUs
4+
#Output: binary and hex masks corresponding to the list
5+
lst=sys.argv[1].split(',')
6+
print(lst)
7+
8+
val=0
9+
for v in lst:
10+
val = val | (1<<int(v))
11+
12+
print(bin(val))
13+
print(hex(val))

0 commit comments

Comments
 (0)