DARMA-tasking-internal / darma-frontend

Header library providing the frontend programming model for the DARMA asynchronous many-task model
Other
7 stars 0 forks source link

serialization example #94

Open jjwilke opened 6 years ago

jjwilke commented 6 years ago

For other backends, we will want a basic serialization example (maybe the wiki?), but particularly for the new accessor model.

Given a type Accessor and an object T and the default archives, I need code that accomplishes the equivalent.

Accessor<T> a;
T t;

int size = sizer(t);
void* buffer = pack(t);
...

T newT;
unpack(size, newT);
jjwilke commented 6 years ago

If possible, maybe make this an easy to read test in the new serialization library?

Pack an object. Unpack the object. Confirm they are the same thing.

Would be nice to confirm the code example compiles and runs.

dhollman commented 6 years ago

I'll add some examples to the new repo. I've cross-listed an issue there: DARMA-tasking/darma-serialization#3

dhollman commented 6 years ago

@jjwilke See if the moving_data example I've added to the DARMA-tasking/darma-serialization repository gets you what you need to know here. It shows how to interact with the SerializationHandler and SerializationBuffer concepts, which I envision to be the side of the interface you'd be using for this sort of thing (later we can talk about writing a custom SerializationHandler, but I think that's the next level and the simple one should suffice for now).