-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming Read: Segfault on Close w/o Explicit Flush #994
Comments
Thanks for the report! CCing @franzpoeschel: do you think the API contract for Erik, so far (pre |
That workflow is supposed to be possible, if it fails that is a bug. Series readSeries( file, Access::READ_ONLY );
{
std::vector< int > buffer( 1000, -1 );
auto iter = *readSeries.readIterations().begin();
iter.meshes[ "E" ][ "x" ].loadChunk(
std::shared_ptr< int >{ buffer.data(), []( auto const * ) {} },
Offset{ 0 },
Extent{ 1000 } );
std::cout << "BEFORE: [" << buffer[ 0 ] << ", ..., " << buffer[ 999 ]
<< "]" << std::endl;
iter.close();
std::cout << "AFTER: [" << buffer[ 0 ] << ", ..., " << buffer[ 999 ]
<< "]" << std::endl;
} And also that works as expected. Can you share a failing code sample and the version of openPMD that you are using? It should be noted that using |
@eschnett one thing you could do is modify the linked test and open that as a demonstrator PR, so we can debug the logic that you use together. |
I experienced a similar issue today and I think I have found a solution for that one. Will open a PR, maybe that could also fix your problem. |
I am trying to read data from a file. I create a
Series
and the iteration viareadIters = series->readIterations()
anditer = *readIters.begin()
. I schedule the reads vialoadChunk
, passing pointers to AMReX-allocated data structures.I then tried to perform the reads via
iter.close()
. This lead to a segfault.I can avoid the segfault by calling
series->flush()
before closing the iteration.The text was updated successfully, but these errors were encountered: