9
9
import operator
10
10
import os
11
11
import sys
12
+ from contextlib import redirect_stdout
12
13
from hashlib import sha1
13
14
14
15
import jinja2
15
16
import signac
16
17
from define_template_test_project import TestProject
17
- from test_project import redirect_stdout
18
18
19
19
import flow
20
20
import flow .environments
28
28
PROJECT_DIRECTORY = '/home/user/path with spaces and "quotes" and \\ backslashes/'
29
29
MOCK_EXECUTABLE = "/usr/local/bin/python"
30
30
DEFAULT_BUNDLES = [
31
- ("omp_op" , "parallel_op" ),
32
- ("mpi_op" , "op" , "memory_op" ),
33
- ("hybrid_op" , "omp_op" ),
31
+ { "bundles" : [ ("omp_op" , "parallel_op" )], "parallel" : [ True , False ]} ,
32
+ { "bundles" : [ ("mpi_op" , "op" , "memory_op" )], "parallel" : [ False ]} ,
33
+ { "bundles" : [ ("hybrid_op" , "omp_op" )], "parallel" : [ False ]} ,
34
34
]
35
- DEFAULT_SETTING = {"bundles" : DEFAULT_BUNDLES , "parallel" : [True , False ]}
35
+
36
+
37
+ def set_bundles (partitions = None ):
38
+ if partitions is None :
39
+ return DEFAULT_BUNDLES
40
+ return [{"partition" : partitions , ** bundle } for bundle in DEFAULT_BUNDLES ]
36
41
37
42
38
43
def cartesian (** kwargs ):
@@ -71,45 +76,37 @@ def init(project):
71
76
environments = {
72
77
"environment.StandardEnvironment" : [],
73
78
"environments.xsede.Bridges2Environment" : [
74
- {
75
- "partition" : ["RM" , "RM-shared" , "GPU" , "GPU-shared" ],
76
- },
77
- {"partition" : ["RM" ], ** DEFAULT_SETTING },
79
+ {"partition" : ["RM" , "RM-shared" , "GPU" , "GPU-shared" ]},
80
+ * set_bundles (["RM" ]),
78
81
],
79
82
"environments.umich.GreatLakesEnvironment" : [
80
- {
81
- "partition" : ["standard" , "gpu" , "gpu_mig40" ],
82
- },
83
- DEFAULT_SETTING ,
83
+ {"partition" : ["standard" , "gpu" , "gpu_mig40" ]},
84
+ * set_bundles (),
84
85
],
85
- "environments.incite.SummitEnvironment" : [{}, DEFAULT_SETTING ],
86
+ "environments.incite.SummitEnvironment" : [{}, * set_bundles () ],
86
87
"environments.incite.AndesEnvironment" : [
87
88
{"partition" : ["batch" , "gpu" ]},
88
- { "partition" : ["batch" ], ** DEFAULT_SETTING } ,
89
+ * set_bundles ( ["batch" ]) ,
89
90
],
90
- "environments.umn.MangiEnvironment" : [{}, DEFAULT_SETTING ],
91
+ "environments.umn.MangiEnvironment" : [{}, * set_bundles () ],
91
92
"environments.xsede.ExpanseEnvironment" : [
92
93
{
93
94
"partition" : ["compute" , "shared" , "gpu" , "gpu-shared" , "large-shared" ],
94
95
},
95
- { "partition" : ["compute" ], ** DEFAULT_SETTING } ,
96
+ * set_bundles ( ["compute" ]) ,
96
97
],
97
98
"environments.drexel.PicotteEnvironment" : [
98
- {
99
- "partition" : ["def" , "gpu" ],
100
- },
101
- {"partition" : ["def" ], ** DEFAULT_SETTING },
99
+ {"partition" : ["def" , "gpu" ]},
100
+ * set_bundles (["def" ]),
102
101
],
103
102
"environments.xsede.DeltaEnvironment" : [
104
- {
105
- "partition" : ["cpu" , "gpuA40x4" , "gpuA100x4" ],
106
- },
107
- {"partition" : ["cpu" ], ** DEFAULT_SETTING },
103
+ {"partition" : ["cpu" , "gpuA40x4" , "gpuA100x4" ]},
104
+ * set_bundles (["cpu" ]),
108
105
],
109
- "environments.incite.CrusherEnvironment" : [{}, DEFAULT_SETTING ],
106
+ "environments.incite.CrusherEnvironment" : [{}, * set_bundles () ],
110
107
# Frontier cannot use partitions as logic requires gpu
111
108
# in the name of partitions that are gpu nodes.
112
- "environments.incite.FrontierEnvironment" : [{}, DEFAULT_SETTING ],
109
+ "environments.incite.FrontierEnvironment" : [{}, * set_bundles () ],
113
110
"environments.purdue.AnvilEnvironment" : [
114
111
{
115
112
"partition" : [
@@ -122,7 +119,7 @@ def init(project):
122
119
"gpu" ,
123
120
],
124
121
},
125
- { "partition" : ["wholenode" ], ** DEFAULT_SETTING } ,
122
+ * set_bundles ( ["wholenode" ]) ,
126
123
],
127
124
}
128
125
0 commit comments