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

Broadcast Boost.JSON objects #158

Open
Arsennnic opened this issue Jun 3, 2024 · 1 comment
Open

Broadcast Boost.JSON objects #158

Arsennnic opened this issue Jun 3, 2024 · 1 comment

Comments

@Arsennnic
Copy link

Arsennnic commented Jun 3, 2024

Hi, I wonder how to broadcast Boost.JSON objects with Boost.MPI library. I tried

#include <boost/json.hpp>
#include <boost/mpi/collectives.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/mpi/environment.hpp>

int main( int argc, char* argv[] )
{
    boost::mpi::environment env( argc, argv );
    boost::mpi::communicator world;
    boost::json::object json;
    boost::mpi::broadcast( world, json, 0 );
    return 0;
}

and got the error 'class boost::json::object' has no member named 'serialize'.

I guess I missed some headers like <boost/serialization/string.hpp> or <boost/serialization/vector.hpp>, but I don't know which ones should be included.

@aminiussi
Copy link
Member

Sorry for the delay.

There is nothing done specificaly for json trees. It's considered a user type and as such requires it's own serialisation implementation as described in
https://www.boost.org/doc/libs/1_85_0/doc/html/mpi/tutorial.html#mpi.tutorial.user_data_types

Regards

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