QNANO
Distribute_Block_MPI.h
1 #ifndef QNANO_NEW_MPI_BLOCK_COORDINATOR_DEFINED_H
2 #define QNANO_NEW_MPI_BLOCK_COORDINATOR_DEFINED_H
3 
4 #include <mpi.h>
5 #include "tools/Distribute_Block_Local.h"
6 
7 
9 public:
10  virtual void print() const{
11  std::cout<<"Process "<<get_block()<<":";
12  std::cout<<" start: "<<get_local_start();
13  std::cout<<" blocksize: "<<get_local_blocksize()<<std::endl;
14  }
15 
16  void initialize(MPI_Comm comm, size_t total_size_){
17  int MPI_rank, MPI_size;
18  MPI_Comm_rank(comm, &MPI_rank);
19  MPI_Comm_size(comm, &MPI_size);
20 
21  Distribute_Block::initialize(total_size_, MPI_size);
22  block=MPI_rank;
23  }
24  Distribute_Block_MPI(MPI_Comm comm, size_t total_size_){
25  initialize(comm,total_size_);
26  }
28 
29 };
30 
31 #endif
Definition: Distribute_Block_MPI.h:8
Definition: Distribute_Block_Local.h:15