张国熙 <[email protected]> writes:

> Hi, all
>
> I use SLEPc as part of my program, which means I compile it as .so library.
>
> I want my program work like this: execute serially, reach Point A, parallel
> solving, then serially again.
>
> I know I could use mpirun -np 4 in terminal to call the whole program,
> but this will let the serial part be executed 4 times. 

This may not be bad, but you can MPI_Comm_rank(MPI_COMM_WORLD,&rank), if
(rank == 0) { ... do the serial stuff ...}.

> What I want is only call mpi at the eigensolving part.  Is there any
> function that could achieve something like that?

There is MPI_Comm_spawn, but it's sort of a mess for resource
management/portability problem so I would recommend just using mpiexec.

Attachment: pgpcVfGmv3azd.pgp
Description: PGP signature

Reply via email to