Automating SPEC CPU2006 Execution with GitHub Actions (7. Running GitHub Actions in Parallel)

I had been running the SIFT generation sequentially, but now that the problems with SIFT generation have been fixed, I'd like to go back to parallel execution.

I'll change the settings to match the SIFT generation options. In particular, response_files is no longer used.

# Before
"${QEMU}" ${QEMU_FLAGS} -plugin "${QEMU_FRONTEND_PLUGIN}",verbose=on,response_files=on,fast_forward_target=${fast_forward_target},detailed_target=${detailed_target},output_file="${output_base}" ${cmd_suffix_noL}

# After
"${QEMU}" ${QEMU_FLAGS} -plugin "${QEMU_FRONTEND_PLUGIN}",verbose=on,response_files=off,fast_forward_target=${fast_forward_target},detailed_target=${detailed_target},output_file="${output_base}" ${cmd_suffix_noL}

In run_sift_benchmark.sh, a SIFT generation script is generated for each SimPoint and they are run in parallel with the parallel command.

# Execute all generated script files in parallel
if [ -f "$all_script_list_file" ] && [ -s "$all_script_list_file" ]; then
  num_scripts=$(wc -l < "$all_script_list_file")
  echo "=== Executing $num_scripts scripts in parallel ==="
  cat "$all_script_list_file" | \
  SHELL=/bin/bash parallel --line-buffer -j ${PARALLEL_JOBS} bash '{}' 2>&1 || {
    echo "Warning: Some scripts failed. Check logs in ${sift_dir_abs}" >&2;
  };
  rm -f "$all_script_list_file"
fi

The number of parallel jobs is controlled by the environment variable PARALLEL_JOBS, which defaults to the number of CPUs. To account for file handle limits, it is capped at 8 jobs.


This is an English translation of the original Japanese post: GitHub ActionsでSPEC CPU2006の実行を自動化する (7. GitHub Actionsを並列実行)