3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 22:33:48 +01:00
dft_tools/test/triqs/gfs/mpi_red.cpp
Olivier Parcollet 8c725f8d5e Work on compilation speed.
- h5/make_h5.... only used in parameters.
- old boost includes before C++11
- remove boost serialization, make macro TRIQS_MAKE_NVP temporarely
- remove boost::is_complex (can be written in 2 lines...)
- move some lib in cpp
2014-05-02 20:49:19 +02:00

41 lines
1.2 KiB
C++

#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
#include <triqs/gfs.hpp>
#include <boost/serialization/complex.hpp>
using namespace triqs::gfs;
using namespace triqs::arrays;
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl<<std::endl;
#include <triqs/gfs/local/functions.hpp>
#include <boost/mpi.hpp>
int main(int argc, char* argv[]) {
boost::mpi::environment env(argc,argv);
boost::mpi::communicator c;
double beta =1;
auto G = gf<imfreq> {{beta, Fermion}, {2,2}};
triqs::clef::placeholder<0> om_;
//G(om_) << (om_ - 2.1);
auto G2 = G;
std::cout << c.rank() << "\t"<< G.singularity()<< std::endl;
boost::mpi::reduce(c, G, G2, std::plus<gf<imfreq>>(), 0);
std::cout << c.rank() << "\t" << G2.singularity()<< std::endl;
G(om_) << (om_ - 2.1);
//std::cout << c.rank() << "\t"<< G.singularity()<< std::endl;
//boost::mpi::reduce(c, G, G2, std::plus<gf<imfreq>>(), 0);
// std::cout << c.rank() << "\t" << G2.singularity()<< std::endl;
auto g3 = G2 + G;
std::cout << c.rank() << "\t" << g3.singularity()<< std::endl;
//G(om_) << (om_ - 2.1);
auto g4 = g3 + G;
std::cout << c.rank() << "\t" << g4.singularity()<< std::endl;
std::cout << c.rank() << "\t" << g3.singularity() + g4.singularity()<< std::endl;
}