From bbc0d0cfc096bfb254e9344bb58d18380392a244 Mon Sep 17 00:00:00 2001 From: wkliao Date: Sat, 7 Dec 2024 16:56:30 -0600 Subject: [PATCH] valgrind warning: uninitialized variables --- src/cases/report_timing.cpp | 3 ++- src/e3sm_io.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cases/report_timing.cpp b/src/cases/report_timing.cpp index 4e772a23..ce499c77 100644 --- a/src/cases/report_timing.cpp +++ b/src/cases/report_timing.cpp @@ -88,7 +88,8 @@ int print_timing_WR(e3sm_io_config *cfg, + decom->max_nreqs[i] * sizeof(int); /* D*.lengths */ sum_decomp_varlen += vlen; } - sum_decomp_varlen *= cfg->sub_nprocs; + if (cfg->sub_comm != MPI_COMM_NULL) + sum_decomp_varlen *= cfg->sub_nprocs; if (cfg->strategy == blob && cfg->api != adios && cfg->sub_rank > 0) sum_decomp_varlen = 0; /* sum_decomp_varlen is the size of all decomposition variables defined in diff --git a/src/e3sm_io.c b/src/e3sm_io.c index 729f9daa..496a1896 100644 --- a/src/e3sm_io.c +++ b/src/e3sm_io.c @@ -275,6 +275,7 @@ int main (int argc, char **argv) { decom.disps[i] = NULL; decom.raw_offsets[i] = NULL; decom.w_starts[i] = NULL; + decom.max_nreqs[i] = 0; } ffreq = 1;