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: 2004-07-20 07:05:41


Well, that's unfortunate that purify doesn't understand "mpicc".

Note on rationale here: we've always referred to the "memory clean"
model in LAM as "purify clean" because Purify is just a well-known
tool; we've never actually owned or used Purify (and therefore we
didn't know that Purify would complain about mpicc). Instead, we've
mainly used the tools bcheck (on Solaris) and valgrind (on Linux).
Sorry for the confusion... :-\ I'll update the FAQ.

I think you have 3 main options:

1. Since you appear to be using Solaris, don't use purify, and instead
use the Solaris native "bcheck" command. This means that you have to
use the native Solaris compilers (cc, CC, f77) when you configure LAM.
Then you can have a script that runs "bcheck -all your_executable", as
suggested on the FAQ.

2. It looks like "purify" is a script and is keying off the name of the
compiler "mpicc". You could hack the
/opt/rational/releases/purify.sol.2002a.06.00/purify.sh script to treat
"mpicc" exactly the same as whatever underlying compiler you are using
(e.g., cc). Or you could copy that script to somewhere you can modify
it (e.g., the cwd), modify it, and run it from there. This may or may
not be an attractive solution for you.

3. Remember that "mpicc" is only a wrapper compiler -- it only adds /
removes some command line flags and then invokes the underlying
compiler. Use the "-showme" flag to mpicc to get the additional flags
that you need. Note that "-showme" is context-sensitive, however --
different flags will be shown for compiling than linking. For example,
the following will show two different results:

mpicc -c foo.c -showme
mpicc foo.o -o foo -showme

Then you can change your Makefile to use the actual underlying compiler
and whatever relevant compiler / linker flags LAM needs.

Note that we typically *strongly* discourage people from not using
mpicc (and friends) because we are likely to change the flags that
mpicc (etc.) use without warning in each LAM release. Hence, putting a
fixed set of flags in your Makefile may work for one version of LAM,
but not work for another.

However, this unfortunately seems to be a legitimate use of needing to
get these flags and avoiding the use of the wrapper compiler. So
here's your undocumented tip of the day (we were hoping never to have
to reveal this feature)...

mpicc -showme:compile
mpicc -showme:link

will show you the CFLAGS and LDFLAGS/LIBS, respectively. These flags
were introduced in LAM 7.0. I don't remember the syntax offhand, but I
believe that gmake allows you to run arbitrary commands in a Makefile
and assign the results to a macro. You can therefore run these
commands and add the results to CFLAGS and LIBS, and then use the
underlying compiler (which the purify script understands).

On Jul 20, 2004, at 1:17 AM, x z wrote:

> lam-mpi.org's FAQ #7 says "Since LAM allows you to mpirun non-MPI
> programs, you can either mpirun purify directly, or write a short
> shell script to perform some "smart" execution decisions to limit your
> output." I do not undersatnd what it really means.
>
> I have a Makefile that containes:
>
> PURIFY := purify
> CC := mpicc
> CFLAG := -g -c -O3
>
> $(TAR): $(OBJ) $(INC)
> $(PURIFY) $(CC) -o $(TAR) $(OBJ) $(LIB)
>
> and I tried this:
>
> % gmake
> purify mpicc -o a.out my_prog.o
> Sorry, 'mpicc' is an unknown compiler.
> Usage: purify <compiler> foo.o ...
> Purify only knows about the following compilers:
> cc, acc, CC, gcc, g++, clcc, OSCC and ld.
> See details in script:
> /opt/rational/releases/purify.sol.2002a.06.00/purify.sh
>
> Well,I compiled it without purify and tried this:
>
> % mpirun C purify a.out
> Sorry, 'a.out' is an unknown compiler.
> Usage: purify <compiler> foo.o ...
> Purify only knows about the following compilers:
> cc, acc, CC, gcc, g++, clcc, OSCC and ld.
> See details in script:
> /opt/rational/releases/purify.sol.2002a.06.00/purify.sh
> -----------------------------------------------------------------------
> ------
> It seems that [at least] one of processes that was started with mpirun
> did not invoke MPI_INIT before quitting (it is possible that more than
> one process did not invoke MPI_INIT -- mpirun was only notified of the
> first one, which was on node n0).
>
> mpirun can *only* be used with MPI programs (i.e., programs that
> invoke MPI_INIT and MPI_FINALIZE). You can use the "lamexec" program
> to run non-MPI programs over the lambooted nodes.
> -----------------------------------------------------------------------
> ------
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/