2013-07-17 19:24:07 +02:00
|
|
|
#include <triqs/parameters.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <complex>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <boost/mpi.hpp>
|
|
|
|
#include <boost/mpi/environment.hpp>
|
|
|
|
#include <boost/mpi/communicator.hpp>
|
|
|
|
#include <boost/serialization/complex.hpp>
|
|
|
|
|
2014-05-16 19:35:48 +02:00
|
|
|
using namespace triqs::params;
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
boost::mpi::environment env(argc, argv);
|
|
|
|
boost::mpi::communicator world;
|
|
|
|
|
|
|
|
parameters P;
|
2014-05-16 19:35:48 +02:00
|
|
|
P.add_field("a", 1, "?")
|
|
|
|
.add_field("d", 2.0, "")
|
|
|
|
.add_field("s", "", "");
|
|
|
|
|
2013-07-17 19:24:07 +02:00
|
|
|
if (world.rank() == 0) {
|
|
|
|
P["a"] = long(1);
|
|
|
|
P["d"] = 2.7;
|
|
|
|
P["s"] = std::string("-14.3");
|
|
|
|
}
|
2014-05-16 19:35:48 +02:00
|
|
|
/*
|
|
|
|
* WITH SERIALIZATION
|
2013-07-17 19:24:07 +02:00
|
|
|
std::cout << "Before bcast rank " << world.rank() << " : " << P << std::endl ;
|
|
|
|
boost::mpi::broadcast(world,P,0);
|
|
|
|
std::cout << "After bcast rank " << world.rank() << " : " << P << std::endl ;
|
2014-05-16 19:35:48 +02:00
|
|
|
*/
|
2013-07-17 19:24:07 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|