@@ -117,16 +117,12 @@ static int ompi_osc_pt2pt_flush_active_frag (ompi_osc_pt2pt_module_t *module, om
117117 return ret ;
118118}
119119
120- int ompi_osc_pt2pt_frag_flush_target (ompi_osc_pt2pt_module_t * module , int target )
120+ int ompi_osc_pt2pt_frag_flush_pending (ompi_osc_pt2pt_module_t * module , int target )
121121{
122122 ompi_osc_pt2pt_peer_t * peer = ompi_osc_pt2pt_peer_lookup (module , target );
123123 ompi_osc_pt2pt_frag_t * frag ;
124124 int ret = OMPI_SUCCESS ;
125125
126- OPAL_OUTPUT_VERBOSE ((50 , ompi_osc_base_framework .framework_output ,
127- "osc pt2pt: frag flush to target target %d. queue fragments: %lu" ,
128- target , (unsigned long ) opal_list_get_size (& peer -> queued_frags )));
129-
130126 /* walk through the pending list and send */
131127 OPAL_THREAD_LOCK (& peer -> lock );
132128 while (NULL != (frag = ((ompi_osc_pt2pt_frag_t * ) opal_list_remove_first (& peer -> queued_frags )))) {
@@ -137,11 +133,40 @@ int ompi_osc_pt2pt_frag_flush_target (ompi_osc_pt2pt_module_t *module, int targe
137133 }
138134 OPAL_THREAD_UNLOCK (& peer -> lock );
139135
140- /* XXX -- TODO -- better error handling */
136+ return ret ;
137+ }
138+
139+ int ompi_osc_pt2pt_frag_flush_pending_all (ompi_osc_pt2pt_module_t * module )
140+ {
141+ int ret ;
142+
143+ for (int i = 0 ; i < ompi_comm_size (module -> comm ) ; ++ i ) {
144+ ret = ompi_osc_pt2pt_frag_flush_pending (module , i );
145+ if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
146+ return ret ;
147+ }
148+ }
149+
150+ return ret ;
151+ }
152+
153+ int ompi_osc_pt2pt_frag_flush_target (ompi_osc_pt2pt_module_t * module , int target )
154+ {
155+ ompi_osc_pt2pt_peer_t * peer = ompi_osc_pt2pt_peer_lookup (module , target );
156+ ompi_osc_pt2pt_frag_t * frag ;
157+ int ret = OMPI_SUCCESS ;
158+
159+ OPAL_OUTPUT_VERBOSE ((50 , ompi_osc_base_framework .framework_output ,
160+ "osc pt2pt: frag flush to target target %d. queue fragments: %lu" ,
161+ target , (unsigned long ) opal_list_get_size (& peer -> queued_frags )));
162+
163+ ret = ompi_osc_pt2pt_frag_flush_pending (module , target );
141164 if (OMPI_SUCCESS != ret ) {
165+ /* XXX -- TODO -- better error handling */
142166 return ret ;
143167 }
144168
169+
145170 /* flush the active frag */
146171 ret = ompi_osc_pt2pt_flush_active_frag (module , peer );
147172
0 commit comments