/* PMPI User level calls */
-int PMPI_Init(int *argc, char ***argv)
+int PMPI_Init(int*, char***)
{
xbt_assert(simgrid::s4u::Engine::is_initialized(),
"Your MPI program was not properly initialized. The easiest is to use smpirun to start it.");
return sg_maxmin_precision;
}
-int PMPI_Address(void *location, MPI_Aint * address)
+int PMPI_Address(const void* location, MPI_Aint* address)
{
if (address==nullptr) {
return MPI_ERR_ARG;
}
}
-int PMPI_Get_address(void *location, MPI_Aint * address)
+int PMPI_Get_address(const void *location, MPI_Aint * address)
{
return PMPI_Address(location, address);
}
return MPI_SUCCESS;
}
-int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
+int PMPI_Get_count(const MPI_Status * status, MPI_Datatype datatype, int *count)
{
if (status == nullptr || count == nullptr) {
return MPI_ERR_ARG;
}
int PMPI_Error_string(int errorcode, char* string, int* resultlen){
- if (errorcode<0 || string ==nullptr){
+ if (errorcode<0 || errorcode>= MPI_MAX_ERROR_STRING || string ==nullptr){
return MPI_ERR_ARG;
} else {
static const char *smpi_error_string[] = {
FOREACH_ERROR(GENERATE_STRING)
};
*resultlen = strlen(smpi_error_string[errorcode]);
- strncpy(string, smpi_error_string[errorcode], *resultlen);
+ memcpy(string, smpi_error_string[errorcode], *resultlen*sizeof(char));
return MPI_SUCCESS;
}
}