#include #include #include #include #include #include "ChemPlugin.h" #include int exit_client(int status) { if (status != 0) MPI_Abort(MPI_COMM_WORLD, status); MPI_Finalize(); return status; } void open_input(std::ifstream& input, int argc, char** argv) { std::string filename; if (argc < 2) { std::cerr << "You must specify an input file as the first program argument." << std::endl; exit_client(-1); } else { filename = argv[1]; } input.open(filename); if (!input.is_open()) { std::cerr << "The input file does not exist" << std::endl; exit_client(-1); } } void write_results(std::vector& cp, int nx, double gap, double& then) { double now = cp[0].MpiReport1("Time", "years"); int step = nx / 100; if ((then - now) < gap / 1e4) { int last_rank = cp[0].MpiRank(); for (int i=0; i cp(nx); // Assign instances to ranks cp_inlet.MpiAssign(0); for (int i=0; i