@@ -404,44 +404,55 @@ run_io_demo() {
404404}
405405
406406#
407- # Tail and parse ucx_perftest stdout to extract current throughput
408- #
409- # Requires ucx_perftest be run with "-v" to generate output in the following form:
410- # [thread 0]273598,21.660,21.940,21.930,45578.82,45599.20,45579,45599
407+ # Parse the protocol configuration info in ucx_perftest stdout to get active
408+ # devices
411409#
412- get_perftest_throughput () {
410+ parse_active_devices ()
411+ {
413412 file=$1
414- timeout_seconds=$2
415- samples=$3
416- sum=0
417- count=0
418- start_time=$( date +%s)
413+ config_cnt=$2
419414
420- tail -n 0 -F -- " $file " 2> /dev/null |
421415 while IFS= read -r line;
422416 do
423- current_time=$( date +%s)
424- elapsed_time=$(( current_time - start_time))
425-
426- if (( elapsed_time >= timeout_seconds )) ;
427- then
428- echo " 0"
429- return 0
417+ [[ $line == * " | perftest self cfg#$config_cnt " * ]] || continue
418+
419+ IFS= read -r line || return 1 # | remote memory write by ucp_put* from host memory to host |
420+ IFS= read -r line || return 1 # +--------+-------------+------------------------------------------------------------------------------+
421+ IFS= read -r line || return 1 # | Range | Description | Config |
422+ IFS= read -r line || return 1 # +--------+-------------+------------------------------------------------------------------------------+
423+ IFS= read -r line || return 1 # | 0..inf | zero-copy | 34% on rc_mlx5/mlx5_0:1, 34% on rc_mlx5/mlx5_2:1 and 32% on rc_mlx5/mlx5_1:1 |
424+ break
425+ done < " $file "
426+
427+ for word in $line ; do
428+ if [[ $word == * /* :* ]]; then
429+ device=${word#*/ }
430+ device=${device%%:* }
431+ echo " $device "
430432 fi
433+ done
434+ }
431435
432- [[ $line == \[ thread* ]] || continue
436+ #
437+ # Verify expected devices match the active device list
438+ #
439+ verify_active_devices () {
440+ file=$1
441+ config_cnt=$2
442+ expected=$3
433443
434- throughput=$( awk -F' ,' ' { print int($5) }' <<< " $line" )
444+ actual_sorted=$( parse_active_devices " $file " " $config_cnt " | sort | paste -sd' ' )
445+ expected_sorted=$( echo " $expected " | tr ' ' ' \n' | sort | paste -sd' ' )
435446
436- sum=$(( sum + throughput))
437- count=$(( count + 1 ))
447+ if [[ " $actual_sorted " != " $expected_sorted " ]];
448+ then
449+ echo " Error: configuration ${config_cnt} device mismatch"
450+ echo " expected: ${expected_sorted} "
451+ echo " actual: ${actual_sorted} "
452+ return 1
453+ fi
438454
439- if (( count == samples )) ;
440- then
441- echo $(( sum / count))
442- return 0
443- fi
444- done
455+ return 0
445456}
446457
447458#
@@ -466,38 +477,31 @@ run_ucx_perftest_fault_tolerance() {
466477
467478 echo " ==== Running UCX Perftest Fault Tolerance Test ===="
468479
469- echo " Executor Number is ${EXECUTOR_NUMBER} " || true
470-
471480 test_exe=" ${ucx_inst} /bin/ucx_perftest"
472- # Temporary location for drop tool
473481 drop_tool=" /hpc/scrap/fault_tolerance/ucx_drop_tool"
474- output_file=ucx_perftest_ft.stdout
475- samples=10
476- verify_timeout=20
482+ output_file=ucx_perftest.stdout
477483 settle_seconds=10
478- drop_ratio=95
479484 sl=$(( EXECUTOR_NUMBER + 1 ))
480- echo " Using service level ${sl} "
481485 tc=$(( EXECUTOR_NUMBER + 31 ))
482- echo " Using traffic class ${tc} "
483486 devices=$( get_active_ib_devnames)
484487 device_cnt=$( echo ${devices} | wc -w)
485488 background_pids=()
486- block_cnt =0
489+ config_cnt =0
487490 affinity=$( slice_affinity 0)
488-
489- # if [[ ! -x "${drop_tool}" ]];
490- # then
491- # echo "Error: Could not find drop tool at ${drop_tool}"
492- # return 1
493- # fi
491+ expected_devices=" ${devices} "
494492
495493 if [[ " ${devices} " == " " ]];
496494 then
497495 echo " No IB devices detected. Skipping Fault Tolerance test"
498496 return 0
499497 fi
500498
499+ if [[ ! -x " ${drop_tool} " ]];
500+ then
501+ echo " Warning: Could not find drop tool at ${drop_tool} "
502+ return 0
503+ fi
504+
501505 export UCX_IB_SL=${sl}
502506 export UCX_IB_TRAFFIC_CLASS=${tc}
503507 export UCX_ZCOPY_THRESH=0
@@ -509,90 +513,45 @@ run_ucx_perftest_fault_tolerance() {
509513 export UCX_MAX_RMA_RAILS=${device_cnt}
510514 export UCX_TLS=rc_x
511515
512- args=" -t ucp_put_bw \
516+ args=" -t ucp_put_lat \
513517 -n 1000000000000000 \
514518 -s 1048576 \
515519 -e failover \
516- -l \
517- -v"
520+ -l"
518521
519522 taskset -c ${affinity} ${test_exe} ${args} 2>&1 | tee ${output_file} &
520- perftest_pid=($! )
521- sleep 60
522- kill -9 ${perftest_pid}
523-
524- export UCX_NET_DEVICES=" mlx5_0"
525- export UCX_MAX_RMA_RAILS=1
526- taskset -c ${affinity} ${test_exe} ${args} 2>&1 | tee ${output_file} &
527- perftest_pid=($! )
528- sleep 60
529- kill -9 ${perftest_pid}
523+ background_pids+=($! )
530524
531- export UCX_NET_DEVICES=" mlx5_1"
532- export UCX_MAX_RMA_RAILS=1
533- taskset -c ${affinity} ${test_exe} ${args} 2>&1 | tee ${output_file} &
534- perftest_pid=($! )
535- sleep 60
536- kill -9 ${perftest_pid}
525+ sleep ${settle_seconds}
537526
538- if [[ ! -x " ${drop_tool} " ]] ;
527+ if ! verify_active_devices ${output_file} ${config_cnt} " ${devices} " ;
539528 then
540- echo " Error: Could not find drop tool at ${drop_tool }"
529+ kill_background_processes " ${background_pids[@] }"
541530 return 1
542531 fi
543532
544- export UCX_IB_SL=${sl}
545- export UCX_IB_TRAFFIC_CLASS=${tc}
546- export UCX_ZCOPY_THRESH=0
547- export UCX_MIN_RMA_CHUNK_SIZE=64
548- export UCX_PROTO_INFO=y
549- export UCX_RC_MLX5_RETRY_COUNT=2
550- export UCX_IB_NUM_PATHS=1
551- export UCX_NET_DEVICES=$( get_active_ib_devnames | paste -sd,)
552- export UCX_MAX_RMA_RAILS=${device_cnt}
553- export UCX_TLS=rc_x
554-
555- taskset -c ${affinity} ${test_exe} ${args} 2>&1 | tee ${output_file} &
556- background_pids+=($! )
557-
558- sleep ${settle_seconds}
559-
560- curr_tput=$( get_perftest_throughput ${output_file} ${verify_timeout} ${samples} )
561- echo " Baseline throughput: ${curr_tput} "
562- prev_tput=${curr_tput}
533+ echo " Baseline protocol configuration uses devices: ${devices} "
563534
564535 # Loop through active IB devices. Block each one in turn and verify traffic
565- # continues to flow at reduced rate.
566536 for dev in $( get_active_ib_devnames)
567537 do
568538 echo " Blocking traffic with service level ${sl} or traffic class ${tc} on device ${dev} ..."
569539 ${drop_tool} -d ${dev} -s ${sl} -t ${tc} &
570540 background_pids+=($! )
571- block_cnt =$(( block_cnt + 1 ))
541+ config_cnt =$(( config_cnt + 1 ))
572542
573543 sleep ${settle_seconds}
574544
575- threshold=$(( prev_tput * drop_ratio / 100 ))
576- curr_tput=$( get_perftest_throughput ${output_file} ${verify_timeout} ${samples} )
545+ expected_devices=$( echo " $expected_devices " | tr ' ' ' \n' | grep -vFx " $dev " | paste -sd' ' )
577546
578- if (( block_cnt < device_cnt )) ;
547+ if ! verify_active_devices ${output_file} ${config_cnt} " ${expected_devices} " ;
579548 then
580- if (( curr_tput <= 0 || curr_tput > threshold )) ;
581- then
582- echo " Error: throughput not in expected range after blocking ${dev} , tput=${curr_tput} , threshold=${threshold} "
583- kill_background_processes " ${background_pids[@]} "
584- return 1
585- fi
586- prev_tput=${curr_tput}
549+ kill_background_processes " ${background_pids[@]} "
550+ return 1
587551 fi
588- done
589552
590- if (( curr_tput != 0 )) ;
591- then
592- echo " Error: traffic still flowing when all are devices blocked!"
593- kill_background_processes " ${background_pids[@]} "
594- return 1
595- fi
553+ echo " Reconfiguration ${config_cnt} uses devices: ${expected_devices} "
554+ done
596555
597556 kill_background_processes " ${background_pids[@]} "
598557
@@ -1448,12 +1407,6 @@ run_configure_tests() {
14481407run_tests () {
14491408 export UCX_PROTO_REQUEST_RESET=y
14501409
1451- # temp debug to find drop tool binary...
1452- ls / || true
1453- ls /hpc/ || true
1454- ls /hpc/scrap/ || true
1455- ls /hpc/scrap/fault_tolerance/ || true
1456-
14571410 # all are running mpi tests
14581411 run_mpi_tests
14591412
0 commit comments