14
14
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
15
15
* Copyright (c) 2010-2014 Los Alamos National Security, LLC. All rights
16
16
* reserved.
17
+ * Copyright (c) 2021 Google, LLC. All rights reserved.
17
18
* $COPYRIGHT$
18
19
*
19
20
* Additional copyrights may follow
@@ -42,18 +43,25 @@ int mca_btl_sm_send (struct mca_btl_base_module_t *btl,
42
43
mca_btl_sm_frag_t * frag = (mca_btl_sm_frag_t * ) descriptor ;
43
44
const size_t total_size = frag -> segments [0 ].seg_len ;
44
45
45
- /* in order to work around a long standing ob1 bug (see #3845) we have to always
46
- * make the callback. once this is fixed in ob1 we can restore the code below. */
47
- frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
46
+ if (frag -> base .des_cbfunc ) {
47
+ /* in order to work around a long standing ob1 bug (see #3845) we have to always
48
+ * make the callback. once this is fixed in ob1 we can restore the code below. */
49
+ frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
50
+ }
48
51
49
52
/* header (+ optional inline data) */
50
53
frag -> hdr -> len = total_size ;
51
54
/* type of message, pt-2-pt, one-sided, etc */
52
55
frag -> hdr -> tag = tag ;
53
56
57
+ /* clear the complete flag if it has been set */
58
+ frag -> hdr -> flags &= ~MCA_BTL_SM_FLAG_COMPLETE ;
59
+
54
60
/* post the relative address of the descriptor into the peer's fifo */
55
61
if (opal_list_get_size (& endpoint -> pending_frags ) || !sm_fifo_write_ep (frag -> hdr , endpoint )) {
56
- frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
62
+ if (frag -> base .des_cbfunc ) {
63
+ frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
64
+ }
57
65
OPAL_THREAD_LOCK (& endpoint -> pending_frags_lock );
58
66
opal_list_append (& endpoint -> pending_frags , (opal_list_item_t * ) frag );
59
67
if (!endpoint -> waiting ) {
@@ -69,8 +77,9 @@ int mca_btl_sm_send (struct mca_btl_base_module_t *btl,
69
77
return OPAL_SUCCESS ;
70
78
71
79
#if 0
72
- if ((frag -> hdr -> flags & MCA_BTL_SM_FLAG_SINGLE_COPY ) ||
73
- !(frag -> base .des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP )) {
80
+ if (((frag -> hdr -> flags & MCA_BTL_SM_FLAG_SINGLE_COPY ) ||
81
+ !(frag -> base .des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP )) &&
82
+ frag -> base .des_cbfunc ) {
74
83
frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
75
84
76
85
return OPAL_SUCCESS ;
0 commit comments