Start Programm with Parameters and mpi

Hello everybody,

I'd like to start a c++ programm with some parameters, like n, i_proc, j_proc.
It is a parallel programm and I need this parameters for deconstruct the grid with arbitrary numbers of Intervalls in x-direction (i_proc) and y-direction (j_proc).
n shall be the complete number of processes with n=i_proc+j_proc.

For example, my Programm calls grid.
Then I'd like to start my programm with something like this
mpirun -np 6 2 4 grid
where 6 is the complete number of processes, 2 is i_proc and j is j_proc and this parameters shall my programm know during the main part.

Is this possible and if yes, how ?

stubborn.
http://www.cplusplus.com/forum/beginner/5404/#msg23839

You have to parse the arguments yourself (or get a library to do it for you).
Thank you very much for your help.

The part with argc and argv I heard before.
But it does not work with mpi like the way I want.

Whatever, I found an other solution for my problem :-)

The deconstruction of the grid I do now with a function.
Topic archived. No new replies allowed.