On Wed 2008-10-22 00:40, Reuti wrote: > > Okay, now I see. Why not just call MPI_Comm_size(MPI_COMM_WORLD, > &nprocs) When nprocs is 1, it's a serial run. It can also be executed > when not running within mpirun AFAICS.
This is absolutely NOT okay. You cannot call any MPI functions before MPI_Init (and at least OMPI 1.2+ and MPICH2 1.1a will throw an error if you try). I'm slightly confused about the original problem. Is the program linked against an MPI when running in serial? You have to recompile anyway if you change MPI implementation, so if it's not linked against a real MPI then you know at compile time. But what is the problem with calling MPI_Init for a serial job? All implementations I've used allow you to call MPI_Init when the program is run as ./foo (no mpirun). Jed
pgpQQUWd4bLAL.pgp
Description: PGP signature