jedbrown at mcs.anl.gov
Thu Dec 5 11:13:40 CST 2013
"N.M. Maclaren" <nmm1 at cam.ac.uk> writes:
> Eh? I was saying that you shouldn't bet on pointers being treated the
> same as integers in all common calling conventions. I am not familiar
> with ALL current calling conventions - and remember that many ports
> work from the distributed base of OpenMP and MPICH, so are not within
> the platforms in the distributed source.
Let's not let the perfect be the enemy of the practical. The simple
fact is that there would be a huge benefit to users and packagers if
just MPICH and Open MPI had a common ABI on x86/x86-64, and perhaps ARM
in the coming years. I never said it made sense to add to the standard.
> As I said, this most definitely used NOT to be the case until quite
> recently, and I have no evidence that it has changed! Furthermore,
> this is NOT purely a hardware matter, and several of the differences I
> remember were entirely due to the compiler's choices.
Calling convention is the compiler's choice, but if the arithmetic unit
is the same for integers and pointers, compilers seem happy to treat
them the same.
> There is no such concept in the C standard. They are not initialization
> constants (the relevant concept), as can be seen by failing to compile:
> typedef int MPI_Datatype;
> extern const MPI_Datatype MPI_INT;
> static MPI_Datatype weeble = MPI_INT;
> with gcc -std=c99 -pedantic -Wall -Wextra -O3 -c.
You're right, I was thinking of pointers to arrays, which can be
initialized this way
typedef const int *MPI_Datatype;
extern const int MPI_INT;
static MPI_Datatype weeble = MPI_INT;
But this is indeed a different model because it requires a pointer
> Eh? I said that there were differences between MPI implementations, and
> by that I meant their semantics.
Different run-time semantics is a source-level "incompatibility" as
well. Many projects deal with that just fine, so why can't the deal at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 835 bytes
Desc: not available
More information about the mpi-forum