@@ -22,23 +22,35 @@ namespace pfasst
2222 using namespace pfasst ::mpi;
2323
2424 template <typename scalar, typename time = time_precision>
25- class MPIVectorEncapsulation : public VectorEncapsulation <scalar, time>
25+ class MPIVectorEncapsulation
26+ : public VectorEncapsulation<scalar, time>
2627 {
27-
28+ // ! @{
2829 MPI_Request recv_request = MPI_REQUEST_NULL;
2930 MPI_Request send_request = MPI_REQUEST_NULL;
31+ // ! @}
3032
33+ // ! @{
3134 inline MPICommunicator& as_mpi (ICommunicator* comm)
3235 {
33- auto mpi = dynamic_cast <MPICommunicator*>(comm); assert (mpi);
36+ auto mpi = dynamic_cast <MPICommunicator*>(comm);
37+ assert (mpi);
3438 return *mpi;
3539 }
40+ // ! @}
3641
3742 public:
43+ // ! @{
44+ MPIVectorEncapsulation (int size)
45+ : VectorEncapsulation<scalar, time>(size)
46+ {}
3847
39- MPIVectorEncapsulation (int size) : VectorEncapsulation<scalar, time>(size) { }
48+ virtual ~MPIVectorEncapsulation ()
49+ {}
50+ // ! @}
4051
41- void post (ICommunicator* comm, int tag)
52+ // ! @{
53+ void post (ICommunicator* comm, int tag) override
4254 {
4355 auto & mpi = as_mpi (comm);
4456 if (mpi.size () == 1 ) { return ; }
@@ -51,7 +63,7 @@ namespace pfasst
5163 }
5264 }
5365
54- virtual void recv (ICommunicator* comm, int tag, bool blocking)
66+ virtual void recv (ICommunicator* comm, int tag, bool blocking) override
5567 {
5668 auto & mpi = as_mpi (comm);
5769 if (mpi.size () == 1 ) { return ; }
@@ -72,7 +84,7 @@ namespace pfasst
7284 }
7385 }
7486
75- virtual void send (ICommunicator* comm, int tag, bool blocking)
87+ virtual void send (ICommunicator* comm, int tag, bool blocking) override
7688 {
7789 auto & mpi = as_mpi (comm);
7890 if (mpi.size () == 1 ) { return ; }
@@ -98,20 +110,22 @@ namespace pfasst
98110 }
99111 }
100112
101- virtual void broadcast (ICommunicator* comm)
113+ virtual void broadcast (ICommunicator* comm) override
102114 {
103115 auto & mpi = as_mpi (comm);
104- int err = MPI_Bcast (this ->data (), sizeof (scalar) * this ->size (), MPI_CHAR, comm->size ()-1 , mpi.comm );
116+ int err = MPI_Bcast (this ->data (), sizeof (scalar) * this ->size (), MPI_CHAR,
117+ comm->size ()-1 , mpi.comm );
105118
106119 if (err != MPI_SUCCESS) {
107120 throw MPIError ();
108121 }
109122 }
110-
123+ // ! @}
111124 };
112125
113126 template <typename scalar, typename time = time_precision>
114- class MPIVectorFactory : public EncapFactory <time>
127+ class MPIVectorFactory
128+ : public EncapFactory<time>
115129 {
116130 int size;
117131 public:
@@ -123,9 +137,7 @@ namespace pfasst
123137 }
124138 };
125139
126-
127-
128- }
129- }
140+ } // ::pfasst::encap
141+ } // ::pfasst
130142
131143#endif
0 commit comments