3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 14:23:38 +01:00
dft_tools/test/triqs/parameters/mpi_param.cpp
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

41 lines
733 B
C++

#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>
using namespace triqs::utility;
int main(int argc, char* argv[]) {
boost::mpi::environment env(argc, argv);
boost::mpi::communicator world;
parameters P;
if (world.rank() == 0) {
P["a"] = long(1);
P["d"] = 2.7;
P["s"] = std::string("-14.3");
}
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 ;
return 0;
}