int CommandLineModuleManager::run(int argc, char *argv[])
{
CommandLineModuleInterface *module;
- const bool bMaster = (gmx_node_rank() == 0);
+ // TODO: With thread-MPI, gmx_node_rank() returns random stuff here, so we
+ // need the first check.
+ const bool bMaster = (!gmx_mpi_initialized() || gmx_node_rank() == 0);
bool bQuiet = impl_->bQuiet_ || !bMaster;
CommandLineCommonOptionsHolder optionsHolder;
try
fprintf(stderr, "Will write debug log file: %s\n", filename.c_str());
gmx_init_debug(optionsHolder.debugLevel(), filename.c_str());
}
- int rc = module->run(argc, argv);
+ int rc = 0;
+ if (!(module == impl_->helpModule_ && !bMaster))
+ {
+ rc = module->run(argc, argv);
+ }
if (!bQuiet)
{
gmx_thanx(stderr);