From 454d7aaa80f7b613380dce994892d7263c036026 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 9 Dec 2024 13:15:51 +0900 Subject: [PATCH] part/persist: fix start_all() use a separate loop index for the innermost loop. Fixes open-mpi/ompi#12969 Signed-off-by: Gilles Gouaillardet --- ompi/mca/part/persist/part_persist.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ompi/mca/part/persist/part_persist.h b/ompi/mca/part/persist/part_persist.h index ccc8f8f1971..d5ea760e27f 100644 --- a/ompi/mca/part/persist/part_persist.h +++ b/ompi/mca/part/persist/part_persist.h @@ -4,8 +4,8 @@ * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2015-2024 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * Copyright (c) 2017 Intel, Inc. All rights reserved * Copyright (c) 2019-2021 The University of Tennessee at Chattanooga and The University * of Tennessee Research Foundation. All rights reserved. @@ -28,7 +28,7 @@ #include #endif -#include +#include #include "ompi_config.h" #include "ompi/request/request.h" @@ -495,9 +495,8 @@ mca_part_persist_start(size_t count, ompi_request_t** requests) { int err = OMPI_SUCCESS; size_t _count = count; - size_t i; - for(i = 0; i < _count && OMPI_SUCCESS == err; i++) { + for(size_t i = 0; i < _count && OMPI_SUCCESS == err; i++) { mca_part_persist_request_t *req = (mca_part_persist_request_t *)(requests[i]); /* First use is a special case, to support lazy initialization */ if(false == req->first_send) @@ -513,8 +512,8 @@ mca_part_persist_start(size_t count, ompi_request_t** requests) } else { if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) { req->done_count = 0; - for(i = 0; i < req->real_parts && OMPI_SUCCESS == err; i++) { - req->flags[i] = -1; + for(size_t j = 0; j < req->real_parts && OMPI_SUCCESS == err; j++) { + req->flags[j] = -1; } } else { req->done_count = 0;