summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGard Spreemann <gard.spreemann@epfl.ch>2018-06-26 15:52:02 +0200
committerGard Spreemann <gard.spreemann@epfl.ch>2018-06-26 15:52:02 +0200
commit5f84f6152237260aeb32317c3fdc6cac4603d5d7 (patch)
treedf286d1ecb262f2e8f5b1e90ab0230eab21ca9c9
parent288eb3a063a95c9487997976061f753f3ed319a3 (diff)
--help
-rw-r--r--geom_matching/wasserstein/mpi/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/geom_matching/wasserstein/mpi/main.cpp b/geom_matching/wasserstein/mpi/main.cpp
index fa8c62b..c3b4e09 100644
--- a/geom_matching/wasserstein/mpi/main.cpp
+++ b/geom_matching/wasserstein/mpi/main.cpp
@@ -32,6 +32,8 @@ void print_help(const std::string & invocation)
std::cout << " Mandatory. Output file name. Plain text." << std::endl;
std::cout << " --chunk, -c c" << std::endl;
std::cout << " Optional. Size of work chunk to send off to each computational node. Too small a value yields a lot of overhead, too large a value can cause an unbalanced load. Increase if there are many small computations. Default: 100." << std::endl;
+ std::cout << " --help, -h" << std::endl;
+ std::cout << " Print this help text." << std::endl;
}
void arg_fail(const std::string & invocation, int rank, const std::string & message)
@@ -85,7 +87,7 @@ int main(int argc, char ** argv)
if (world_size < 2)
{
- arg_fail(invocation, world_rank, "Currently there is no support for running with just one process.");
+ arg_fail(invocation, world_rank, "Currently there is no support for running with just one process. Please run at least 2 MPI jobs.");
}
char processor_name_tmp[MPI_MAX_PROCESSOR_NAME];
@@ -189,6 +191,17 @@ int main(int argc, char ** argv)
else
arg_fail(invocation, world_rank, "Missing argument for --chunk.");
}
+ else if (arg == std::string("--help") || arg == std::string("-h"))
+ {
+ if (world_rank == 0)
+ print_help(invocation);
+ MPI_Finalize();
+ exit(0);
+ }
+ else
+ {
+ arg_fail(invocation, world_rank, "Incorrect argument.");
+ }
}