Skip to content
Snippets Groups Projects
Commit 7ed0e0b8 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Fix const-ness with mpidummy

parent 78c57400
No related branches found
No related tags found
1 merge request!22Fix clang tidy issues round2
...@@ -73,34 +73,35 @@ int MPI_Comm_size(MPI_Comm comm, int *size); ...@@ -73,34 +73,35 @@ int MPI_Comm_size(MPI_Comm comm, int *size);
int MPI_Comm_free(MPI_Comm *comm); int MPI_Comm_free(MPI_Comm *comm);
MPI_Comm MPI_Comm_f2c(MPI_Fint comm); MPI_Comm MPI_Comm_f2c(MPI_Fint comm);
int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm); void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, MPI_Comm comm);
void *recvbuf, int *recvcnts, int *displs, int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm); MPI_Datatype recvtype, int root, MPI_Comm comm);
int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm); MPI_Comm comm);
int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
MPI_Comm comm); MPI_Comm comm);
int MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype sendtype, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm); MPI_Datatype recvtype, int root, MPI_Comm comm);
int MPI_Recv(void *recvbuffer, int count, MPI_Datatype type, int source, int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
int tag, MPI_Comm comm, MPI_Status *status); MPI_Comm comm, MPI_Status *status);
int MPI_Irecv(void *recvbuffer, int count, MPI_Datatype type, int source, int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
int tag, MPI_Comm comm, MPI_Request *request); MPI_Comm comm, MPI_Request *request);
int MPI_Send(void *sendbuffer, int count, MPI_Datatype type, int destination, int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
int tag, MPI_Comm comm); int tag, MPI_Comm comm);
int MPI_Isend(void *recvbuffer, int count, MPI_Datatype type, int source, int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
int tag, MPI_Comm comm, MPI_Request *request); int tag, MPI_Comm comm, MPI_Request *request);
int MPI_Wait(MPI_Request *request, MPI_Status *status); int MPI_Wait(MPI_Request *request, MPI_Status *status);
int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info,
MPI_File *fh); MPI_File *fh);
int MPI_File_close(MPI_File *fh); int MPI_File_close(MPI_File *fh);
int MPI_File_get_size(MPI_File fh, MPI_Offset *size); int MPI_File_get_size(MPI_File fh, MPI_Offset *size);
...@@ -108,7 +109,7 @@ int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, ...@@ -108,7 +109,7 @@ int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype,
MPI_Status *status); MPI_Status *status);
int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
int MPI_Error_string(int errorcode, char *string, int *resultlen); int MPI_Error_string(int errorcode, char *string, int *resultlen);
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out); int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
......
...@@ -98,7 +98,7 @@ void BP1Aggregator::WriteProfilingLog(const std::string fileName, ...@@ -98,7 +98,7 @@ void BP1Aggregator::WriteProfilingLog(const std::string fileName,
MPI_Isend(&rankLogSize, 1, MPI_INT, 0, 0, m_MPIComm, &requestSize); MPI_Isend(&rankLogSize, 1, MPI_INT, 0, 0, m_MPIComm, &requestSize);
MPI_Request requestRankLog; MPI_Request requestRankLog;
MPI_Isend(const_cast<char *>(rankLog.c_str()), rankLogSize, MPI_CHAR, 0, 1, MPI_Isend(rankLog.data(), rankLogSize, MPI_CHAR, 0, 1,
m_MPIComm, &requestRankLog); m_MPIComm, &requestRankLog);
} }
} }
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
#include <cstring> #include <cstring>
//#define _LARGEFILE64_SOURCE //#define _LARGEFILE64_SOURCE
#include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h>
/// \endcond /// \endcond
#include "mpidummy.h" #include "mpidummy.h"
...@@ -95,8 +96,9 @@ int MPI_Comm_free(MPI_Comm *comm) ...@@ -95,8 +96,9 @@ int MPI_Comm_free(MPI_Comm *comm)
MPI_Comm MPI_Comm_f2c(MPI_Fint comm) { return comm; } MPI_Comm MPI_Comm_f2c(MPI_Fint comm) { return comm; }
int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int MPI_Gather(const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root,
MPI_Comm comm)
{ {
int ier = MPI_SUCCESS; int ier = MPI_SUCCESS;
size_t n = 0, nsent = 0, nrecv = 0; size_t n = 0, nsent = 0, nrecv = 0;
...@@ -146,8 +148,8 @@ int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, ...@@ -146,8 +148,8 @@ int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf,
return ier; return ier;
} }
int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, int MPI_Gatherv(const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int *recvcnts, int *displs, void *recvbuf, const int *recvcnts, const int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm) MPI_Datatype recvtype, int root, MPI_Comm comm)
{ {
int ier = MPI_SUCCESS; int ier = MPI_SUCCESS;
...@@ -165,7 +167,7 @@ int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, ...@@ -165,7 +167,7 @@ int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
return ier; return ier;
} }
int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm) MPI_Comm comm)
{ {
...@@ -173,7 +175,7 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, ...@@ -173,7 +175,7 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
0, comm); 0, comm);
} }
int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, int MPI_Scatter(const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root,
MPI_Comm comm) MPI_Comm comm)
{ {
...@@ -216,7 +218,7 @@ int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, ...@@ -216,7 +218,7 @@ int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
if (ier == MPI_SUCCESS) if (ier == MPI_SUCCESS)
{ {
memcpy(sendbuf, recvbuf, nsent); memcpy(recvbuf, sendbuf, nsent);
} }
else else
{ {
...@@ -226,7 +228,7 @@ int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, ...@@ -226,7 +228,7 @@ int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
return ier; return ier;
} }
int MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, int MPI_Scatterv(const void *sendbuf, const int *sendcnts, const int *displs,
MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt,
MPI_Datatype recvtype, int root, MPI_Comm comm) MPI_Datatype recvtype, int root, MPI_Comm comm)
{ {
...@@ -260,13 +262,13 @@ int MPI_Irecv(void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/, ...@@ -260,13 +262,13 @@ int MPI_Irecv(void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/,
return 0; return 0;
} }
int MPI_Send(void * /*sendbuffer*/, int /*count*/, MPI_Datatype /*type*/, int MPI_Send(const void * /*sendbuffer*/, int /*count*/, MPI_Datatype /*type*/,
int /*destination*/, int /*tag*/, MPI_Comm /*comm*/) int /*destination*/, int /*tag*/, MPI_Comm /*comm*/)
{ {
return 0; return 0;
} }
int MPI_Isend(void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/, int MPI_Isend(const void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/,
int /*source*/, int /*tag*/, MPI_Comm /*comm*/, int /*source*/, int /*tag*/, MPI_Comm /*comm*/,
MPI_Request * /*request*/) MPI_Request * /*request*/)
{ {
...@@ -275,7 +277,7 @@ int MPI_Isend(void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/, ...@@ -275,7 +277,7 @@ int MPI_Isend(void * /*recvbuffer*/, int /*count*/, MPI_Datatype /*type*/,
int MPI_Wait(MPI_Request * /*request*/, MPI_Status * /*status*/) { return 0; } int MPI_Wait(MPI_Request * /*request*/, MPI_Status * /*status*/) { return 0; }
int MPI_File_open(MPI_Comm /*comm*/, char *filename, int amode, int MPI_File_open(MPI_Comm /*comm*/, const char *filename, int amode,
MPI_Info /*info*/, MPI_File *fh) MPI_Info /*info*/, MPI_File *fh)
{ {
*fh = open64(filename, amode); *fh = open64(filename, amode);
...@@ -327,7 +329,7 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) ...@@ -327,7 +329,7 @@ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
return MPI_SUCCESS; return MPI_SUCCESS;
} }
int MPI_Get_count(MPI_Status *status, MPI_Datatype, int *count) int MPI_Get_count(const MPI_Status *status, MPI_Datatype, int *count)
{ {
*count = static_cast<int>(*status); *count = static_cast<int>(*status);
return MPI_SUCCESS; return MPI_SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment