int PMPI_Info_get(MPI_Info info, const char *key,int valuelen, char *value, int *flag){
*flag=false;
- if (info == nullptr || key == nullptr || valuelen <0)
+ if (info == nullptr || valuelen <0)
return MPI_ERR_ARG;
+ if (key == nullptr)
+ return MPI_ERR_INFO_KEY;
if (value == nullptr)
return MPI_ERR_INFO_VALUE;
return info->get(key, valuelen, value, flag);
int PMPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *flag){
*flag=false;
- if (info == nullptr || key == nullptr || valuelen==nullptr)
+ if (info == nullptr)
return MPI_ERR_ARG;
+ if (key == nullptr)
+ return MPI_ERR_INFO_KEY;
+ if (valuelen == nullptr)
+ return MPI_ERR_INFO_VALUE;
return info->get_valuelen(key, valuelen, flag);
}
#include "src/smpi/include/smpi_actor.hpp"
#include "mc/mc.h"
#include "smpi_comm.hpp"
+#include "smpi_info.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/simix/smx_private.hpp"
MPI_Info ActorExt::info_env()
{
+ if (info_env_==MPI_INFO_NULL)
+ info_env_=new Info();
return info_env_;
}
memcpy(value, tmpvalue.c_str(),
(tmpvalue.length() + 1 < static_cast<size_t>(valuelen)) ? tmpvalue.length() + 1 : valuelen);
*flag=true;
- return MPI_SUCCESS;
- } else {
- return MPI_ERR_INFO_KEY;
}
+ return MPI_SUCCESS;
}
int Info::remove(const char *key){
if (val != map_.end()) {
*valuelen = val->second.length();
*flag=true;
- return MPI_SUCCESS;
- } else {
- return MPI_ERR_INFO_KEY;
}
+ return MPI_SUCCESS;
}
Info* Info::f2c(int id){