diff --git a/utils/eventlogger.cc b/utils/eventlogger.cc index c2f6812ccb33fa962893a4451b4d612f6424e058..6ea33ff4198e60cf588c7eb57c50b7d44416b48f 100644 --- a/utils/eventlogger.cc +++ b/utils/eventlogger.cc @@ -83,6 +83,7 @@ int maxbuffered = 0; std::string imaptype = "linear"; std::string indextype = "global"; bool all = false; +bool useBarrier = false; int main (int argc, char* argv[]) @@ -104,6 +105,7 @@ main (int argc, char* argv[]) {"imaptype", required_argument, 0, 'm'}, {"indextype", required_argument, 0, 'i'}, {"all", no_argument, 0, 'a'}, + {"adapter", no_argument, 0, 'z'}, {"help", no_argument, 0, 'h'}, {"in", required_argument, 0, IN}, {"message-in", required_argument, 0, MESSAGE_IN}, @@ -113,7 +115,7 @@ main (int argc, char* argv[]) int optionIndex = 0; // the + below tells getopt_long not to reorder argv - int c = getopt_long (argc, argv, "+t:l:b:m:i:ah", longOptions, &optionIndex); + int c = getopt_long (argc, argv, "+t:l:b:m:i:azh", longOptions, &optionIndex); // detect the end of the options if (c == -1) @@ -149,6 +151,9 @@ main (int argc, char* argv[]) case 'a': all = true; continue; + case 'z': + useBarrier = true; + continue; case IN: portName = optarg; continue; @@ -252,6 +257,9 @@ main (int argc, char* argv[]) double stoptime; setup->config ("stoptime", &stoptime); + if (useBarrier) + MPI::COMM_WORLD.Barrier(); + // Run MUSIC::Runtime* runtime = new MUSIC::Runtime (setup, timestep); diff --git a/utils/eventsink.cc b/utils/eventsink.cc index 7f55782c498bb8e0a7990a38de3e67558d853619..d4596451d455ffe45ce7a81c453b8ef338408ff0 100644 --- a/utils/eventsink.cc +++ b/utils/eventsink.cc @@ -1,6 +1,6 @@ /* * This file is part of MUSIC. - * Copyright (C) 2008, 2009 INCF + * Copyright (C) 2008, 2009, 2018 INCF * * MUSIC is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,6 +78,7 @@ string imaptype = "linear"; string indextype = "global"; string prefix; string suffix = ".dat"; +bool useBarrier = false; void getargs (int rank, int argc, char* argv[]) @@ -93,13 +94,14 @@ getargs (int rank, int argc, char* argv[]) {"indextype", required_argument, 0, 'i'}, {"help", no_argument, 0, 'h'}, {"in", required_argument, 0, IN}, + {"adapter", no_argument, 0, 'z'}, {0, 0, 0, 0} }; /* `getopt_long' stores the option index here. */ int option_index = 0; // the + below tells getopt_long not to reorder argv - int c = getopt_long (argc, argv, "+t:m:i:h", longOptions, &option_index); + int c = getopt_long (argc, argv, "+t:m:i:hz", longOptions, &option_index); /* detect the end of the options */ if (c == -1) @@ -129,6 +131,9 @@ getargs (int rank, int argc, char* argv[]) case IN: portName = optarg; continue; + case 'z': + useBarrier = true; + continue; case '?': break; // ignore unknown options case 'h': @@ -216,6 +221,9 @@ main (int argc, char *argv[]) double stoptime; setup->config ("stoptime", &stoptime); + if (useBarrier) + MPI::COMM_WORLD.Barrier(); + MUSIC::Runtime* runtime = new MUSIC::Runtime (setup, timestep); double time = runtime->time ();