In RBEvaluation::read_offline_data_from_files and
RBEvaluation::write_offline_data_to_files), we read/write from/to a bunch
of small Xdr files. I've always thought this is pretty messy and I've
wanted to find a better approach.

I think a better approach would be to use the Cap'n Proto
<https://capnproto.org/> serialization library. I've made a start on
implementing this here:
https://github.com/dknez/libmesh/tree/rb_capnproto

But before I go further with the implementation, I'd like to run this by
the list to confirm that this change can be incorporated into libMesh. Some
comments:

- Cap'n Proto requires C++11. My plan would be to make Cap'n Proto an
optional package, and to keep the current reduced basis read/write code if
C++11 and Cap'n Proto aren't available.

- We define a "schema" for the serialization format, e.g. see here:
https://github.com/dknez/libmesh/blob/rb_capnproto/include/reduced_basis/rb_data.capnp
Cap'n Proto then provides a tool to compile the schema into C++ code, which
yields these files:
https://github.com/dknez/libmesh/blob/rb_capnproto/include/reduced_basis/rb_data.capnp.h
https://github.com/dknez/libmesh/blob/rb_capnproto/src/reduced_basis/rb_data.capnp.C
So there is a question of what to include in the libMesh source tree (just
the schema file, or the generated code as well).

- Cap'n Proto provides a tool for "decoding" binary data:
https://capnproto.org/capnp-tool.html
This is useful for debugging, i.e. we can get an ASCII dump of the
serialized data by using the "capnp decode" command.

- The serialization code that I've written so far uses "auto" a lot, e.g.
see here:
https://github.com/dknez/libmesh/blob/rb_capnproto/src/reduced_basis/rb_data_serialization.C
This is convenient since otherwise we would have to write out a lot of
Cap'n Proto type names in the code. Using auto relies on C++11, but this
seems OK to me since we have to have C++11 if we're using Cap'n Proto (and
we would if-def out this code if we didn't configure with Cap'n Proto).
Does this seem reasonable, or should I avoid "auto" everywhere?

Thanks,
David
------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to