fmihpc / dccrg

Distributed cartesian cell-refinable grid
GNU Lesser General Public License v3.0
10 stars 10 forks source link

start_remote_neighbor_update_receives #2

Closed sandroos closed 9 years ago

sandroos commented 9 years ago

I tried to use this as follows

      // Calculate charge density
      phiprof::start("MPI (RHOQ)");
      SpatialCell::set_mpi_transfer_type(Transfer::CELL_RHOQ_TOT,false);
      mpiGrid.start_remote_neighbor_copy_receives(POISSON_NEIGHBORHOOD_ID);
      phiprof::stop("MPI (RHOQ)");
      for (size_t c=0; c<bndryCellPointersRED.size(); ++c) calculateChargeDensity(bndryCellPointersRED[c].cell);
      for (size_t c=0; c<bndryCellPointersBLACK.size(); ++c) calculateChargeDensity(bndryCellPointersBLACK[c].cell);
      phiprof::start("MPI (RHOQ)");
      mpiGrid.start_remote_neighbor_copy_sends(POISSON_NEIGHBORHOOD_ID);
      phiprof::stop("MPI (RHOQ)");
      for (size_t c=0; c<innerCellPointersRED.size(); ++c) calculateChargeDensity(innerCellPointersRED[c].cell);
      for (size_t c=0; c<innerCellPointersBLACK.size(); ++c) calculateChargeDensity(innerCellPointersBLACK[c].cell);
      phiprof::start("MPI (RHOQ)");
      mpiGrid.wait_remote_neighbor_copy_updates(POISSON_NEIGHBORHOOD_ID);
      phiprof::stop("MPI (RHOQ)");

I get the following errors from compiler:

/home/sandroos/codes/dccrg/dccrg.hpp: In instantiation of ‘bool dccrg::Dccrg<Cell_Data, Geometry>::start_remote_neighbor_copy_receives(int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]’:
poisson_solver/poisson_solver_sor.cpp:153:74:   required from here
/home/sandroos/codes/dccrg/dccrg.hpp:4759:4: error: no matching function for call to ‘dccrg::Dccrg<spatial_cell::SpatialCell, dccrg::Cartesian_Geometry>::start_user_data_receives(std::unordered_map<long unsigned int, spatial_cell::SpatialCell, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, spatial_cell::SpatialCell> > >&, std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&)’
    );
    ^
/home/sandroos/codes/dccrg/dccrg.hpp:4759:4: note: candidate is:
/home/sandroos/codes/dccrg/dccrg.hpp:9153:7: note: bool dccrg::Dccrg<Cell_Data, Geometry>::start_user_data_receives(std::unordered_map<long unsigned int, Cell_Data>&, const std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&, int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]
  bool start_user_data_receives(
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:9153:7: note:   candidate expects 3 arguments, 2 provided
/home/sandroos/codes/dccrg/dccrg.hpp:4828:7: error: no matching function for call to ‘dccrg::Dccrg<spatial_cell::SpatialCell, dccrg::Cartesian_Geometry>::start_user_data_receives(std::unordered_map<long unsigned int, spatial_cell::SpatialCell, std::hash<long unsigned int>, std::equal_to<long unsigned int>, std::allocator<std::pair<const long unsigned int, spatial_cell::SpatialCell> > >&, std::unordered_map<int, std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > > >::mapped_type&)’
   if (!this->start_user_data_receives(
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:4828:7: note: candidate is:
/home/sandroos/codes/dccrg/dccrg.hpp:9153:7: note: bool dccrg::Dccrg<Cell_Data, Geometry>::start_user_data_receives(std::unordered_map<long unsigned int, Cell_Data>&, const std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&, int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]
  bool start_user_data_receives(
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:9153:7: note:   candidate expects 3 arguments, 2 provided
/home/sandroos/codes/dccrg/dccrg.hpp: In instantiation of ‘bool dccrg::Dccrg<Cell_Data, Geometry>::start_remote_neighbor_copy_sends(int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]’:
poisson_solver/poisson_solver_sor.cpp:158:71:   required from here
/home/sandroos/codes/dccrg/dccrg.hpp:4859:58: error: no matching function for call to ‘dccrg::Dccrg<spatial_cell::SpatialCell, dccrg::Cartesian_Geometry>::start_user_data_sends(std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&)’
    return this->start_user_data_sends(this->cells_to_send);
                                                          ^
/home/sandroos/codes/dccrg/dccrg.hpp:4859:58: note: candidate is:
/home/sandroos/codes/dccrg/dccrg.hpp:9368:7: note: bool dccrg::Dccrg<Cell_Data, Geometry>::start_user_data_sends(const std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&, int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]
  bool start_user_data_sends(
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:9368:7: note:   candidate expects 2 arguments, 1 provided
/home/sandroos/codes/dccrg/dccrg.hpp:4927:7: error: no matching function for call to ‘dccrg::Dccrg<spatial_cell::SpatialCell, dccrg::Cartesian_Geometry>::start_user_data_sends(std::unordered_map<int, std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > > >::mapped_type&)’
   if (!this->start_user_data_sends(this->user_neigh_cells_to_send.at(neighborhood_id))) {
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:4927:7: note: candidate is:
/home/sandroos/codes/dccrg/dccrg.hpp:9368:7: note: bool dccrg::Dccrg<Cell_Data, Geometry>::start_user_data_sends(const std::unordered_map<int, std::vector<std::pair<long unsigned int, int> > >&, int) [with Cell_Data = spatial_cell::SpatialCell; Geometry = dccrg::Cartesian_Geometry]
  bool start_user_data_sends(
       ^
/home/sandroos/codes/dccrg/dccrg.hpp:9368:7: note:   candidate expects 2 arguments, 1 provided
make: *** [poisson_solver_sor.o] Error 1

The call in dccrg:4759 is indeed trying calling start_user_data_receives with one parameter (neighborhood id). Has the interface changed at some point in the past and the functions causing compiler errors above were not updated accordingly?

iljah commented 9 years ago

Good catch, should be fixed now.