@@ -17,14 +17,22 @@ class Laghos(
1717 MpiOnlyExperiment ,
1818 CudaExperiment ,
1919 ROCmExperiment ,
20- Scaling (ScalingMode .Strong ),
20+ Scaling (ScalingMode .Strong , ScalingMode . Weak , ScalingMode . Throughput ),
2121 Caliper ,
2222):
2323
2424 variant (
2525 "workload" ,
26- default = "triplept" ,
27- description = "triplept or other problem" ,
26+ default = "sedov" ,
27+ values = ("sedov" , "triplept" ),
28+ description = "problem type" ,
29+ )
30+
31+ variant (
32+ "order" ,
33+ default = "linear" ,
34+ values = ("linear" , "quadratic" , "cubic" ),
35+ description = "solution order" ,
2836 )
2937
3038 variant (
@@ -40,38 +48,172 @@ class Laghos(
4048 description = "Use GPU-aware MPI" ,
4149 )
4250
51+ variant (
52+ "nc" ,
53+ default = False ,
54+ values = (True , False ),
55+ description = "nonconforming or conforming" ,
56+ )
57+
4358 maintainers ("wdhawkins" )
4459
45- def compute_applications_section (self ):
46- # "zones" defined from mesh file, we are hardcoding it here
47- self .add_experiment_variable ("nx" , 2 , True )
48- self .add_experiment_variable ("ny" , 2 , True )
49- self .add_experiment_variable ("nz" , 2 , True )
50- self .add_experiment_variable ("tf" , 0.0033 , True )
51- self .add_experiment_variable ("zones" , 1024 , True )
60+ def generate_perf_specs (self ):
61+ problem_spec = {
62+ "nx" : 1 ,
63+ "ny" : 1 ,
64+ "nz" : 1 ,
65+ "pool_size" : 16 ,
66+ "ms" : 250 ,
67+ "tf" : 10000 ,
68+ "resource_count" : 4 ,
69+ "strong" : None ,
70+ "weak" : None ,
71+ "throughput" : None ,
72+ }
73+ # Add problem specs as needed here
74+ if self .spec .satisfies ("+throughput" ):
75+ if self .spec .satisfies ("order=linear" ):
76+ problem_spec ["rs" ] = [4 , 4 , 4 ]
77+ problem_spec ["rp" ] = [2 , 3 , 4 ]
78+ elif self .spec .satisfies ("order=quadratic" ):
79+ problem_spec ["rs" ] = [4 , 4 , 4 ]
80+ problem_spec ["rp" ] = [1 , 2 , 3 ]
81+ elif self .spec .satisfies ("order=cubic" ):
82+ problem_spec ["rs" ] = [4 , 4 , 4 ]
83+ problem_spec ["rp" ] = [1 , 2 , 3 ]
84+ elif self .spec .satisfies ("+strong" ):
85+ problem_spec ["strong" ] = (
86+ lambda var , itr , dim , scaling_factor : var .val (dim ) * scaling_factor
87+ )
88+ if self .spec .satisfies ("order=linear" ):
89+ problem_spec ["rs" ] = 4
90+ problem_spec ["rp" ] = 3
91+ elif self .spec .satisfies ("order=quadratic" ):
92+ problem_spec ["rs" ] = 4
93+ problem_spec ["rp" ] = 2
94+ elif self .spec .satisfies ("order=cubic" ):
95+ problem_spec ["rs" ] = 4
96+ problem_spec ["rp" ] = 1
97+ elif self .spec .satisfies ("+weak" ):
98+ problem_spec ["nx" ] = [1 , 2 , 3 , 4 , 5 , 6 ]
99+ problem_spec ["ny" ] = [1 , 2 , 3 , 4 , 5 , 6 ]
100+ problem_spec ["nz" ] = [1 , 2 , 3 , 4 , 5 , 6 ]
101+ problem_spec ["resource_count" ] = [4 , 32 , 108 , 256 , 500 , 864 ]
102+ if self .spec .satisfies ("order=linear" ):
103+ problem_spec ["rs" ] = 4
104+ problem_spec ["rp" ] = 3
105+ elif self .spec .satisfies ("order=quadratic" ):
106+ problem_spec ["rs" ] = 4
107+ problem_spec ["rp" ] = 2
108+ elif self .spec .satisfies ("order=cubic" ):
109+ problem_spec ["rs" ] = 4
110+ problem_spec ["rp" ] = 1
111+ else :
112+ problem_spec ["rs" ] = 4
113+ problem_spec ["rp" ] = 1
52114
53- # resource_count is the number of resources used for this experiment:
54- self .add_experiment_variable ("resource_count" , 1 , False )
115+ self .add_experiment_variable ("nx" , problem_spec ["nx" ], True )
116+ self .add_experiment_variable ("ny" , problem_spec ["ny" ], True )
117+ self .add_experiment_variable ("nz" , problem_spec ["nz" ], True )
118+ self .add_experiment_variable ("rs" , problem_spec ["rs" ], True )
119+ self .add_experiment_variable ("rp" , problem_spec ["rp" ], True )
120+ self .add_experiment_variable ("ms" , problem_spec ["ms" ], True )
121+ self .add_experiment_variable ("tf" , problem_spec ["tf" ], True )
55122
56- # Set the variables required by the experiment
57- self .set_required_variables (
58- n_resources = "{resource_count}" ,
59- process_problem_size = "{zones} / {n_resources}" ,
60- total_problem_size = "{zones}" ,
123+ self .add_experiment_variable (
124+ "resource_count" , problem_spec ["resource_count" ], True
61125 )
62126
63- # Register the scaling variables and their respective scaling functions
64- # required to correctly scale the experiment for the given scaliing policy
65- # Strong scaling scales up resource_count by the specified scaling_factor
127+ # Per-process size (in zones) in each dimension
128+ self .add_experiment_variable ("zones" , "{nx}*{ny}*{nz}*(8**({rs}+{rp}))" , False )
129+
130+ # Umpire device pool size
131+ self .add_experiment_variable ("pool" , problem_spec ["pool_size" ], False )
132+
66133 self .register_scaling_config (
67134 {
68135 ScalingMode .Strong : {
69- "resource_count" : lambda var , itr , dim , scaling_factor : var .val (dim )
70- * scaling_factor ,
136+ "resource_count" : problem_spec ["strong" ],
137+ },
138+ ScalingMode .Weak : {
139+ "resource_count" : problem_spec ["weak" ],
140+ },
141+ ScalingMode .Throughput : {
142+ "resource_count" : problem_spec ["throughput" ],
71143 },
72144 }
73145 )
74146
147+ def compute_applications_section (self ):
148+ if self .spec .satisfies ("exec_mode=perf" ):
149+ self .generate_perf_specs ()
150+ else :
151+ # "zones" defined from mesh file, we are hardcoding it here
152+ self .add_experiment_variable ("nx" , 1 , True )
153+ self .add_experiment_variable ("ny" , 1 , True )
154+ self .add_experiment_variable ("nz" , 1 , True )
155+ self .add_experiment_variable ("rs" , 3 , True )
156+ self .add_experiment_variable ("rp" , 2 , True )
157+ self .add_experiment_variable ("ms" , 250 , True )
158+ self .add_experiment_variable ("tf" , 10000 , True )
159+ self .add_experiment_variable (
160+ "zones" , "{nx}*{ny}*{nz}*(8**({rs}+{rp}))" , False
161+ )
162+ self .add_experiment_variable ("pool" , 16 , True )
163+ # resource_count is the number of resources used for this experiment:
164+ self .add_experiment_variable ("resource_count" , 1 , False )
165+
166+ # Register the scaling variables and their respective scaling functions
167+ # required to correctly scale the experiment for the given scaliing policy
168+ # Strong scaling scales up resource_count by the specified scaling_factor
169+ self .register_scaling_config (
170+ {
171+ ScalingMode .Strong : {
172+ "resource_count" : lambda var , itr , dim , scaling_factor : var .val (
173+ dim
174+ )
175+ * scaling_factor ,
176+ },
177+ ScalingMode .Weak : {
178+ "resource_count" : None ,
179+ },
180+ ScalingMode .Throughput : {
181+ "resource_count" : None ,
182+ },
183+ }
184+ )
185+
186+ if self .spec .satisfies ("order=linear" ):
187+ self .add_experiment_variable ("order" , "linear" , True )
188+ self .add_experiment_variable ("ok" , 1 , False )
189+ self .add_experiment_variable ("ot" , 0 , False )
190+ elif self .spec .satisfies ("order=quadratic" ):
191+ self .add_experiment_variable ("order" , "quadratic" , True )
192+ self .add_experiment_variable ("ok" , 2 , False )
193+ self .add_experiment_variable ("ot" , 1 , False )
194+ elif self .spec .satisfies ("order=cubic" ):
195+ self .add_experiment_variable ("order" , "cubic" , True )
196+ self .add_experiment_variable ("ok" , 3 , False )
197+ self .add_experiment_variable ("ot" , 2 , False )
198+ else :
199+ self .add_experiment_variable ("order" , "linear" , True )
200+ self .add_experiment_variable ("ok" , 1 , False )
201+ self .add_experiment_variable ("ot" , 0 , False )
202+
203+ if self .spec .satisfies ("+nc" ):
204+ self .add_experiment_variable ("nc_type" , "nonconforming" , True )
205+ self .add_experiment_variable ("nc" , "-nc" , False )
206+ else :
207+ self .add_experiment_variable ("nc_type" , "conforming" , True )
208+ self .add_experiment_variable ("nc" , "-no-nc" , False )
209+
210+ # Set the variables required by the experiment
211+ self .set_required_variables (
212+ n_resources = "{resource_count}" ,
213+ process_problem_size = "{zones} / {n_resources}" ,
214+ total_problem_size = "{zones}" ,
215+ )
216+
75217 if self .spec .satisfies ("+cuda" ):
76218 self .add_experiment_variable ("device" , "cuda" , True )
77219 elif self .spec .satisfies ("+rocm" ):
0 commit comments