1#ifndef NGEN_PARALLEL_UTILS_H
2#define NGEN_PARALLEL_UTILS_H
7#ifndef MPI_HF_SUB_CODE_GOOD
8#define MPI_HF_SUB_CODE_GOOD 0
11#ifndef MPI_HF_SUB_CODE_BAD
12#define MPI_HF_SUB_CODE_BAD 1
15#ifndef NGEN_MPI_DATA_TAG
16#define NGEN_MPI_DATA_TAG 100
19#ifndef NGEN_MPI_PROTOCOL_TAG
20#define NGEN_MPI_PROTOCOL_TAG 101
47 bool mpiSyncStatusAnd(
bool status, MPI_Comm comm,
const std::string &taskDesc);
57 bool mpiSyncStatusAnd(
bool status, MPI_Comm comm);
76 bool is_hydrofabric_subdivided(
const std::string &catchmentDataFile, MPI_Comm comm,
bool printMsg);
92 void get_hosts_array(MPI_Comm comm,
int *host_array);
104 bool mpi_send_text_file(
const char *fileName, MPI_Comm comm,
const int destRank);
118 bool mpi_recv_text_file(
const char *fileName, MPI_Comm comm,
const int srcRank);
168 bool distribute_subdivided_hydrofabric_files(
const std::string &baseCatchmentFile,
const std::string &baseNexusFile,
169 const int sendingRank, MPI_Comm comm,
170 const int *hostIdForRank,
bool syncReturnStatus,
bool blockAll);
185 bool subdivide_hydrofabric(MPI_Comm comm,
const std::string &catchmentDataFile,
186 const std::string &nexusDataFile,
const std::string &partitionConfigFile);
195 std::vector<std::string> gather_strings(
const std::vector<std::string>& local_strings, MPI_Comm comm);
204 std::vector<std::string> broadcast_strings(
const std::vector<std::string>& strings, MPI_Comm comm);