Reputation: 543
I want to have an error message and exit normally in case -np
is set to zero on the command line. Is there any way to do this? It seems like the program stops working without even starting.
Upvotes: 0
Views: 525
Reputation: 60103
Zero number of processes indeed means it does not start any process at all. How can you have any output if you have no process to create it? No process is just no process. Nothing is running. Like if you don't run the mpiexec at all.
I don't get what kind of error message would you expect to see. Perhaps you actually want 1 process?
I just tested mpiexec coming with OpenMPI on my computer an it starts 1 process if you requests -np 0
. Other implementations might behave differently.
Upvotes: 2