>Jean-Loup,
>
>> >> I am currently playing with HPX components in order to understand a bit
>> >> better how they work. In particular, I am trying to migrate a component
>> to
>> >> a different locality from the one it was instantiated on. However,
>> >> documentation on component migration is quite scarce and I have not
>> been
>> >> able to get a minimal example to work.
>> >
>> >What do you mean by this? What didn't work? Could you be more specific
>> >please?
>>
>> I was just trying to implement a minimal example of a migratable component
>> (similar to the one in the gist), i.e. define a very simple class (e.g. a
>> wrapper around some STL type), which can be copied across node boundaries.
>
>Well, you have not said what actually didn't work. Did it fail to compile?
>Fail to link? Fail to run? What were the error messages? Build logs?

The component itself compiles fine, but the compilation of `main.cpp` fails due 
to the call to `hpx::components::migrate<>`. You can find a new minimal failing 
example with full build logs here: 
https://gist.github.com/Element-126/f6e9a1ad5a9944e94916fff9203f9e52

The relevant error seems to be the following:
/home/jtastet/.local/stow/hpx/include/hpx/runtime/serialization/access.hpp:33:22:
 error: no matching function for call to 
'serialize(hpx::serialization::input_archive&, std::shared_ptr<Bar>&, int)'
             serialize(ar, t, 0);
             ~~~~~~~~~^~~~~~~~~~
It is indeed related to serialization.

>> >> See the following gist to see what I am trying to achieve:
>> >> https://gist.github.com/Element-126/c1815833fce9018fb28911751e0ce43b
>> >>
>> >> Looking at the HPX source code, it seems that I will need to implement
>> >> serialization support for my component, but I have not been able to
>> figure
>> >> out the specifics yet.
>> >
>> >Yes, in order for a component to be migratable you need to make it
>> >serializable. Otherwise there is no way to deduce what it means to move a
>> >component over the wire (i.e. what members to 'copy', etc.). This can be
>> >done in the usual way (see the boost serialization documentation for
>> details
>> >[1], the HPX serialization is very similar, except for the namespace -
>> use
>> >'hpx::' instead of 'boost::').
>>
>> Thanks for the reference. I am not very familiar with serialization yet,
>> so the boost documentation will certainly help a lot.
>
>Just second guessing here: but if you don't have serialization support in
>your component it most likely failed to compile saying you need it...

Note that if the definition and call to `test_migration()` are commented out in 
`main.cpp` (leaving only `test_serialization()`), then the program compiles and 
runs fine.  So serialization alone (which is a no-op in this trivial example) 
seems to be working.

>Regards Hartmut
>---------------
>http://boost-spirit.com
>http://stellar.cct.lsu.edu

I am using a ~1 week old build of HPX master, compiled using GCC 6.3. Feel free 
to ask me for any additional information.

Best regards,
Jean-Loup
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to