Comments (7)
I would do this in a clean code. However, the adios_var_struct->data pointer is used for different things (read buffer in old adios_read, transformed variable instead of the original) and I am not able to safely separate them. This will stay open for a while...
from adios.
Thank you for looking into this.
So are there any circumstances under which it is safe to assume that the data pointed to by var will not be modified by ADIOS? I'm not familiar with what adios_var_struct->data is and how it relates to the data I am passing in to adios_write, but I don't believe I have any variable transformations (I'm just dumping raw data), and I am only concerned with adios_write, not adios_read. If it is safe under those circumstances, then it saves the expense of my code allocating and copying into a temporary buffer.
from adios.
Ah yes, ADIOS does not touch the user data in adios_write() in any
circumstances. It will actually copy data into a buffer (for buffered I/O).
If you buffer too, that is a complete waste of memory. The input arguments
should have been const void * from the beginning, it's just so much harder
to clean this up after several developers grabbing it for their own
purposes over the years :-(
On Mon, May 12, 2014 at 11:50 AM, Andrew Corrigan
[email protected]:
Thank you for looking into this.
So are there any circumstances under which it is safe to assume that the
data pointed to by var will not be modified by ADIOS? I'm not familiar with
what adios_var_struct->data is and how it relates to the data I am passing
in to adios_write, but I don't believe I have any variable transformations
(I'm just dumping raw data), and I am only concerned with adios_write, not
adios_read. If it is safe under those circumstances, then it saves the
expense of my code allocating and copying into a temporary buffer.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-42849679
.
from adios.
Just a thought, since adios_write is really just a wrapper function around
the internal "common" layer, and nowadays it is guaranteed to treat the
data buffer as if it were const, couldn't the signature of adios_write
simply be changed to const void data, and then data be cast to void
before passing to the internal layer? It's a bit ugly, but I believe this
has perfectly well-defined behavior in C, since the buffer is never
actually modified.
- Drew
On May 12, 2014 11:55 AM, "pnorbert" [email protected] wrote:
Ah yes, ADIOS does not touch the user data in adios_write() in any
circumstances. It will actually copy data into a buffer (for buffered
I/O).
If you buffer too, that is a complete waste of memory. The input arguments
should have been const void * from the beginning, it's just so much harder
to clean this up after several developers grabbing it for their own
purposes over the years :-(On Mon, May 12, 2014 at 11:50 AM, Andrew Corrigan
[email protected]:Thank you for looking into this.
So are there any circumstances under which it is safe to assume that the
data pointed to by var will not be modified by ADIOS? I'm not familiar
with
what adios_var_struct->data is and how it relates to the data I am
passing
in to adios_write, but I don't believe I have any variable
transformations
(I'm just dumping raw data), and I am only concerned with adios_write,
not
adios_read. If it is safe under those circumstances, then it saves the
expense of my code allocating and copying into a temporary buffer.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42849679>
.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-42850390
.
from adios.
I am trying to get rid of the many compiler warnings, not to add new ones.
On Mon, May 12, 2014 at 12:49 PM, daboyuka [email protected] wrote:
Just a thought, since adios_write is really just a wrapper function around
the internal "common" layer, and nowadays it is guaranteed to treat the
data buffer as if it were const, couldn't the signature of adios_write
simply be changed to const void data, and then data be cast to void
before passing to the internal layer? It's a bit ugly, but I believe this
has perfectly well-defined behavior in C, since the buffer is never
actually modified.
- Drew
On May 12, 2014 11:55 AM, "pnorbert" [email protected] wrote:Ah yes, ADIOS does not touch the user data in adios_write() in any
circumstances. It will actually copy data into a buffer (for buffered
I/O).
If you buffer too, that is a complete waste of memory. The input
arguments
should have been const void * from the beginning, it's just so much
harder
to clean this up after several developers grabbing it for their own
purposes over the years :-(On Mon, May 12, 2014 at 11:50 AM, Andrew Corrigan
[email protected]:Thank you for looking into this.
So are there any circumstances under which it is safe to assume that
the
data pointed to by var will not be modified by ADIOS? I'm not familiar
with
what adios_var_struct->data is and how it relates to the data I am
passing
in to adios_write, but I don't believe I have any variable
transformations
(I'm just dumping raw data), and I am only concerned with adios_write,
not
adios_read. If it is safe under those circumstances, then it saves the
expense of my code allocating and copying into a temporary buffer.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42849679>
.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42850390>
.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-42857236
.
from adios.
Definitely understandable. I'm fairly sure explicit casting never triggers
warnings, though, so maybe it's still something to keep in mind as a
potential option down the road.
- Drew
On Mon, May 12, 2014 at 1:00 PM, pnorbert [email protected] wrote:
I am trying to get rid of the many compiler warnings, not to add new ones.
On Mon, May 12, 2014 at 12:49 PM, daboyuka [email protected]
wrote:Just a thought, since adios_write is really just a wrapper function
around
the internal "common" layer, and nowadays it is guaranteed to treat the
data buffer as if it were const, couldn't the signature of adios_write
simply be changed to const void data, and then data be cast to void
before passing to the internal layer? It's a bit ugly, but I believe
this
has perfectly well-defined behavior in C, since the buffer is never
actually modified.
- Drew
On May 12, 2014 11:55 AM, "pnorbert" [email protected] wrote:Ah yes, ADIOS does not touch the user data in adios_write() in any
circumstances. It will actually copy data into a buffer (for buffered
I/O).
If you buffer too, that is a complete waste of memory. The input
arguments
should have been const void * from the beginning, it's just so much
harder
to clean this up after several developers grabbing it for their own
purposes over the years :-(On Mon, May 12, 2014 at 11:50 AM, Andrew Corrigan
[email protected]:Thank you for looking into this.
So are there any circumstances under which it is safe to assume that
the
data pointed to by var will not be modified by ADIOS? I'm not
familiar
with
what adios_var_struct->data is and how it relates to the data I am
passing
in to adios_write, but I don't believe I have any variable
transformations
(I'm just dumping raw data), and I am only concerned with
adios_write,
not
adios_read. If it is safe under those circumstances, then it saves
the
expense of my code allocating and copying into a temporary buffer.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42849679>
.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42850390>
.—
Reply to this email directly or view it on GitHub<
https://github.com/ornladios/ADIOS/issues/9#issuecomment-42857236>
.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-42858503
.
from adios.
This has been fixed in 1.9.0
from adios.
Related Issues (20)
- ADIOS_READ_METHOD_BP_AGGREGATE not working in read API HOT 1
- bpdump crash on attribute file written by machine of different en HOT 4
- runconfig fail on theta@alcf HOT 3
- Numpy: Slicing is missing the stepping HOT 4
- python 3 support broken by print statements HOT 1
- SZ transformation build error HOT 2
- adios_mpi.cpp doesn't work with Python 3.7 HOT 2
- Support ZFP 0.5.1+ HOT 2
- Possible bug in bp2ncd utility HOT 1
- GFortran 10 Argument Mismatch HOT 2
- Question about timers HOT 4
- ADIOS Spack package broken on Summit HOT 5
- ZFP_INCLUDE_DIR not set HOT 1
- Compilation error HOT 6
- Attribute of Array of Complex
- Python DeprecationWarning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead HOT 1
- Python: wrapper of adios.File close errors
- Python 3.9 Build Error HOT 15
- Bug writing empty data sets? HOT 13
- Subsetting Data for in situ visualization HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adios.