Skip to content

Commit e58cf82

Browse files
Merge pull request ComputationalRadiationPhysics#886 from BenjaminW3/msvcWarnings
remove implicit cast and member shadowing warnings
2 parents fafec19 + 045d693 commit e58cf82

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/libPMacc/include/communication/CommunicatorMPI.hpp

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ class CommunicatorMPI : public ICommunicator
5757
* calls MPI_Finalize
5858
*/
5959
virtual ~CommunicatorMPI()
60-
{
61-
exit();
62-
}
60+
{}
6361

6462
virtual int getRank()
6563
{
@@ -120,12 +118,10 @@ class CommunicatorMPI : public ICommunicator
120118
MPI_CHECK(MPI_Cart_create(computing_comm, DIM, dims, periods, 0, &topology));
121119

122120
// 3. update Host rank
123-
hostRank = UpdateHostRank();
121+
updateHostRank();
124122

125123
//4. update Coordinates
126124
updateCoordinates();
127-
128-
129125
}
130126

131127
/*! returns a rank number (0-n) for each host
@@ -163,7 +159,7 @@ class CommunicatorMPI : public ICommunicator
163159

164160
MPI_CHECK(MPI_Isend(
165161
(void*) send_data,
166-
send_data_count,
162+
static_cast<int>(send_data_count),
167163
MPI_CHAR,
168164
ExchangeTypeToRank(ex),
169165
gridExchangeTag + tag,
@@ -182,7 +178,7 @@ class CommunicatorMPI : public ICommunicator
182178

183179
MPI_CHECK(MPI_Irecv(
184180
recv_data,
185-
recv_data_max,
181+
static_cast<int>(recv_data_max),
186182
MPI_CHAR,
187183
ExchangeTypeToRank(ex),
188184
gridExchangeTag + tag,
@@ -224,19 +220,9 @@ class CommunicatorMPI : public ICommunicator
224220

225221

226222
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-
237223
/* Set the first found non charactor or number to 0 (NULL)
238224
* 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
240226
*/
241227
void cleanHostname(char* name)
242228
{
@@ -262,11 +248,10 @@ class CommunicatorMPI : public ICommunicator
262248
* from the master.
263249
*
264250
*/
265-
int UpdateHostRank()
251+
void updateHostRank()
266252
{
267253
char hostname[MPI_MAX_PROCESSOR_NAME];
268254
int length;
269-
int hostRank;
270255

271256
MPI_CHECK(MPI_Get_processor_name(hostname, &length));
272257
cleanHostname(hostname);
@@ -303,8 +288,6 @@ class CommunicatorMPI : public ICommunicator
303288
// if(hostRank!=0) hostRank--; //!\todo fix mpi hostrank start with 1
304289
}
305290

306-
return hostRank;
307-
308291
}
309292

310293
/*! update coordinates \see getCoordinates

0 commit comments

Comments
 (0)