@@ -141,34 +141,6 @@ export RFM_PREFIX=$PWD/reframe_runs
141141echo " Configured reframe with the following environment variables:"
142142env | grep " RFM_"
143143
144- # Inject correct CPU/memory properties into the ReFrame config file
145- echo " Collecting system-specific input for the ReFrame configuration file"
146- cpuinfo=$( lscpu)
147- if [[ " ${cpuinfo} " =~ CPU\( s\) :[^0-9]* ([0-9]+) ]]; then
148- cpu_count=${BASH_REMATCH[1]}
149- echo " Detected CPU count: ${cpu_count} "
150- else
151- fatal_error " Failed to get the number of CPUs for the current test hardware with lscpu."
152- fi
153- if [[ " ${cpuinfo} " =~ Socket\( s\) :[^0-9]* ([0-9]+) ]]; then
154- socket_count=${BASH_REMATCH[1]}
155- echo " Detected socket count: ${socket_count} "
156- else
157- fatal_error " Failed to get the number of sockets for the current test hardware with lscpu."
158- fi
159- if [[ " ${cpuinfo} " =~ (Thread\( s\) per core:[^0-9]* ([0-9]+)) ]]; then
160- threads_per_core=${BASH_REMATCH[2]}
161- echo " Detected threads per core: ${threads_per_core} "
162- else
163- fatal_error " Failed to get the number of threads per core for the current test hardware with lscpu."
164- fi
165- if [[ " ${cpuinfo} " =~ (Core\( s\) per socket:[^0-9]* ([0-9]+)) ]]; then
166- cores_per_socket=${BASH_REMATCH[2]}
167- echo " Detected cores per socket: ${cores_per_socket} "
168- else
169- fatal_error " Failed to get the number of cores per socket for the current test hardware with lscpu."
170- fi
171-
172144# The /sys inside the container is not the same as the /sys of the host
173145# We want to extract the memory limit from the cgroup on the host (which is typically set by SLURM).
174146# Thus, bot/test.sh bind-mounts the host's /sys/fs/cgroup into /hostsys/fs/cgroup
@@ -201,13 +173,13 @@ else
201173fi
202174echo " Detected available memory: ${cgroup_mem_mib} MiB"
203175
204- echo " Replacing detected system information in template ReFrame config file..."
205176cp ${RFM_CONFIG_FILE_TEMPLATE} ${RFM_CONFIG_FILES}
206- sed -i " s/__NUM_CPUS__/${cpu_count} /g" $RFM_CONFIG_FILES
207- sed -i " s/__NUM_SOCKETS__/${socket_count} /g" $RFM_CONFIG_FILES
208- sed -i " s/__NUM_CPUS_PER_CORE__/${threads_per_core} /g" $RFM_CONFIG_FILES
209- sed -i " s/__NUM_CPUS_PER_SOCKET__/${cores_per_socket} /g" $RFM_CONFIG_FILES
177+ echo " Replacing memory limit in the ReFrame config file with the detected CGROUP memory limit: ${cgroup_mem_mib} MiB"
210178sed -i " s/__MEM_PER_NODE__/${cgroup_mem_mib} /g" $RFM_CONFIG_FILES
179+ RFM_PARTITION=" ${SLURM_JOB_PARTITION} "
180+ echo " Replacing partition name in the template ReFrame config file: ${RFM_PARTITION} "
181+ sed -i " s/__RFM_PARTITION__/${RFM_PARTITION} /g" $RFM_CONFIG_FILES
182+
211183# Make debugging easier by printing the final config file:
212184echo " Final config file (after replacements):"
213185cat " ${RFM_CONFIG_FILES} "
0 commit comments