At great personal expense, I have put together the following test code which I
now make freely available to everyone:
#include <stdio.h>
main()
{
printf("sizeof(char) = %d\n", sizeof(char));
printf("sizeof(short) = %d\n", sizeof(short));
printf("sizeof(int) = %d\n", sizeof(int));
printf("sizeof(long) = %d\n", sizeof(long));
printf("sizeof(long long) = %d\n", sizeof(long long));
printf("sizeof(float) = %d\n", sizeof(float));
printf("sizeof(double) = %d\n", sizeof(double));
printf("sizeof(long double) = %d\n", sizeof(long double));
}
I built and ran this code under three different environemnts:
(a) MIPS O32
> cc -o32 test.c
cfe: Warning 728: mpi.c, line 12: Long double not supported; double assumed.
printf("sizeof(long double) = %d\n", sizeof(long double));
--------------------------------------------^
> a.out
sizeof(char) = 1
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 4
sizeof(long long) = 8
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 8
(b) MIPS N32
> cc -n32 test.c
> a.out
sizeof(char) = 1
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 4
sizeof(long long) = 8
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 16
(c) MIPS 64
> cc -64 mpi.c
> a.out
sizeof(char) = 1
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 8
sizeof(long long) = 8
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 16
Conclusion:
Since o32 is for legacy codes only, a 16-byte MPI_LONG_DOUBLE would be the
appropriate size for us.
Next vendor...
-- Eric Salo Silicon Graphics Inc. salo@sgi.com