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

fix string to long long int conversion #105

Closed psychocoderHPC closed 7 years ago

psychocoderHPC commented 7 years ago

fix that dimension of an array is parsed as 32bit integer

Before this fix it was not possible to define an array with dimension > 2^31-1

char dim[256];
uin64_t nx = 1024lu * 1024lu * 1024lu * 2lu + 128lu; // >2GiB array
snprintf (ldims, sizeof(ldims), "%d,%d", nx);
adios_define_var (gh, "x", "", adios_byte, dim, dim, 0);
psychocoderHPC commented 7 years ago

Error with wrong parsing function:

WARN : Cannot allocate 18446744071578845265 bytes for buffered output of group writer  because max allowed is 4294967296 bytes. Continue buffering with buffer size 4096 MB
WARN : Cannot allocate 18446744071562069073 bytes for buffered output of group writer  because max allowed is 4294967296 bytes. Continue buffering with buffer size 4096 MB
ERROR: adios_write(): buffer cannot accommodate variable /x with its storage size of 18446744071562068049 bytes at all. No more variables will be written.
terminate called after throwing an instance of 'std::runtime_error'
  what():  ADIOS: error at cmd 'adios_write_byid(fh, id, src)' (-103, -103) in main.cpp:116 adios_write(): buffer cannot accommodate variable /x with its storage size of 18446744071562068049 bytes at all. No more variables will be written.
pnorbert commented 7 years ago

Merged manually after adding error checking and error messages and also did it for local dimension, offsets and time-aggregation buffer size