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

2019-08-18 Thread N.M. Maclaren via mpi-forum
On Aug 17 2019, Jed Brown via mpi-forum wrote: I don't want to go over old ground, but I feel these statements need a bit of balancing. They might even build using -Wconversion (with a C11 compiler) as a diagnostic to check that they have used MPI_Count everywhere that it is needed. But the fa

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

2019-08-17 Thread Jed Brown via mpi-forum
Joseph Schuchart via mpi-forum writes: >> I'm not taking a position on C11 _Generic in the standard, but it would >> significantly reduce the configure complexity for apps to upgrade to >> MPI_Count without dropping support for previous standards. > > I don't see how C11 _Generic will make life e

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

2019-08-15 Thread N.M. Maclaren via mpi-forum
On Aug 15 2019, Joseph Schuchart via mpi-forum wrote: On 8/13/19 5:54 AM, Jed Brown via mpi-forum wrote: Few packages will accept a hard dependency on MPI-4 for at least 10 years. MS-MPI still doesn't fully support MPI-2.1, for example, and PETSc only recently began requiring MPI-2.0. That i

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

2019-08-15 Thread Joseph Schuchart via mpi-forum
Jed, On 8/13/19 5:54 AM, Jed Brown via mpi-forum wrote: "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.

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 ha

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 thankful

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 c

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

2019-08-08 Thread Jim Dinan via mpi-forum
The polymorphic C front-end (i.e. macros) can be bypassed by talking a pointer to the underlying function [1]. This is the desired behavior for backward compatibility. I agree that this could be surprising to users and it must be clearly documented. In the case where the user is not bypassing th

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 Urbana-Champ

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 r

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 (0

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 D

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 > M

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 = 858993459

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

2019-08-07 Thread Jeff Hammond via mpi-forum
I don't care that much about C11 _Generic, which is why I have always focused on a C99 solution to the large-count problem, but I disagree with your reasons for abandoning it. "silently truncated at run time" is trivially addressed with -Wconversion or -Wshorten-64-to-32. The example program belo

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 finaliza

[Mpi-forum] Giving up on C11 _Generic

2019-08-07 Thread Jeff Squyres (jsquyres) via mpi-forum
SHORT VERSION = Due to the possibility of silently introducing errors into user applications, the BigCount WG no longer thinks that C11 _Generic is a good idea. We are therefore dropping that from our proposal. The new proposal will therefore essentially just be the addition of a