[mpich-discuss] about long int number
Jayesh Krishna
jayesh at mcs.anl.gov
Tue Feb 10 11:43:18 CST 2009
Hi,
I would recommend using MPI datatypes for your problem (eg: Creating a
vector, see MPI_Type_vector(), with say 2 ints, you can send MAX_INT*2
integers).
Let us know if you need further help.
(PS: The sizes of the various built-in language datatypes, like int,
depends on the data model adopted by the compiler. Using say the Visual
studio compiler, cl.exe, you should get 4-byte ints, i.e., MAX_INT = 2^31
- 1.)
Regards,
Jayesh
-----Original Message-----
From: Wei Yao [mailto:weiyao1 at googlemail.com]
Sent: Tuesday, February 10, 2009 2:31 AM
To: Jayesh Krishna
Subject: about long int number
Dear Jayesh Krishna,
In C and Fortran, the memory allocation for integer number are
different:
1, in C int a, a takes 2 bytes with the range of -32768~32767.
2, in FORTRAN, integer a, a takes 4 bytes with the range of
-2147483648~2147483647.
If I have an array with a length of 40000, I want to manipulate is use
MPI_REDUCE, but the maximum count is 32767, how can I transfer a
40000-members array?
int MPI_Reduce(void* , void*, int count, MPI_Datatype, MPI_Op, int,
MPI_Comm);
~~~~~~~maximum 32767
_______________________
Cheers,
Wei
>From FireSERT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20090210/8b2e3f5a/attachment.htm>
More information about the mpich-discuss
mailing list