@@ -57,9 +57,7 @@ class CommunicatorMPI : public ICommunicator
57
57
* calls MPI_Finalize
58
58
*/
59
59
virtual ~CommunicatorMPI ()
60
- {
61
- exit ();
62
- }
60
+ {}
63
61
64
62
virtual int getRank ()
65
63
{
@@ -120,12 +118,10 @@ class CommunicatorMPI : public ICommunicator
120
118
MPI_CHECK (MPI_Cart_create (computing_comm, DIM, dims, periods, 0 , &topology));
121
119
122
120
// 3. update Host rank
123
- hostRank = UpdateHostRank ();
121
+ updateHostRank ();
124
122
125
123
// 4. update Coordinates
126
124
updateCoordinates ();
127
-
128
-
129
125
}
130
126
131
127
/* ! returns a rank number (0-n) for each host
@@ -163,7 +159,7 @@ class CommunicatorMPI : public ICommunicator
163
159
164
160
MPI_CHECK (MPI_Isend (
165
161
(void *) send_data,
166
- send_data_count,
162
+ static_cast < int >( send_data_count) ,
167
163
MPI_CHAR,
168
164
ExchangeTypeToRank (ex),
169
165
gridExchangeTag + tag,
@@ -182,7 +178,7 @@ class CommunicatorMPI : public ICommunicator
182
178
183
179
MPI_CHECK (MPI_Irecv (
184
180
recv_data,
185
- recv_data_max,
181
+ static_cast < int >( recv_data_max) ,
186
182
MPI_CHAR,
187
183
ExchangeTypeToRank (ex),
188
184
gridExchangeTag + tag,
@@ -224,19 +220,9 @@ class CommunicatorMPI : public ICommunicator
224
220
225
221
226
222
protected:
227
-
228
- /* ! calls MPI_Finalize
229
- *
230
- */
231
- void exit ()
232
- {
233
- // MPI_CHECK(MPI_Barrier(MPI_COMM_WORLD));
234
- // MPI_Finalize();
235
- }
236
-
237
223
/* Set the first found non charactor or number to 0 (NULL)
238
224
* name like p1223(Pid=1233) is than p1223
239
- * in some MPI implementation /mpich) the hostname is uniqu
225
+ * in some MPI implementation /mpich) the hostname is unique
240
226
*/
241
227
void cleanHostname (char * name)
242
228
{
@@ -262,11 +248,10 @@ class CommunicatorMPI : public ICommunicator
262
248
* from the master.
263
249
*
264
250
*/
265
- int UpdateHostRank ()
251
+ void updateHostRank ()
266
252
{
267
253
char hostname[MPI_MAX_PROCESSOR_NAME];
268
254
int length;
269
- int hostRank;
270
255
271
256
MPI_CHECK (MPI_Get_processor_name (hostname, &length));
272
257
cleanHostname (hostname);
@@ -303,8 +288,6 @@ class CommunicatorMPI : public ICommunicator
303
288
// if(hostRank!=0) hostRank--; //!\todo fix mpi hostrank start with 1
304
289
}
305
290
306
- return hostRank;
307
-
308
291
}
309
292
310
293
/* ! update coordinates \see getCoordinates
0 commit comments