-
Notifications
You must be signed in to change notification settings - Fork 0
/
assign_combischeme_to_groups.py
executable file
·54 lines (44 loc) · 1.36 KB
/
assign_combischeme_to_groups.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
#!/usr/bin/env python3
import argparse
try:
from icecream import ic
ic("test ic")
except:
def ic(*args):
pass
import combischeme_utils
import combischeme_output
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"file_name",
type=str
)
parser.add_argument(
"--num_groups",
type=int,
default=64,
)
parser.add_argument(
"--first_group_offset",
type=int,
default=0,
)
args = parser.parse_args()
filename = args.file_name
num_process_groups = args.num_groups
first_group_offset = args.first_group_offset
ic(filename, num_process_groups)
scheme = combischeme_utils.CombinationSchemeFromFile(
filename, boundary_points=1)
dim = scheme.get_dimensionality()
lmax = scheme.get_lmax()
ic(dim, lmax)
totalNumPointsCombi = scheme.get_total_num_points_combi()
ic(scheme.get_num_grids_per_level_sum())
ic(totalNumPointsCombi, totalNumPointsCombi/1e13,
combischeme_output.readable_bytes(totalNumPointsCombi*8))
assignment, assigned_FG_size = combischeme_utils.assign_combischeme_to_groups(
scheme, num_process_groups, first_group_offset)
combischeme_output.write_assignment_to_json(
assignment, filename[:-5]+"_"+format(num_process_groups, '05d')+"groups.json")