From e3b7c2e6ee47fd4009cdb6ef4d346c33ad05b8ce Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 2 Feb 2024 15:28:05 +0100 Subject: [PATCH] ENH: replace masterUncollatedFileOperation::scatterList() - use Pstream::listScatterValues() instead of the old hand-rolled method. Reduces code and since it is mostly used with primitives it will use MPI_Scatter directly (see #3087) COMP: fix some inconsistent masterOp return types --- .../masterUncollatedFileOperation.C | 46 ++++---- .../masterUncollatedFileOperation.H | 9 +- .../masterUncollatedFileOperationTemplates.C | 110 +++++++----------- 3 files changed, 69 insertions(+), 96 deletions(-) diff --git a/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C b/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C index 182b526706..ef9b1faac1 100644 --- a/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C +++ b/src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 OpenFOAM Foundation - Copyright (C) 2019-2023 OpenCFD Ltd. + Copyright (C) 2019-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -875,11 +875,11 @@ bool Foam::fileOperations::masterUncollatedFileOperation::mkDir mode_t mode ) const { - return masterOp + return masterOp ( dir, mkDirOp(mode), - Pstream::msgType(), + UPstream::msgType(), comm_ ); } @@ -891,11 +891,11 @@ bool Foam::fileOperations::masterUncollatedFileOperation::chMod mode_t mode ) const { - return masterOp + return masterOp ( fName, chModOp(mode), - Pstream::msgType(), + UPstream::msgType(), comm_ ); } @@ -911,7 +911,7 @@ mode_t Foam::fileOperations::masterUncollatedFileOperation::mode ( fName, modeOp(followLink), - Pstream::msgType(), + UPstream::msgType(), comm_ ); } @@ -925,11 +925,11 @@ Foam::fileName::Type Foam::fileOperations::masterUncollatedFileOperation::type { return fileName::Type ( - masterOp