Skip to content

Commit 473bcc0

Browse files
committed
Do not test an inactive partition request. Free requests before exiting the locked section.
Signed-off-by: Keluaa <34173752+Keluaa@users.noreply.github.com>
1 parent 7b2ac18 commit 473bcc0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ompi/mca/part/persist/part_persist.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ mca_part_persist_progress(void)
304304
req->flags[i] = 0;
305305
}
306306

307-
if(0 == req->flags[i])
308-
{
307+
if(0 == req->flags[i] && OMPI_REQUEST_ACTIVE == req->persist_reqs[i]->req_state) {
309308
ompi_request_test(&(req->persist_reqs[i]), &(req->flags[i]), MPI_STATUS_IGNORE);
310309
if(0 != req->flags[i]) req->done_count++;
311310
}
@@ -323,16 +322,14 @@ mca_part_persist_progress(void)
323322
to_delete = req;
324323
}
325324
}
325+
}
326326

327+
if(NULL != to_delete && OPAL_SUCCESS == err) {
328+
err = mca_part_persist_free_req(to_delete);
327329
}
330+
328331
OPAL_THREAD_UNLOCK(&ompi_part_persist.lock);
329332
block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1);
330-
if(to_delete) {
331-
err = mca_part_persist_free_req(to_delete);
332-
if (OMPI_SUCCESS != err) {
333-
return OMPI_ERROR;
334-
}
335-
}
336333

337334
return OMPI_SUCCESS;
338335
}

0 commit comments

Comments
 (0)