SST/macro
mpi_parameters.h
Go to the documentation of this file.
1 #ifndef sprockit_MPI_PARAMETERS_H
2 #define sprockit_MPI_PARAMETERS_H
3 
5 #include <mpi.h>
6 
7 namespace sprockit {
8 
10  public param_bcaster
11 {
12  public:
13  void
14  bcast(void *buf, int size, int me, int root){
15  MPI_Bcast(buf, size, MPI_BYTE, root, MPI_COMM_WORLD);
16  }
17 };
18 
19 static inline sim_parameters*
20 MPI_Bcast_params(const std::string& fname)
21 {
22  int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);
23  int nproc; MPI_Comm_size(MPI_COMM_WORLD, &nproc);
25  sprockit::sim_parameters* params = new sprockit::sim_parameters;
26  sim_parameters::parallel_build_params(params, rank, nproc, fname, &bc);
27  return params;
28 }
29 
30 }
31 
32 #endif // MPI_PARAMETERS_H
void bcast(void *buf, int size, int me, int root)
static sim_parameters * MPI_Bcast_params(const std::string &fname)