[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using atlocal variables in autotest macros

From: John Wohlbier
Subject: Re: using atlocal variables in autotest macros
Date: Tue, 3 Mar 2009 13:09:09 -0700

On Tue, Mar 3, 2009 at 12:14 PM, Ralf Wildenhues <address@hidden>wrote:

> * John Wohlbier wrote on Tue, Mar 03, 2009 at 05:13:17PM CET:
> >
> > I got the basic functionality to work with the following.
> >
> > m4_define([AT_MPIRUN_PROGRAM],
> > [AT_BANNER([executing mpirun -n $2 $1])
> >  AT_SETUP([$1])
> >  AT_CHECK([test -n "$MPI_LIBS" || exit 77])
> >  AT_TESTED([$1])
> >  AT_CHECK([mpirun -n $2 $1],[0],[ignore],[ignore])
> > ])
> >
> > m4_define([AT_SERIALRUN_PROGRAM],
> > [AT_BANNER([executing ./$1])
> >  AT_SETUP([$1])
> >  AT_CHECK([test -z "$MPI_LIBS" || exit 77])
> >  AT_TESTED([$1])
> >  AT_CHECK([$1],[0],[ignore],[ignore])
> > ])
> >
> > I was surprised by the  AT_CHECK([test -z "$MPI_LIBS" || exit 77]) line
> > (note it's different than what you suggested). I had to flip the -n and
> -z
> > tests. I guess the double pipe (||) means that if the first argument is
> > true, then take it, otherwise take exit 77.

Thanks again for the help.

> BTW, if I were you, then I would do this differently: don't use separate
> tests for parallel and serial, but just adjust the AT_CHECK within one
> test.

That seems like a reasonable suggestion. What I have a hard time seeing
though is how exactly I'd get that test to execute just once for serial, and
a test writer specified number of times with different numbers of processors
for the parallel tests. What I have now for a test is something like

$ cat src/pika_fields/test/


where I'd like the test author to be able to specify the numbers of
processors they want the parallel test to run with just by writing a file
such as this. I could see something like
could execute serial or mpi with 1 processor based on checking $MPI_LIBS.
But I can't see how to run several tests in the case of mpi. Perhaps
something like
I'm not sure what the AT_CHECK would look like in this case to achieve the
desired result. Are  you suggesting one AT_CHECK that handles all of the
different numbers of processors, or maybe doing a loop on the arguments
within the macro and calling an AT_CHECK per run?

> BTW2, a comment regarding portability.  The newer MPI standard specifies
> mpiexec rather than mpirun; but in practice, there are still lots of
> system differences regarding how to start MPI jobs, be that some flavor
> of mpirun, mpprun, qsub, loadlever or so.  Further, on some of the big
> iron systems, MPI is enabled and linked to by default (or even part of
> "libc"), so MPI_LIBS may as well be empty for them.  They typically have
> different program startup procedures, too.
Thanks for the heads up. I've changed mpirun to mpiexec. I think I am not
able to anticipate every system we'll run on so I'll just have to take them
as they come and try to increase portability as we go.


John G. Wohlbier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]