@@ -458,19 +458,14 @@ mca_btl_base_rdma_start(mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
458458 if (sizeof (* hdr ) + size <= btl -> btl_eager_limit ) {
459459 /* just go ahead and send the data */
460460 packet_size += size ;
461- } else if (!mca_btl_base_rdma_use_rdma_get (btl )) {
462- packet_size += size ;
463461 } else if (!mca_btl_base_rdma_use_rdma_get (btl )) {
464462 packet_size += size_t_min (size , btl -> btl_max_send_size - sizeof (* hdr ));
465463 } else {
466464 use_rdma = true;
467465 }
468466 } else if (MCA_BTL_BASE_AM_GET == type ) {
469- if (sizeof (mca_btl_base_rdma_response_hdr_t ) + size <= btl -> btl_eager_limit ) {
470- packet_size += size ;
471- } else if (!mca_btl_base_rdma_use_rdma_put (btl )) {
472- packet_size += size_t_min (size , btl -> btl_max_send_size
473- - sizeof (mca_btl_base_rdma_response_hdr_t ));
467+ if (!mca_btl_base_rdma_use_rdma_put (btl )) {
468+ packet_size += size_t_min (size , btl -> btl_max_send_size - sizeof (* hdr ));
474469 } else {
475470 use_rdma = true;
476471 }
@@ -976,7 +971,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
976971 atomic_response = tmp ;
977972 }
978973 if (8 == hdr -> data .atomic .size ) {
979- mca_btl_base_am_atomic_64 (( int64_t * ) hdr -> target_address ,
974+ mca_btl_base_am_atomic_64 (& atomic_response ,
980975 (opal_atomic_int64_t * ) (uintptr_t ) hdr -> target_address ,
981976 hdr -> data .atomic .op );
982977 }
@@ -1094,19 +1089,19 @@ int mca_btl_base_am_rdma_init(mca_btl_base_module_t *btl)
10941089 }
10951090
10961091 if (!(btl -> btl_flags & MCA_BTL_FLAGS_PUT )) {
1097- BTL_VERBOSE (("Enabling AM-based RDMA put for BTL %p" , btl ));
10981092 btl -> btl_flags |= MCA_BTL_FLAGS_PUT_AM ;
1099- btl -> btl_put_limit = max_operation_size ;
1093+ btl -> btl_put_limit = max_operation_size - sizeof ( mca_btl_base_rdma_hdr_t ) ;
11001094 btl -> btl_put_alignment = operation_alignment ;
11011095 btl -> btl_put = mca_btl_base_am_rdma_put ;
1096+ BTL_VERBOSE (("Enabling AM-based RDMA put for BTL %p. max put = %zu" , btl , btl -> btl_put_limit ));
11021097 }
11031098
11041099 if (!(btl -> btl_flags & MCA_BTL_FLAGS_GET )) {
1105- BTL_VERBOSE (("Enabling AM-based RDMA get for BTL %p" , btl ));
11061100 btl -> btl_flags |= MCA_BTL_FLAGS_GET_AM ;
1107- btl -> btl_get_limit = max_operation_size ;
1101+ btl -> btl_get_limit = max_operation_size - sizeof ( mca_btl_base_rdma_response_hdr_t ) ;
11081102 btl -> btl_get_alignment = operation_alignment ;
11091103 btl -> btl_get = mca_btl_base_am_rdma_get ;
1104+ BTL_VERBOSE (("Enabling AM-based RDMA get for BTL %p. max get = %zu" , btl , btl -> btl_get_limit ));
11101105 }
11111106
11121107 if (!(btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_FOPS )) {
0 commit comments