From e1b7afc25184d8ae136b0b04b5ceedfc2a915cb2 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Fri, 21 Feb 2020 18:40:38 +0300 Subject: [PATCH] LU-13283 tests: add racer to nonmpi load Patch adds the ability to run racer as one of nonmpi loads. All racer parameters can be set over RACERP: Example: RACERP="MDSCOUNT=3 DURATION=600 RACER_ENABLE_STRIPED_DIRS=false" etc. ha_start_mpi_loads() is improved to not create machinefiles if no mpi load set. Test-Parameters: trivial Cray-bug-id: LUS-8297 Signed-off-by: Elena Gryaznova Reviewed-by: Alexander Boyko Reviewed-by: Vladimir Saveliev Change-Id: I974838ce199897284396ef53d1a487d1a1ae1774 Reviewed-on: https://review.whamcloud.com/37671 Reviewed-by: Vladimir Saveliev Reviewed-by: Alexandr Boyko Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/ha.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/lustre/tests/ha.sh b/lustre/tests/ha.sh index 370e1d7..05a9087 100755 --- a/lustre/tests/ha.sh +++ b/lustre/tests/ha.sh @@ -220,6 +220,8 @@ declare ha_mpirun_options=${MPIRUN_OPTIONS:-""} declare ha_clients_stripe=${CLIENTSSTRIPE:-'"$STRIPEPARAMS"'} declare ha_nclientsset=${NCLIENTSSET:-1} +declare ha_racer_params=${RACERP:-"MDSCOUNT=1"} + eval ha_params_ior=($ha_ior_params) eval ha_params_simul=($ha_simul_params) eval ha_params_mdtest=($ha_mdtest_params) @@ -236,12 +238,15 @@ declare -A ha_mpi_load_cmds=( [mdtest]="$MDTEST {params} -d {}" ) +declare racer=${RACER:-"$(dirname $0)/racer/racer.sh"} + declare ha_nonmpi_loads=${ha_nonmpi_loads="dd tar iozone"} declare -a ha_nonmpi_load_tags=($ha_nonmpi_loads) -declare -a ha_nonmpi_load_cmds=( - "dd if=/dev/zero of={}/f.dd bs=1M count=256" - "tar cf - /etc | tar xf - -C {}" - "iozone -a -e -+d -s $iozone_SIZE {}/f.iozone" +declare -A ha_nonmpi_load_cmds=( + [dd]="dd if=/dev/zero of={}/f.dd bs=1M count=256" + [tar]="tar cf - /etc | tar xf - -C {}" + [iozone]="iozone -a -e -+d -s $iozone_SIZE {}/f.iozone" + [racer]="$ha_racer_params $racer {}" ) ha_usage() @@ -474,6 +479,19 @@ ha_start_mpi_loads() local m local -a mach + # ha_mpi_instances defines the number of + # clients start mpi loads; should be <= ${#ha_clients[@]} + # do nothing if + # ha_mpi_instances = 0 + # or + # ${#ha_mpi_load_tags[@]} =0 + local inst=$ha_mpi_instances + (( inst == 0 )) || (( ${#ha_mpi_load_tags[@]} == 0 )) && + ha_info "no mpi load to start" && + return 0 + + (( inst <= ${#ha_clients[@]} )) || inst=${#ha_clients[@]} + # Define names for machinefiles for each client set for (( n=0; n < $ha_nclientsset; n++ )); do mach[$n]=$ha_machine_file$n @@ -491,11 +509,6 @@ ha_start_mpi_loads() scp $ha_machine_file* $client:$dirname done - # ha_mpi_instances defines the number of - # clients start mpi loads; should be <= ${#ha_clients[@]} - local inst=$ha_mpi_instances - (( inst <= ${#ha_clients[@]} )) || inst=${#ha_clients[@]} - for ((n = 0; n < $inst; n++)); do client=${ha_clients[n]} for ((load = 0; load < ${#ha_mpi_load_tags[@]}; load++)); do @@ -524,7 +537,7 @@ ha_repeat_nonmpi_load() local load=$2 local status=$3 local tag=${ha_nonmpi_load_tags[$load]} - local cmd=${ha_nonmpi_load_cmds[$load]} + local cmd=${ha_nonmpi_load_cmds[$tag]} local dir=$ha_test_dir/$client-$tag local log=$ha_tmp_dir/$client-$tag local rc=0 -- 1.8.3.1