- local load=$1
- local status=$2
- local tag=${ha_mpi_load_tags[$load]}
- local cmd=${ha_mpi_load_cmds[$load]}
- local dir=$ha_test_dir/$tag
- local log=$ha_tmp_dir/$tag
- local rc=0
- local nr_loops=0
- local start_time=$(date +%s)
-
- cmd=${cmd//"{}"/$dir}
-
- ha_info "Starting $tag"
-
- while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
- {
- ha_on ${ha_clients[0]} mkdir -p "$dir" && \
- mpirun -np ${#ha_clients[@]} -machinefile "$ha_machine_file" \
- $cmd && \
- ha_on ${ha_clients[0]} rm -rf "$dir"
- } >>"$log" 2>&1 || rc=$?
-
- if ((rc != 0)); then
- ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
- touch "$ha_fail_file"
- touch "$ha_stop_file"
- fi
- echo $rc >"$status"
-
- nr_loops=$((nr_loops + 1))
- done
-
- avg_loop_time=$((($(date +%s) - start_time) / nr_loops))
-
- ha_info "$tag stopped: rc $rc avg loop time $avg_loop_time"
+ local client=$1
+ local load=$2
+ local status=$3
+ local parameter=$4
+ local tag=${ha_mpi_load_tags[$load]}
+ local cmd=${ha_mpi_load_cmds[$tag]}
+ local dir=$ha_test_dir/$client-$tag
+ local log=$ha_tmp_dir/$client-$tag
+ local rc=0
+ local nr_loops=0
+ local start_time=$(date +%s)
+
+ cmd=${cmd//"{}"/$dir}
+ cmd=${cmd//"{params}"/$parameter}
+
+ ha_info "Starting $tag"
+
+ local machines="-machinefile $ha_machine_file"
+ while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
+ {
+ local mdt_index
+ if $ha_mdt_index_random && [ $ha_mdt_index -ne 0 ]; then
+ mdt_index=$(ha_rand $ha_mdt_index)
+ else
+ mdt_index=$ha_mdt_index
+ fi
+ ha_on $client $LFS mkdir -i$mdt_index -c$ha_dir_stripe_count "$dir" &&
+ ha_on $client $LFS getdirstripe "$dir" &&
+ ha_on $client chmod a+xwr $dir &&
+ ha_on $client "su mpiuser sh -c \" $mpirun $ha_mpirun_options \
+ -np $((${#ha_clients[@]} * mpi_threads_per_client )) \
+ $machines $cmd \" " &&
+ ha_on $client rm -rf "$dir";
+ } >>"$log" 2>&1 || rc=$?
+
+ ha_info rc=$rc
+
+ if ((rc != 0)); then
+ touch "$ha_fail_file"
+ touch "$ha_stop_file"
+ ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
+ fi
+ echo $rc >"$status"
+
+ nr_loops=$((nr_loops + 1))
+ done
+
+ avg_loop_time=$((($(date +%s) - start_time) / nr_loops))
+
+ ha_info "$tag stopped: rc $rc avg loop time $avg_loop_time"