Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-12 Thread Jed Brown via mpi-forum
"Jeff Squyres \(jsquyres\) via mpi-forum" writes: > Let me ask a simple question: how will users to write portable MPI programs > in C with large count values? > > Answer: they will explicitly call MPI_Send_x(), and not rely on C11 _Generic. Few packages will accept a hard dependency on MPI-4

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread Jeff Squyres (jsquyres) via mpi-forum
Some points: 1. C11 _Generic support in an MPI implementation has to be optional, at least for now, because not all compilers support C11 _Generic (just like the F08 bindings are still optional, and just like aspects of the C++ bindings were optional back in the '90s when C++ compilers still

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread N.M. Maclaren via mpi-forum
On Aug 8 2019, Jeff Hammond wrote: That you use code that does unsafe conversions really has nothing to do with the business of the MPI Forum. Again, if you think C89 is the best C, then use and teach that. No one here is trying to make you use C11. Please don't be infantile. I am

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread Jim Dinan via mpi-forum
In fairness, unsafe conversions are a feature of the C language, I assume since very early on. Assignment gets a pass to do horribly unsafe conversions. Unfortunately, when calling a function (with a prototype), the argument expressions are converted as if by assignment, which is the underlying

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread Jeff Hammond via mpi-forum
That you use code that does unsafe conversions really has nothing to do with the business of the MPI Forum. Again, if you think C89 is the best C, then use and teach that. No one here is trying to make you use C11. Jeff > On Aug 8, 2019, at 5:56 AM, N.M. Maclaren via mpi-forum > wrote: >

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread N.M. Maclaren via mpi-forum
On Aug 7 2019, Jeff Squyres (jsquyres) via mpi-forum wrote: After much debate, the BigCount WG has decided that C11 _Generic just isn't worth it. That's no reason to penalize Fortran, though. That is certainly the simplest solution. There may be others, but see below. At a wild guess, this

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread Gropp, William D via mpi-forum
That -Wall is a lie is also true for gcc. Yes, this is a extremely poor design. If you want to provide -Wmostcommon then do that (and maybe abbreviate to -Wmost). Bill William Gropp Director and Chief Scientist, NCSA Thomas M. Siebel Chair in Computer Science University of Illinois

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread HOLMES Daniel via mpi-forum
Hi JeffH, After a brief search that I never knew was necessary, I find that “all” is smaller than “everything” in clang world. http://clang.llvm.org/docs/UsersManual.html#enabling-all-diagnostics So, my question “why isn’t -Wconversion implied by -Wall?” might have an astonishing answer. The

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-08 Thread HOLMES Daniel via mpi-forum
Hi Jim, Are we sure the function pointer “worked" in your example? It silently truncated the large value, because the function pointer bypasses the redirection macro. Cheers, Dan. — Dr Daniel Holmes PhD Architect (HPC Research) d.hol...@epcc.ed.ac.uk Phone: +44

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jim Dinan via mpi-forum
That case should not have the implicit type conversion issue that Joseph raised and should be fine without the extra macro when _Generic is unsupported. On Wed, Aug 7, 2019, 5:43 PM Jeff Hammond wrote: > You can't do that forwarding for vectors of counts. > > On Wed, Aug 7, 2019 at 2:10 PM Jim

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jeff Hammond via mpi-forum
You can't do that forwarding for vectors of counts. On Wed, Aug 7, 2019 at 2:10 PM Jim Dinan via mpi-forum < mpi-forum@lists.mpi-forum.org> wrote: > Even simpler than this, we could just forward all calls to the MPI_Count > interface (see below). The int count argument should type convert to >

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jim Dinan via mpi-forum
Even simpler than this, we could just forward all calls to the MPI_Count interface (see below). The int count argument should type convert to MPI_Count without issue. Note that it still needs to be a function-like macro so that function pointers work. Don't give up yet! :D ~Jim. #include

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jim Dinan via mpi-forum
This example is a bit more representative of how we would use this to implement the MPI bindings (renamed "bar" macro to "foo" and shifted down to enable the name aliasing): #include static void foo(int j) { printf("foo(j) = %d\n", j); } #define foo(j) foo(sizeof(j) > sizeof(int) ? -1

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jim Dinan via mpi-forum
Jeff, You can wrap the function in a macro that checks for truncation: #include #define bar(j) foo(sizeof(j) > sizeof(int) ? -1 : j) static void foo(int j) { printf("foo(j) = %d\n", j); } int main(int argc, char *argv[]) { /* 8589934592LL == 2^33 */ long long i =

Re: [Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Anthony Skjellum via mpi-forum
Jeff, I don't think we all agree 100% to abandon C11 _Generic, and let me feedback to you what you write below for further argumentation; I am a bit surprised this is in front of the whole forum just one day after WG discussions, when more WG discussions are still in order weeks before the