* under the terms of the license (GNU LGPL) which comes with this package. */
#include <stdlib.h>
+#include <limits.h>
+
+#include <xbt/dict.h>
+#include <xbt/ex.h>
+#include <xbt/ex.hpp>
+
+#include <simgrid/s4u/host.hpp>
#include "private.h"
-#include "xbt/dict.h"
#include "smpi_mpi_dt_private.h"
-#include "limits.h"
#include "src/simix/smx_private.h"
#include "colls/colls.h"
-#include "xbt/ex.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)");
if(ret!=MPI_SUCCESS){
smpi_comm_destroy(*newcomm);
*newcomm=MPI_COMM_NULL;
+ xbt_dict_cursor_free(&cursor);
return ret;
}
if(flag)
int intra_comm_size = 0;
int i =0;
int min_index=INT_MAX;//the minimum index will be the leader
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
xbt_swag_foreach(process, process_list) {
- int index = SIMIX_process_get_PID(process) -1;
+ int index = process->pid -1;
if(smpi_group_rank(smpi_comm_group(comm), index)!=MPI_UNDEFINED){
intra_comm_size++;
i=0;
process = nullptr;
xbt_swag_foreach(process, process_list) {
- int index = SIMIX_process_get_PID(process) -1;
+ int index = process->pid -1;
if(smpi_group_rank(smpi_comm_group(comm), index)!=MPI_UNDEFINED){
smpi_group_set_mapping(group_intra, index, i);
i++;
if(elem==nullptr)
return MPI_ERR_ARG;
if(elem->delete_fn!=MPI_NULL_DELETE_FN){
- void * value;
+ void* value = nullptr;
int flag;
if(smpi_comm_attr_get(comm, keyval, &value, &flag)==MPI_SUCCESS){
int ret = elem->delete_fn(comm, keyval, value, &flag);
static_cast<smpi_comm_key_elem>(xbt_dict_get_or_null_ext(smpi_comm_keyvals, reinterpret_cast<const char*>(&keyval), sizeof(int)));
if(elem==nullptr)
return MPI_ERR_ARG;
- xbt_ex_t ex;
if(comm->attributes==nullptr){
*flag=0;
return MPI_SUCCESS;
}
- TRY {
+ try {
*static_cast<void**>(attr_value) = xbt_dict_get_ext(comm->attributes,
reinterpret_cast<const char*>(&keyval), sizeof(int));
*flag=1;
- } CATCH(ex) {
+ }
+ catch (xbt_ex& ex) {
*flag=0;
- xbt_ex_free(ex);
}
return MPI_SUCCESS;
}
if(elem==nullptr)
return MPI_ERR_ARG;
int flag;
- void* value;
+ void* value = nullptr;
smpi_comm_attr_get(comm, keyval, &value, &flag);
if(flag!=0 && elem->delete_fn!=MPI_NULL_DELETE_FN){
int ret = elem->delete_fn(comm, keyval, value, &flag);