Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate outputs of realization config in MPI computation #866

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion include/realizations/config/formulation.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#ifndef NGEN_REALIZATION_CONFIG_FORMULATION_H
#define NGEN_REALIZATION_CONFIG_FORMULATION_H

#include <NGenConfig.h>
#include <boost/property_tree/ptree.hpp>
#include <string>

#include "JSONProperty.hpp"

#if NGEN_WITH_MPI
#include <mpi.h>
#endif

namespace realization{
namespace config{

Expand Down Expand Up @@ -53,9 +58,16 @@ namespace realization{
//Create the nested formulations in order of definition
nested.push_back(Formulation(module.second));
}
// If running MPI job, output with only one processor
#if NGEN_WITH_MPI
PhilMiller marked this conversation as resolved.
Show resolved Hide resolved
int mpi_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if (mpi_rank == 0)
#endif
{
geojson::JSONProperty::print_property(parameters.at("modules"));
}
}
}

/**
Expand Down
Loading