Reputation: 11824
With MPI in C, you can do the following to run a program:
mpirun -np 5 program
where 5
is the number of processors to use and program
is the program to run on these processors. Is it possible to request x
processors like above but then whilst the program is running, if you decide you need y
processors (let's say y>x
), can you request more without restarting the program?
If the answer is yes, then how do you do this? If no then why not?
Many thanks.
Upvotes: 1
Views: 75
Reputation: 48066
This is possible; but it's not trivial. The application needs to have been coded to support this. Fundamentally, there's the issue that mpi provides various global communication and synchronization primitives, and it's not clear what to do with such operations when adding new parallelism - you wouldn't want new processes to non-deterministically deadlock or crash others, after all.
Here's some documentation on IBM's site - any MPI2 implementation should be conform to the same outline. Jonathan points out that the MPI Specification itself includes a pretty good example of doing this for a master-worker sort of problem.
Upvotes: 3