autoconf
[Top][All Lists]
Advanced

[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: Sun, 1 Mar 2009 20:51:27 -0700

Ralf and Eric,
Thanks for the responses to my questions. I was glad to see that I was at
least doing something right. However, I still cannot get this to work for
me. Since I first sent the mail I have changed how I am doing things
slightly. I have two macros, one for mpi and one for serial. The idea in my
test then will be that I'll call both the serial and the mpi versions of the
test and based on a test within those macros, triggered off of MPI_LIBS, the
correct tests will execute. The macros are below (I will change the AT_
namespace convention, as suggested, once I have something working.)


address@hidden test]$ cat testsuite.at
AT_INIT([pika_fields])

AT_BANNER([pika fields])

m4_include([local.at])
m4_include([test.at])

address@hidden test]$ cat local.at
m4_define([AT_MPIRUN_PROGRAM],
[AS_IF([test -n "$MPI_LIBS"],
       [AT_BANNER([executing mpirun -n $2 $1])
        AT_TESTED([$1])
        AT_SETUP([$1])
        AT_CHECK([mpirun -n $2 $1],[0],[ignore],[ignore])
        AT_CLEANUP])
])

m4_define([AT_SERIALRUN_PROGRAM],
[AS_IF([test -z "$MPI_LIBS"],
        [AT_BANNER([executing ./$1])
         AT_TESTED([$1])
         AT_SETUP([$1])
         AT_CHECK([$1],[0],[ignore],[ignore])
         AT_CLEANUP])
])

address@hidden test]$ cat test.at
AT_SERIALRUN_PROGRAM([test_Cell_Field])

AT_MPIRUN_PROGRAM([test_Cell_Field],[1])
AT_MPIRUN_PROGRAM([test_Cell_Field],[2])
AT_MPIRUN_PROGRAM([test_Cell_Field],[4])
AT_MPIRUN_PROGRAM([test_Cell_Field],[8])

address@hidden test]$ cat atlocal.in
MPI_LIBS="@MPI_LIBS@"


The trouble is that it seems that all of the tests are being executed
regardless of the value of MPI_LIBS. The tests
AS_IF([test -n "$MPI_LIBS"],
AS_IF([test -z "$MPI_LIBS"],
just do not seem to work and the AT_CHECKs within the if test are all
executed. If I try to print the value of MPI_LIBS from within the macro,
viz,

m4_define([AT_MPIRUN_PROGRAM],
[echo "$MPI_LIBS"
 AS_IF([test -n "$MPI_LIBS"],
       [AT_BANNER([executing mpirun -n $2 $1])
        AT_TESTED([$1])
        AT_SETUP([$1])
        AT_CHECK([mpirun -n $2 $1],[0],[ignore],[ignore])
        AT_CLEANUP])
])

I don't see results from the "echo" in any of the resulting files. Thus I
have no way of knowing if the AS_IF should even work since I don't know the
value of MPI_LIBS.

Does anyone have a suggestion? Thanks much.

jgw


-- 
John G. Wohlbier


reply via email to

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