LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2006-08-03 07:58:18


There is no portable way to do this in LAM/MPI (there are API calls beneath
MPI_INIT, of course, but I wouldn't recommend these unless you are willing
to be tied to LAM/MPI).

That being said, my only other recommendation would be to use a command line
tool in LAM (which, I guess, is also LAM-specific... :-\ ) that can probe
for the daemon and let you know if it's there or not. Check out the "tping"
command. You could probably do something like:

    tping h -c 1

And check the return status (a zero value would indicate that the there is a
lamd on your local host). The "lamnodes" command could be used similarly,
and would tell you how many nodes/CPUs are in your LAM universe.

On 7/21/06 12:55 PM, "Mark McGann" <mark_mcgann_at_[hidden]> wrote:

> Hello everyone,
>
> Is there any function call in lam-mpi to check if the lam deamon is running
> that won't call exit?
>
> I have found that MPI_Init calls exit if it cannot contact the lam daemon.
> While I believe this behavior is within the MPI specifications it causes
> problems in the enviroment I'm working in. Specifically I have a program
> that supports both MPI, PVM and single processor runs all in the same
> executable. So my code can be thought of as
>
> if (InitializeMPI()) RunMPI();
> else if (InitializePVM()) RunPVM();
> else RunSingle();
>
> The InitializeMPI function would then call MPI_Init. Most MPI
> implimentations will return a failure code if MPI can't be initialized,
> however lam-mpi calls exit instead. This causes issues for users who want
> to run with PVM or single processor and don't have lamd running.
>
> This is the basis for my question, as I'd like to have some method of
> checking if the program can be run in MPI mode without forcing the program
> to exit if it can't.
>
> -Thanks in advance
> -Mark McGann
> -OpenEye Scientific Software
>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/

-- 
Jeff Squyres
Server Virtualization Business Unit
Cisco Systems