[petsc-users] long int

Mohammad Mirzadeh mirzadeh at gmail.com
Sun Jun 12 17:58:26 CDT 2011


Thanks guys. This is helpful. Actually I am using a Linux 64-bit OS and my
tests show that on my system:

sizeof(int) = 4
sizeof(long int) = 8
sizeof(long long int) = 8

So as Jed was saying on my system long int is the same as long long int and
I need the --with-64-bit-indices flag. But if it leads to too much cost I'm
willing to change it back to int as currently I wont have 2B points on each
processor

Thanks again



On Sun, Jun 12, 2011 at 11:47 AM, Jed Brown <jed at 59a2.org> wrote:

> On Sun, Jun 12, 2011 at 20:35, Mohammad Mirzadeh <mirzadeh at gmail.com>wrote:
>
>> On Jun 12, 2011 11:33 AM, "Mohammad Mirzadeh" <mirzadeh at gmail.com> wrote:
>> > Thanks Barry. Problem is my indices are all long and if I use the with
>> petsc
>> > the compiler will complain. Do you think casting them to int will solve
>> the
>> > problem?
>>
>
> No, if your code is hard-coded to work with "long" and you are on a LP64
> platform (e.g. 64-bit x86 Linux or OS-X), then you must use
> --with-64-bit-indices.
>
> Note that hard-coding long may make your code non-portable to an LLP64
> platform like 64-bit Windows. In any case, you would *not* use
> --with-64-bit-indices there because long is the same as int on LLP64.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110612/25293089/attachment.htm>


More information about the petsc-users mailing list