I unfortunately won't be at the next Forum meeting, but you might want to ask 
someone to bring it up for you.

It might not give you exactly what you want, however, because not all platforms 
have "mpicc" (or similar) wrapper compilers.  I.e., to compile an MPI 
application on some platforms, you just "cc ... -lmpi".  Hence, there's no way 
for the compiler to know whether to #define MPI or not.

Such a macro *could* be added to mpi.h (but not Fortran), but then you wouldn't 
get at least one of the use cases that you (assumedly :-) ) want:

#if MPI
#include <mpi.h>
#endif


On Aug 23, 2011, at 7:46 AM, Gabriele Fatigati wrote:

> Can I suggest to insert this macro in next MPI 3 standard?
> 
> I think It's very useful.
> 
> 2011/8/23 Jeff Squyres <jsquy...@cisco.com>
> I'm afraid not.  Sorry!  :-(
> 
> We have the OPEN_MPI macro -- it'll be defined to 1 if you compile with Open 
> MPI, but that doesn't really help your portability issue.  :-\
> 
> On Aug 23, 2011, at 5:19 AM, Gabriele Fatigati wrote:
> 
> > Dear OpenMPi users,
> >
> > is there some portable MPI macro to check if a code is compiled with MPI 
> > compiler? Something like _OPENMP for OpenMP codes:
> >
> > #ifdef _OPENMP
> >
> > ....
> >
> > #endif
> >
> >
> > it exist?
> >
> > #ifdef MPI
> >
> >
> > ....
> >
> > #endif
> >
> > Thanks
> >
> > --
> > Ing. Gabriele Fatigati
> >
> > HPC specialist
> >
> > SuperComputing Applications and Innovation Department
> >
> > Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
> >
> > www.cineca.it                    Tel:   +39 051 6171722
> >
> > g.fatigati [AT] cineca.it
> > _______________________________________________
> > users mailing list
> > us...@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> 
> 
> --
> Jeff Squyres
> jsquy...@cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> 
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users
> 
> 
> 
> -- 
> Ing. Gabriele Fatigati
> 
> HPC specialist
> 
> SuperComputing Applications and Innovation Department
> 
> Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
> 
> www.cineca.it                    Tel:   +39 051 6171722
> 
> g.fatigati [AT] cineca.it           
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to