Skip to content

Commit

Permalink
remove implicit cast, member shadowing warnings, dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminW3 committed May 26, 2015
1 parent b12d585 commit 045d693
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions src/libPMacc/include/communication/CommunicatorMPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ class CommunicatorMPI : public ICommunicator
* calls MPI_Finalize
*/
virtual ~CommunicatorMPI()
{
exit();
}
{}

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

// 3. update Host rank
hostRank = UpdateHostRank();
updateHostRank();

//4. update Coordinates
updateCoordinates();


}

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

MPI_CHECK(MPI_Isend(
(void*) send_data,
send_data_count,
static_cast<int>(send_data_count),
MPI_CHAR,
ExchangeTypeToRank(ex),
gridExchangeTag + tag,
Expand All @@ -182,7 +178,7 @@ class CommunicatorMPI : public ICommunicator

MPI_CHECK(MPI_Irecv(
recv_data,
recv_data_max,
static_cast<int>(recv_data_max),
MPI_CHAR,
ExchangeTypeToRank(ex),
gridExchangeTag + tag,
Expand Down Expand Up @@ -224,19 +220,9 @@ class CommunicatorMPI : public ICommunicator


protected:

/*! calls MPI_Finalize
*
*/
void exit()
{
// MPI_CHECK(MPI_Barrier(MPI_COMM_WORLD));
// MPI_Finalize();
}

/* Set the first found non charactor or number to 0 (NULL)
* name like p1223(Pid=1233) is than p1223
* in some MPI implementation /mpich) the hostname is uniqu
* in some MPI implementation /mpich) the hostname is unique
*/
void cleanHostname(char* name)
{
Expand All @@ -262,11 +248,10 @@ class CommunicatorMPI : public ICommunicator
* from the master.
*
*/
int UpdateHostRank()
void updateHostRank()
{
char hostname[MPI_MAX_PROCESSOR_NAME];
int length;
int hostRank;

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

return hostRank;

}

/*! update coordinates \see getCoordinates
Expand Down

0 comments on commit 045d693

Please sign in to comment.