Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-11-01 Thread Kenneth A. Lloyd
-boun...@open-mpi.org [mailto:devel-boun...@open-mpi.org] On Behalf Of Paul Hargrove Sent: Wednesday, October 31, 2012 12:48 PM To: Open MPI Developers Subject: Re: [OMPI devel] Compile-time MPI_Datatype checking Note that with Apple's latest versions of Xcode (4.2 and higher, IIRC) Clang is now

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Dmitri Gribenko
On Wed, Oct 31, 2012 at 9:04 PM, Ralph Castain wrote: > Understood, but also remember that the national labs don't have Mac clusters > - and so they couldn't care less about Clang. Clang is also the new system compiler for FreeBSD. But there are not many FreeBSD clusters

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Paul Hargrove
Note that with Apple's latest versions of Xcode (4.2 and higher, IIRC) Clang is now the default C compiler. I am told that Clang is the ONLY bundled compiler for OSX 10.8 (Mountain Lion) unless you take extra steps to install gcc (which is actually llvm-gcc and cross-compiles for OSX 10.7). So,

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Ralph Castain
If it's only on for Clang, I very much doubt anyone will care - I'm unaware of any of our users that currently utilize that compiler, and certainly not on the clusters in the national labs (gcc, Intel, etc. - but I've never seen them use Clang). Not saying anything negative about Clang - just

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Dmitri Gribenko
On Wed, Oct 31, 2012 at 5:04 PM, Jeff Squyres wrote: > On Oct 31, 2012, at 9:38 AM, Dmitri Gribenko wrote: > >>> The rationale here is that correct MPI applications should not need to add >>> any extra compiler files to compile without warnings. >> >> I would disagree with

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Jeff Squyres
On Oct 31, 2012, at 9:38 AM, Dmitri Gribenko wrote: >> The rationale here is that correct MPI applications should not need to add >> any extra compiler files to compile without warnings. > > I would disagree with this. Compiler warnings are most useful when > they are on by default. Only a

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Jeff Squyres
On Oct 31, 2012, at 3:45 AM, Dmitri Gribenko wrote: >> With this patch, they'd get warnings about these uses, even though they are >> completely valid according to MPI. >> >> A suggestion was that this functionality could be disabled by default, and >> enabled with a magic macro. Perhaps

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-31 Thread Dmitri Gribenko
On Wed, Oct 31, 2012 at 4:25 AM, Jeff Squyres wrote: > On Oct 28, 2012, at 10:28 AM, Dmitri Gribenko wrote: > >> Thank you for the feedback! Hopefully the attached patch fixes both of >> these. >> >> 1. There are two helper structs with complex numbers. I predicated >> the

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-30 Thread Jeff Squyres
On Oct 28, 2012, at 10:28 AM, Dmitri Gribenko wrote: > Thank you for the feedback! Hopefully the attached patch fixes both of these. > > 1. There are two helper structs with complex numbers. I predicated > the struct declarations and use to appear only in C99. > > 2. These macros were indeed

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-19 Thread Dmitri Gribenko
On Thu, Oct 18, 2012 at 7:32 PM, Jeff Squyres wrote: > On Oct 7, 2012, at 2:25 PM, Dmitri Gribenko wrote: >> I tried to follow your advice about Fortran datatypes and updated the >> patch accordingly (attached). This patch is against OpenMPI 1.9. >> Please review. > >

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-18 Thread Dmitri Gribenko
On Thu, Oct 18, 2012 at 7:32 PM, Jeff Squyres wrote: > On Oct 7, 2012, at 2:25 PM, Dmitri Gribenko wrote: > Hmm. I'm not sure how to do that -- I don't know of any C compiler that has > built-in #defines for what Fortran types exist. > > I'm open to suggestions, though --

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-18 Thread Jeff Squyres
On Oct 7, 2012, at 2:25 PM, Dmitri Gribenko wrote: >> Ok, this might get a little complicated. You'll probably need to use a pair >> of them (this is trunk only; it's different in v1.6 because we wholly >> revamped the trunk's Fortran support recently): >> >> 1. You can see all the

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-18 Thread Dmitri Gribenko
Dear OpenMPI developers, Could someone please review the attached patch? Dmitri On Sun, Oct 7, 2012 at 9:25 PM, Dmitri Gribenko wrote: > On Thu, May 31, 2012 at 2:38 PM, Jeff Squyres wrote: >> On May 31, 2012, at 7:29 AM, Jeff Squyres wrote: >> >

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-10-07 Thread Dmitri Gribenko
On Thu, May 31, 2012 at 2:38 PM, Jeff Squyres wrote: > On May 31, 2012, at 7:29 AM, Jeff Squyres wrote: > We should have AC macros for all of these already. >>> >>> OK, I'll try find them to support (1) usecase described below. >> >> No, I'll find them -- sorry, I meant

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-31 Thread Jeff Squyres
On May 31, 2012, at 7:29 AM, Jeff Squyres wrote: >>> We should have AC macros for all of these already. >> >> OK, I'll try find them to support (1) usecase described below. > > No, I'll find them -- sorry, I meant to look them up before I sent the last > mail. Let me look them up and get back

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-31 Thread Dmitri Gribenko
On Thu, May 31, 2012 at 2:29 PM, Jeff Squyres wrote: > Ah, good point.  But in those cases, MPI specifically defines that those > arguments are wholly ignored on non-root processes.  So you could still even > pass <, MPI_DATATYPE_NULL>, or , and it would be

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-31 Thread Jeff Squyres
On May 31, 2012, at 7:22 AM, Dmitri Gribenko wrote: >> I can't think of a case offhand where it's acceptable to pass >> MPI_DATATYPE_NULL to an MPI function. I could be missing something, >> though... (actually, I guess I can think of some cases -- we have some >> regression test programs

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-31 Thread Dmitri Gribenko
On Thu, May 31, 2012 at 2:07 PM, Jeff Squyres wrote: > On May 30, 2012, at 7:04 PM, Dmitri Gribenko wrote: >> +must_be_null specifies that the expression should be a null >> +pointer constant, for example: >> + >> + >> + >> +/* In mpi.h */ >> +extern struct mpi_datatype

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-31 Thread Jeff Squyres
On May 30, 2012, at 7:04 PM, Dmitri Gribenko wrote: > +must_be_null specifies that the expression should be a null > +pointer constant, for example: > + > + > + > +/* In mpi.h */ > +extern struct mpi_datatype mpi_datatype_null > +__attribute__(( type_tag_for_datatype(mpi, void, must_be_null)

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-30 Thread Dmitri Gribenko
Hi Jeff, On Thu, May 31, 2012 at 12:57 AM, Jeff Squyres wrote: > I've reviewed the patch.  Good stuff! Thank you very much for the review. Answers to comments below. Updated patch attached. *** JMS What do the 3-argument forms of type_tag_for_datatype() do? They aren't

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-30 Thread Jeff Squyres
I've reviewed the patch. Good stuff! I annotated your patch file -- see attached for my comments. Search for "*** JMS" (my initials). On May 29, 2012, at 11:08 AM, Dmitri Gribenko wrote: > Hello, > > I've implemented a patch for clang that enables compile-time checking > of

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-05-29 Thread Jeff Squyres
Sweet! I downloaded clang 3.1 and added it to my nightly regression testing for the OMPI SVN trunk and v1.6 branch. We'd only be able to accept this patch for the SVN trunk (i.e., what will become v1.7) -- the v1.6 series is closed for new features. I'm pretty fried right now (end of a long

[OMPI devel] Compile-time MPI_Datatype checking

2012-05-29 Thread Dmitri Gribenko
Hello, I've implemented a patch for clang that enables compile-time checking of arguments to functions. When applied to MPI, this enables the compiler to check that buffer type and MPI_Datatype match. Latest version of clang patch can be found here. [1] Please note that

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-02-02 Thread Dmitri Gribenko
On Thu, Feb 2, 2012 at 7:31 AM, Christopher Samuel wrote: > On 29/01/12 10:07, Dmitri Gribenko wrote: >> My colleague and I want to implement a compile-time check (warning) >> for clang compiler that specified buffer type matches passed >> MPI_Datatype. > > Interesting, is

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-02-02 Thread Christopher Samuel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 29/01/12 10:07, Dmitri Gribenko wrote: > My colleague and I want to implement a compile-time check (warning) > for clang compiler that specified buffer type matches passed > MPI_Datatype. Interesting, is it possible to do the same for GCC with

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-02-01 Thread Jeff Squyres
On Feb 1, 2012, at 5:36 PM, Dmitri Gribenko wrote: >> Depending on the patch, however, we might need a signed Open MPI >> contribution agreement from you/your employer > > That's fine for us. Excellent. :-) It all sounds good to me! -- Jeff Squyres jsquy...@cisco.com For corporate

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-02-01 Thread Dmitri Gribenko
On Wed, Feb 1, 2012 at 10:01 PM, Jeff Squyres wrote: > On Jan 28, 2012, at 6:07 PM, Dmitri Gribenko wrote: >> Here's what is required on the OpenMPI part: all MPI functions that >> accept a buffer and MPI_Datatype should be annotated with >> mpi_typed_arg(buffer-arg-index,

Re: [OMPI devel] Compile-time MPI_Datatype checking

2012-02-01 Thread Jeff Squyres
On Jan 28, 2012, at 6:07 PM, Dmitri Gribenko wrote: > My colleague and I want to implement a compile-time check (warning) > for clang compiler that specified buffer type matches passed > MPI_Datatype. Interesting! > Here's what is required on the OpenMPI part: all MPI functions that > accept a

[OMPI devel] Compile-time MPI_Datatype checking

2012-01-28 Thread Dmitri Gribenko
Hello, My colleague and I want to implement a compile-time check (warning) for clang compiler that specified buffer type matches passed MPI_Datatype. For example: MPI_Send(long_buf, 1, MPI_INT, 1, 1, MPI_COMM_WORLD); // expected-warning {{actual buffer element type 'long' doesn't match