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

long long missing in adios_types.h #187

Open ax3l opened 5 years ago

ax3l commented 5 years ago

Although long long and unsigned long long are basic/fundamental C (& C++) types, there are only:

                     ,adios_byte = 0                 /* (1) */
                     ,adios_short = 1                /* (2) */
                     ,adios_integer = 2              /* (4) */
                     ,adios_long = 4                 /* (8) */

                     ,adios_unsigned_byte = 50       /* (1) */
                     ,adios_unsigned_short = 51      /* (2) */
                     ,adios_unsigned_integer = 52    /* (4) */
                     ,adios_unsigned_long = 54 /* (8) */

in adios_types.h

Can you add support for adios_long_long and adios_unsigned_long_long?

Also, the (size) comment in those lines is platform specific. E.g. ADIOS1 works well on OSX, where long is the same size as an int. You will need adios_long_long to describe an 8-byte int there.

cc @pnorbert

ax3l commented 5 years ago

Ok, I think I understand what you did there.

adios_short is actually on all 8-bit=1byte systems adios_int16_t, adios_integer on all 8-bit=1byte systems adios_int32_t and adios_long on all 8-bit=1byte systems adios_int64_t?

(Same for unsigned and floating points.)

pnorbert commented 5 years ago

Exactly. This approach, however, put the task on the user to make sure the correct type is chosen. In adios 2.x, the C++ API lets the user to use the C++ types.

On Sat, Sep 8, 2018, 4:43 AM Axel Huebl notifications@github.com wrote:

Ok, I think I understand what you did there.

adios_short is actually a platform independent adios_int16_t, adios_integer a platform independent adios_int32_t and adios_long a platform independent adios_int64_t?

(Same for unsigned and floating points.)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/187#issuecomment-419624224, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLb0mkeaR4sGVJu6qQhLJEP8rkprJks5uY4MjgaJpZM4Wemi8 .

ax3l commented 5 years ago

@pnorbert alright, thanks! And you assume that a Byte is 8 Bit (CHAR_BIT == 8), otherwise it's not portable? Just checking the corner cases :)

pnorbert commented 5 years ago

in adios 1.x, adios_byte simply means 8 bit. The user needs to make the mapping between memory type to the adios type. You would need to store a 16 bit wide character string as a adios_short array manually.

On Mon, Sep 10, 2018 at 11:57 AM Axel Huebl notifications@github.com wrote:

@pnorbert https://github.com/pnorbert alright, thanks! And you assume that a Byte is 8 Bit (CHAR_BIT == 8), otherwise it's not portable? Just checking the corner cases :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/187#issuecomment-419964381, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLfVTPTmQhBxsh3IFmnZpttOfVk1Kks5uZovegaJpZM4Wemi8 .

ax3l commented 5 years ago

@pnorbert alright, thanks.

Another question: what's the recommended type in adios 1 to represent C++ bools? We are in the last years mapping them to unsigned chars, but allowing a bool equivalent in meta data would be great to differentiate properly in reads.

pnorbert commented 5 years ago

Well, just that, unsigned char.

On Thu, Sep 13, 2018, 3:35 PM Axel Huebl notifications@github.com wrote:

@pnorbert https://github.com/pnorbert alright, thanks.

Another question: what's the recommended type in adios 1 to represent C++ bools? We are currently mapping them to unsigned chars, but allowing a bool equivalent in meta data would be great to differentiate properly in reads.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/187#issuecomment-421126429, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLcbXZEXdY8srKmEQioCObPr6DyPdks5uarN8gaJpZM4Wemi8 .