From c3321039386ec9c3fd93ae1e66402affd360756c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 26 Jun 2023 15:20:29 -0400 Subject: [PATCH] make short read detection bugfix work in parallel --- src/utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index eee1d5dd46..dd18c4406d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -290,8 +290,9 @@ int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, in } int n = strlen(buffer); + if (nlines != mylines) n = 0; MPI_Bcast(&n, 1, MPI_INT, 0, comm); - if ((n == 0) || (nlines != mylines)) return 1; + if (n == 0) return 1; MPI_Bcast(buffer, n + 1, MPI_CHAR, 0, comm); return 0; }