Skip to content

Instantly share code, notes, and snippets.

@shahrzad
Last active March 25, 2021 15:42
Show Gist options
  • Save shahrzad/9cde6007f28de58dd7c298bdf0fd8de9 to your computer and use it in GitHub Desktop.
Save shahrzad/9cde6007f28de58dd7c298bdf0fd8de9 to your computer and use it in GitHub Desktop.
#!/bin/bash
module load gcc
module load boost
if [ $# -ne 1 ]
then
echo "node is not specified, marvin will be used by default"
node="marvin"
else
node=$1
echo "Running on ${node}"
fi
source_dir="$HOME/src/"
install_dir="$HOME/lib/"
results_dir="$HOME/results"
hpx_build_dir="${source_dir}/hpx/build_release_gcc_${node}"
hpx_log_dir="${hpx_build_dir}/info/"
thr=(1 2 3 4 5 6 7 8)
grid_points=(1000000)
rm -rf ${results_dir}/*.dat
rm -rf ${results_dir}/info_${node}/
mkdir -p ${results_dir}/info_${node}/hpx_info
date>> ${results_dir}/info_${node}/date.txt
cp -r $hpx_log_dir/* ${results_dir}/info_$node/hpx_info
for gp in ${grid_points[@]}
do
echo " ${gp} grid points"
for nx in $(seq 2 $gp)
do
if [ $((gp%nx)) -eq 0 ]
then
echo " partition size ${nx}"
np=$((gp/nx))
echo " number of partitions ${np}"
for th in ${thr[@]}
do
echo "${th} threads"
export OMP_NUM_THREADS=1
${hpx_build_dir}/bin/1d_stencil_4_parallel --np=${np} --nx=${nx} --hpx:threads=${th}>>${results_dir}/${node}_stencil_${th}_${nx}_${np}.dat
echo "Run for ${np} points per partiton, ${nx} partitions, on ${th} threads finished"
done
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment