ericmoraess
ericmoraess

Reputation: 374

Parameter -NP with a MPI_Comm_spawn

I was writing a code to understand MPI_Comm_spawn. I found some examples in the Internet, all compiled and executed with sucess but when I put the follow statement: mpirun -np 2 ./program I received a error. So, MPI_Comm_spawn only work with one process (-np 1)?

mpirun -np 1 ./executable - ok

mpirun -np 2 ./executable - don't run with values greater than one

I use the following code:

code used

Upvotes: 0

Views: 124

Answers (1)

Wesley Bland
Wesley Bland

Reputation: 9072

You can definitely spawn processes when you have more than 1 process. That example is just designed to only work with one process. Here is an example of some code that will work with more than 1 process.

Upvotes: 1

Related Questions