Dear Paul & all, On Monday 18 May 2009 03:19:48 pm Paul H. Hargrove wrote: > IMHO there are two distinct issues being entangled here. > 1) Flagging deprecated functionality > 2) Informing the user about a change of compiler (possibly as an > #error or #warning) > > I understand why solving #1 requires detecting the compiler change to > avoid a "bad attribute" (see BACKGROUND, below). That's good. I wasn't aware of GASnet playing with attribute; ah it's using malloc and pure/const and format.
> However, I don't see > why this detection requires that one report it to the user. In the > naive implementation, a change of compiler would just silently loose the > ability to warn about deprecated functionality. No other user-visible > change in behavior would be required if the compiler were to change. > So, my recommendation is that Rainer and Jeff narrow their RFC to cover > just #1, and float an independent RFC for #2 only after #1 has been well > tested. That's fine with me. The two issues are separate, subsuming them under the same flag warning on/off is not too complicated neither for users nor admins. The current way is that users do not get warned (the previous default). Admins may configure-time select the warning on, users vice-versa can compile- time select it off (-DOMPI_WANT_MPI_INTERFACE_WARNING=0) But again I don't have harsh feelings, _not_ to warn in case of #2. Yes, there are users who _need_ to use different compilers, all is fine (in case when we're playing regparm tricks, where the specific compiler needs to be used in mpicc, then we're not fine anymore ;-))... With best regards, Rainer > BACKGROUND: > > As Rainer acknowledged, this is based on some preprocessor code we've > been using in GASNet for some time now. Among other things, we use this > code to ensure that attributes that were detected at configure time are > still guaranteed valid at compile time. A simplified example from GASNet: > > /* detect when the compiler in use differs from the one tested by > configure, > * indicating some of the configure-detected results may be invalid > for this compilation > */ > #include <portable_platform.h> > #if PLATFORM_COMPILER_ID != GASNETI_PLATFORM_COMPILER_ID || \ > PLATFORM_COMPILER_VERSION != GASNETI_PLATFORM_COMPILER_VERSION > #define GASNETI_CONFIGURE_MISMATCH 1 > #endif > > #if GASNETI_CONFIGURE_MISMATCH > #define GASNETI_ATTRIBUTE_FOO /* Not safe since compiler has > changed */ > #elif HAVE_GCC_ATTRIBUTE_FOO > #define GASNETI_ATTRIBUTE_FOO __attribute__(__foo__) > #else > #define GASNETI_ATTRIBUTE_FOO /* Not detected at configure time */ > #endif > > Jeff Squyres wrote: > > Agreed. Being able to handle such scenarios properly is one of the > > reasons that Rainer and I are iterating on this in a mercurial branch. > > > > On May 18, 2009, at 7:39 AM, Brian Barrett wrote: > >> I think care must be taken on this front. While I know we don't like > >> to admit it, there is no reason the C compilers have to match, and > >> indeed good reasons they might not. For example, at LANL, we > >> frequently compiled OMPI with GCC, then fixed up the wrapper compilers > >> to use Icc or whatever, to work around optimizer bugs. This is > >> functionality I don't think should be lost just to warn about > >> deprecated functions. > >> > >> Brian > >> > >> -- > >> Brian Barrett > >> > >> There is an art . . . to flying. The knack lies in learning how to > >> throw yourself at the ground and miss. > >> > >> On May 18, 2009, at 1:34, Rainer Keller <kel...@ornl.gov> wrote: > >> > What: Warn user about deprecated MPI functionality and "wrong" > >> > compiler usage > >> > > >> > Why: Because deprecated MPI functions, are ... deprecated > >> > > >> > Where: On trunk > >> > > >> > When: Apply on trunk before branching for v1.5 (it is user-visible) > >> > > >> > Timeout: 1 weeks - May 26, 2009 after the teleconf. > >> > > >> > --------------------------------------------------------------------- > >> > > >> > I'd like to propose a patch that addresses two issues: > >> > - Users shoot themselves in the foot compiling with a different > >> > compiler > >> > than what was used to compile OMPI (think ABI) > >> > - The MPI-2.1 std. defines several functions to be deprecated. > >> > > >> > This will warn Open MPI users, when accessing deprecated functions, > >> > even > >> > giving a proper warning such as: > >> > "MPI_TYPE_HVECTOR is superseded by MPI_TYPE_CREATE_HVECTOR" > >> > Also, now we may _warn_ when using a different compiler (gcc vs. > >> > intel vs. > >> > pgcc) > >> > > >> > > >> > This is achieved using __opal_attribute_deprecated__ and obviously > >> > needs to be > >> > added into mpi.h, therefore being a user-visible change. > >> > > >> > This however has a few caveats: > >> > 1.) Having Open MPI compiled with gcc and having users compiling > >> > with another > >> > compiler, which is not supporting __attribute__((deprecated)) is > >> > going to be a > >> > problem > >> > 2.) The attribute is most useful, when having a proper description > >> > (as above) > >> > -- which requires support for the optional argument to > >> > __deprecate__. This > >> > feature is offered only in gcc>4.4 (see http://gcc.gnu.org/ml/gcc- > >> > patches/2009-04/msg00087.html). > >> > > >> > > >> > Therefore, I added a configure-check for the compiler's support of the > >> > optional argument. > >> > And we need to store, which compiler is used to compile Open MPI and > >> > at (user- > >> > app) compile-time again check (within mpi.h), which compiler (and > >> > version!) is > >> > being used. > >> > This is then compared at user-level compile-time. > >> > > >> > To prevent users getting swamped with error msg. this can be turned > >> > off using > >> > the configure-option: > >> > --enable-mpi-interface-warning > >> > which turns on OMPI_WANT_MPI_INTERFACE_WARNING (default: DISabled), as > >> > suggested by Jeff. > >> > > >> > The user can however override that with (check mpi2basic_tests): > >> > mpicc -DOMPI_WANT_MPI_INTERFACE_WARNING -c lalala.c > >> > lots of warnings follow > >> > > >> > Please take a look into: > >> > http://bitbucket.org/jsquyres/ompi-deprecated/ > >> > > >> > > >> > With best regards, > >> > Rainer > >> > > >> > > >> > PS: > >> > Also, we need to disable the warning, when building Open MPI > >> > itselve ;-) > >> > > >> > PPS: > >> > Thanks to Paul Hargrove and Dan Bonachea for the GASnet file > >> > portable_platform.h which offers the CPP magic to figure out > >> > compilers and > >> > esp. compiler-versions. > >> > -- > >> > --- > >> > --------------------------------------------------------------------- > >> > Rainer Keller, PhD Tel: +1 (865) 241-6293 > >> > Oak Ridge National Lab Fax: +1 (865) 241-4811 > >> > PO Box 2008 MS 6164 Email: kel...@ornl.gov > >> > Oak Ridge, TN 37831-2008 AIM/Skype: rusraink > >> > > >> > _______________________________________________ > >> > devel mailing list > >> > de...@open-mpi.org > >> > http://www.open-mpi.org/mailman/listinfo.cgi/devel > >> > >> _______________________________________________ > >> devel mailing list > >> de...@open-mpi.org > >> http://www.open-mpi.org/mailman/listinfo.cgi/devel -- ------------------------------------------------------------------------ Rainer Keller, PhD Tel: +1 (865) 241-6293 Oak Ridge National Lab Fax: +1 (865) 241-4811 PO Box 2008 MS 6164 Email: kel...@ornl.gov Oak Ridge, TN 37831-2008 AIM/Skype: rusraink