@@ -128,15 +128,10 @@ def post_ready_hook(self, *args, **kwargs):
128
128
Post-ready hook: limit parallellism for selected builds based on software name and CPU target.
129
129
parallelism needs to be limited because some builds require a lot of memory per used core.
130
130
"""
131
- # 'parallel' (EB4) or 'max_parallel' (EB5) easyconfig parameter is set via EasyBlock.set_parallel in ready step
132
- # based on available cores.
133
-
134
- # Check whether we have EasyBuild 4 or 5
135
- parallel_param = 'parallel'
136
- if EASYBUILD_VERSION >= '5' :
137
- parallel_param = 'max_parallel'
138
- # get current parallelism setting
139
- parallel = self .cfg [parallel_param ]
131
+ # 'parallel' easyconfig parameter (EB4) or the parallel property (EB5) is set via EasyBlock.set_parallel
132
+ # in ready step based on available cores
133
+ parallel = getattr (self , 'parallel' , self .cfg ['parallel' ])
134
+
140
135
if parallel == 1 :
141
136
return # no need to limit if already using 1 core
142
137
@@ -167,7 +162,10 @@ def post_ready_hook(self, *args, **kwargs):
167
162
168
163
# apply the limit if it's different from current
169
164
if new_parallel != parallel :
170
- self .cfg [parallel_param ] = new_parallel
165
+ if EASYBUILD_VERSION >= '5' :
166
+ self .cfg .parallel = new_parallel
167
+ else :
168
+ self .cfg ['parallel' ] = new_parallel
171
169
msg = "limiting parallelism to %s (was %s) for %s on %s to avoid out-of-memory failures during building/testing"
172
170
print_msg (msg % (new_parallel , parallel , self .name , cpu_target ), log = self .log )
173
171
0 commit comments