Skip to content

Commit 454d7aa

Browse files
committed
part/persist: fix start_all()
use a separate loop index for the innermost loop. Fixes #12969 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent ec987ee commit 454d7aa

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

ompi/mca/part/persist/part_persist.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Copyright (c) 2004-2007 The University of Tennessee and The University
55
* of Tennessee Research Foundation. All rights
66
* reserved.
7-
* Copyright (c) 2015 Research Organization for Information Science
8-
* and Technology (RIST). All rights reserved.
7+
* Copyright (c) 2015-2024 Research Organization for Information Science
8+
* and Technology (RIST). All rights reserved.
99
* Copyright (c) 2017 Intel, Inc. All rights reserved
1010
* Copyright (c) 2019-2021 The University of Tennessee at Chattanooga and The University
1111
* of Tennessee Research Foundation. All rights reserved.
@@ -28,7 +28,7 @@
2828
#include <alloca.h>
2929
#endif
3030

31-
#include<math.h>
31+
#include <math.h>
3232

3333
#include "ompi_config.h"
3434
#include "ompi/request/request.h"
@@ -495,9 +495,8 @@ mca_part_persist_start(size_t count, ompi_request_t** requests)
495495
{
496496
int err = OMPI_SUCCESS;
497497
size_t _count = count;
498-
size_t i;
499498

500-
for(i = 0; i < _count && OMPI_SUCCESS == err; i++) {
499+
for(size_t i = 0; i < _count && OMPI_SUCCESS == err; i++) {
501500
mca_part_persist_request_t *req = (mca_part_persist_request_t *)(requests[i]);
502501
/* First use is a special case, to support lazy initialization */
503502
if(false == req->first_send)
@@ -513,8 +512,8 @@ mca_part_persist_start(size_t count, ompi_request_t** requests)
513512
} else {
514513
if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) {
515514
req->done_count = 0;
516-
for(i = 0; i < req->real_parts && OMPI_SUCCESS == err; i++) {
517-
req->flags[i] = -1;
515+
for(size_t j = 0; j < req->real_parts && OMPI_SUCCESS == err; j++) {
516+
req->flags[j] = -1;
518517
}
519518
} else {
520519
req->done_count = 0;

0 commit comments

Comments
 (0)