@@ -143,6 +143,8 @@ def post_ready_hook(self, *args, **kwargs):
143
143
# get CPU target
144
144
cpu_target = get_eessi_envvar ('EESSI_SOFTWARE_SUBDIR' )
145
145
146
+ new_parallel = parallel
147
+
146
148
# check if we have limits defined for this software
147
149
if self .name in PARALLELISM_LIMITS :
148
150
limits = PARALLELISM_LIMITS [self .name ]
@@ -158,11 +160,16 @@ def post_ready_hook(self, *args, **kwargs):
158
160
else :
159
161
return # no applicable limits found
160
162
161
- # apply the limit if it's different from current
162
- if new_parallel != parallel :
163
- self .cfg [parallel_param ] = new_parallel
164
- msg = "limiting parallelism to %s (was %s) for %s on %s to avoid out-of-memory failures during building/testing"
165
- print_msg (msg % (new_parallel , parallel , self .name , cpu_target ), log = self .log )
163
+ # check if there's a general limit set for CPU target
164
+ elif cpu_target in PARALLELISM_LIMITS :
165
+ operation_func , operation_args = PARALLELISM_LIMITS [cpu_target ]
166
+ new_parallel = operation_func (parallel , operation_args )
167
+
168
+ # apply the limit if it's different from current
169
+ if new_parallel != parallel :
170
+ self .cfg [parallel_param ] = new_parallel
171
+ msg = "limiting parallelism to %s (was %s) for %s on %s to avoid out-of-memory failures during building/testing"
172
+ print_msg (msg % (new_parallel , parallel , self .name , cpu_target ), log = self .log )
166
173
167
174
168
175
def pre_prepare_hook (self , * args , ** kwargs ):
@@ -1376,27 +1383,22 @@ def set_maximum(parallel, max_value):
1376
1383
# specific CPU target is defined in the data structure below. If not, it checks for
1377
1384
# the generic '*' entry.
1378
1385
PARALLELISM_LIMITS = {
1386
+ # by default, only use quarter of cores when building for A64FX;
1387
+ # this is done because total memory is typically limited on A64FX due to HBM,
1388
+ # Deucalion has 32GB HBM for 48 cores per node
1389
+ CPU_TARGET_A64FX : (divide_by_factor , 4 ),
1390
+ # software-specific limits
1379
1391
'libxc' : {
1380
1392
'*' : (divide_by_factor , 2 ),
1381
- CPU_TARGET_A64FX : (set_maximum , 12 ),
1382
- },
1383
- 'nodejs' : {
1384
- CPU_TARGET_A64FX : (divide_by_factor , 2 ),
1385
1393
},
1386
1394
'MBX' : {
1387
1395
'*' : (divide_by_factor , 2 ),
1388
1396
},
1389
- 'PyTorch' : {
1390
- CPU_TARGET_A64FX : (divide_by_factor , 4 ),
1391
- },
1392
1397
'TensorFlow' : {
1393
1398
'*' : (divide_by_factor , 2 ),
1394
1399
CPU_TARGET_A64FX : (set_maximum , 8 ),
1395
1400
},
1396
1401
'Qt5' : {
1397
1402
CPU_TARGET_A64FX : (set_maximum , 8 ),
1398
1403
},
1399
- 'ROOT' : {
1400
- CPU_TARGET_A64FX : (divide_by_factor , 2 ),
1401
- },
1402
1404
}
0 commit comments