_union_group = source_group.fuse(target_group);
}
- DEC::DEC(const int *src_ids_bg, const int *src_ids_end,
- const int *trg_ids_bg, const int *trg_ids_end,
+ DEC::DEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
const MPI_Comm& world_comm):_local_field(0),
_owns_field(false),
_owns_groups(true),
{
ParaMEDMEM::CommInterface comm;
// Create the list of procs including source and target
- int nbOfProcsInComm=std::distance(src_ids_bg,src_ids_end)+std::distance(trg_ids_bg,trg_ids_end);
+ int nbOfProcsInComm=src_ids.size()+trg_ids.size();
int *allRanks=new int[nbOfProcsInComm];
- std::copy(src_ids_bg,src_ids_end,allRanks);
- std::copy(trg_ids_bg,trg_ids_end,allRanks+std::distance(src_ids_bg,src_ids_end));
+ std::copy(src_ids.begin(),src_ids.end(),allRanks);
+ std::copy(trg_ids.begin(),trg_ids.end(),allRanks+src_ids.size());
// Create a communicator on these procs
MPI_Group src_trg_group, world_group;
comm.commGroup(world_comm,&world_group);
_union_group=0;
return;
}
- std::set<int> source_ids(src_ids_bg,src_ids_end);
- _source_group=new MPIProcessorGroup(comm,source_ids,src_trg_comm);
- std::set<int> target_ids(trg_ids_bg,trg_ids_end);
- _target_group=new MPIProcessorGroup(comm,target_ids,src_trg_comm);
- std::set<int> src_trg_ids(src_ids_bg,src_ids_end);
- src_trg_ids.insert(trg_ids_bg,trg_ids_end);
+ _source_group=new MPIProcessorGroup(comm,src_ids,src_trg_comm);
+ _target_group=new MPIProcessorGroup(comm,trg_ids,src_trg_comm);
+ std::set<int> src_trg_ids(src_ids);
+ src_trg_ids.insert(trg_ids.begin(),trg_ids.end());
_union_group=new MPIProcessorGroup(comm,src_trg_ids,src_trg_comm);
}
public:
DEC():_local_field(0) { }
DEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
- DEC(const int *src_ids_bg, const int *src_ids_end,
- const int *trg_ids_bg, const int *trg_ids_end,
+ DEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
const MPI_Comm& world_comm=MPI_COMM_WORLD);
void setNature(NatureOfField nature);
void attachLocalField( MEDCouplingFieldDouble* field);
}
- InterpKernelDEC::InterpKernelDEC(const int *src_ids_bg, const int *src_ids_end,
- const int *trg_ids_bg, const int *trg_ids_end,
- const MPI_Comm& world_comm):DEC(src_ids_bg,src_ids_end,trg_ids_bg,trg_ids_end,world_comm),
+ InterpKernelDEC::InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
+ const MPI_Comm& world_comm):DEC(src_ids,trg_ids,world_comm),
_interpolation_matrix(0)
{
}
public:
InterpKernelDEC();
InterpKernelDEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
- InterpKernelDEC(const int *src_ids_bg, const int *src_ids_end,
- const int *trg_ids_bg, const int *trg_ids_end,
+ InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
const MPI_Comm& world_comm=MPI_COMM_WORLD);
virtual ~InterpKernelDEC();
void synchronize();