ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

ADIOS_DATATYPES missing long long #153

Closed burlen closed 6 years ago

burlen commented 6 years ago

not sure if this is intentional or not, but from the perspective of trying to integrate other library's data structures which make use of long long with ADIOS it seems to be an omission. according to c99 long is at least 32 bits and long long is at least 64 bits, so there could be (admittedly rare) cases when the two are not the same size.

pnorbert commented 6 years ago

adios_long is always 64bit adios_integer is always 32bit no exceptions

On Tue, Nov 7, 2017 at 10:36 AM Burlen Loring notifications@github.com wrote:

not sure if this is intentional or not, but from the perspective of trying to integrate other library's data structures which make use of long long with ADIOS it seems to be an omission. according to c99 long is at least 32 bits and long long is at least 64 bits, so there could be (admittedly rare) cases when the two are not the same size.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/153, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLZdMxRtcc9MAIZUO3MVLehnnYVqVks5s0JUxgaJpZM4QVLHq .

burlen commented 6 years ago

OK, works for me

burlen commented 6 years ago

Although I wonder then what happens on a system where long is 32 bits? My inclination would be to always map long to adios_long. But in ADIOS API void* is used, and it would catastrophic to pass a long(32 bits) and tell ADIOS it's adios_long(64 bits). I think ADIOS is doing a confusing thing here.

burlen commented 6 years ago

For instance here's a code snippet

  96   else if (dynamic_cast<vtkLongArray*>(da))
  97     {
  98     return adios_long;
  99     }

I will have to modify to this

  96   else if (dynamic_cast<vtkLongArray*>(da))
  97     {
  ++     if (sizeof(long) == 4)
  ++       return adios_integer; // always 32 bits
  98     return adios_long; // always 64 bits
  99     }
burlen commented 6 years ago

so rather than being equivalent their C counterparts, adios_integer is equivalent to int32_t, and adios_long is equivalent to int64_t this info would be a good addition to user manual