@@ -491,6 +491,102 @@ ucs_memory_type_t test_ucp_peer_failure::memtype() const
491491 return UCS_MEMORY_TYPE_HOST;
492492}
493493
494+ class test_ucp_peer_failure_inval : public ucp_test {
495+ protected:
496+ ucp_ep_params_t get_ep_params ()
497+ {
498+ ucp_ep_params_t params;
499+
500+ memset (¶ms, 0 , sizeof (params));
501+ params.field_mask = UCP_EP_PARAM_FIELD_ERR_HANDLING_MODE;
502+ params.err_mode = UCP_ERR_HANDLING_MODE_PEER;
503+ return params;
504+ }
505+
506+ public:
507+ void test_invalidate_rma_bw_lane (bool force_invalidate_rma);
508+
509+ static void get_test_variants (std::vector<ucp_test_variant> &variants)
510+ {
511+ add_variant_with_value (variants, UCP_FEATURE_RMA, 0 , " rma" );
512+ }
513+
514+ void init ()
515+ {
516+ create_entity ();
517+ sender ().connect (&receiver (), get_ep_params (), 0 );
518+ }
519+ };
520+
521+ void test_ucp_peer_failure_inval::test_invalidate_rma_bw_lane (
522+ bool force_invalidate_rma)
523+ {
524+ const auto config = ucp_ep_config (sender ().ep ());
525+
526+ bool has_no_invalidate_rma = false ;
527+ bool has_invalidate_rma = false ;
528+ for (auto i = 0 ; i < config->key .num_lanes ; ++i) {
529+ const auto lane = config->key .rma_bw_lanes [i];
530+ if (lane == UCP_NULL_LANE) {
531+ continue ;
532+ }
533+
534+ const auto md_attr = ucp_ep_md_attr (sender ().ep (), lane);
535+ if (!(md_attr->flags & UCT_MD_FLAG_INVALIDATE_RMA)) {
536+ has_no_invalidate_rma = true ;
537+ } else {
538+ has_invalidate_rma = true ;
539+ }
540+ }
541+
542+ if (force_invalidate_rma) {
543+ ASSERT_FALSE (has_no_invalidate_rma);
544+ } else {
545+ ASSERT_TRUE (!has_transport (" tcp" ) || has_no_invalidate_rma);
546+ ASSERT_TRUE (!has_transport (" rc_x" ) || has_invalidate_rma);
547+ }
548+ }
549+
550+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_no_invalidate_rma_inf,
551+ " RNDV_THRESH=inf" )
552+ {
553+ test_invalidate_rma_bw_lane (false );
554+ }
555+
556+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_invalidate_rma_inf_inf,
557+ " RNDV_THRESH=intra:inf,inter:inf" )
558+ {
559+ test_invalidate_rma_bw_lane (false );
560+ }
561+
562+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_invalidate_rma,
563+ " RNDV_THRESH=1024" )
564+ {
565+ test_invalidate_rma_bw_lane (true );
566+ }
567+
568+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_invalidate_rma_auto_inf,
569+ " RNDV_THRESH=intra:auto,inter:inf" )
570+ {
571+ test_invalidate_rma_bw_lane (true );
572+ }
573+
574+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_invalidate_rma_inf_auto,
575+ " RNDV_THRESH=intra:inf,inter:auto" )
576+ {
577+ test_invalidate_rma_bw_lane (true );
578+ }
579+
580+ UCS_TEST_P (test_ucp_peer_failure_inval, rma_bw_invalidate_rma_value_inf,
581+ " RNDV_THRESH=intra:1024,inter:inf" )
582+ {
583+ test_invalidate_rma_bw_lane (true );
584+ }
585+
586+ UCP_INSTANTIATE_TEST_CASE_TLS (test_ucp_peer_failure_inval, tcp, " tcp" )
587+ UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_peer_failure_inval, rc_x, " rc_x" )
588+
589+
494590UCS_TEST_P(test_ucp_peer_failure, basic) {
495591 do_test (UCS_KBYTE, /* msg_size */
496592 0 , /* pre_msg_cnt */
0 commit comments