Skip to content
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

Not possible to read data from savepoint with metadata from Fortran? #241

Open
ofuhrer opened this issue Jun 20, 2020 · 10 comments
Open

Not possible to read data from savepoint with metadata from Fortran? #241

ofuhrer opened this issue Jun 20, 2020 · 10 comments

Comments

@ofuhrer
Copy link
Contributor

ofuhrer commented Jun 20, 2020

It seems that the Fortran interface is mostly meant for writing and not reading. To my understanding, it is not possible to read data from a savepoint with meta-data...

call fs_create_savepoint('sfc_sice-in', ppser_savepoint)
call fs_add_savepoint_metainfo(ppser_savepoint, 'ID', 1)

...will exit with an error saying that Serialbox: ERROR: savepoint 'sfc_sice-in {}' does not exist. While the above is ok for writing (specifying meta-data after creating a savepoint is ok), for reading this does not work.

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

This code is for writing. For reading there is fs_get_savepoint_metainfo.

@ofuhrer
Copy link
Contributor Author

ofuhrer commented Jun 24, 2020

Well, the error message actually occurrs on the fs_create_savepoint('sfc_sice-in', ppser_savepoint) which tries to open a savepoint WITHOUT metadata. The fs_add_savepoint_metainfo() is never reached. So my question remains the same, how can I access a specific savepoint with a given meta-data (e.g. ID=1)?

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

I think, I understand your problem now, and you're might be right that there is an issue.
Have you tried to open the savepoint as 'sfc_sice-in {ID=1}' or something like that?

@ofuhrer
Copy link
Contributor Author

ofuhrer commented Jun 24, 2020

That's my point. There's no API in Fortran for doing exactly that, afaik! Sorry for not phrasing my issue well enough...

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

But how does fs_create_savepoint knows whether it is called in write or read context?

@ofuhrer
Copy link
Contributor Author

ofuhrer commented Jun 24, 2020

I think the serializer object is either in read or write mode. But not sure...

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

But the serializer object is not passed to the subroutine.
Are you sure that the error is thrown by fs_create_savepoint? It's long time ago that I worked on Serialbox, but that behavior appears a bit strange to me. I think, the error should appear when you try to access some field with this savepoint.

@ofuhrer
Copy link
Contributor Author

ofuhrer commented Jun 24, 2020

Well the Fortran API exposed via m_serialize.f90 retains state internally by retaining the current serializer and savepoint objects.

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

Not afaik. The created objects are held by the client application and passed as parameters to the API routines.

@chovyy
Copy link
Contributor

chovyy commented Jun 24, 2020

Sorry, I meant arguments not parameters. Stupid Fortran... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants