1#ifndef _RHEOLEF_MPI_SCATTER_MAP_H
2#define _RHEOLEF_MPI_SCATTER_MAP_H
23#include "rheolef/mpi_scatter_init.h"
24#include "rheolef/mpi_scatter_begin.h"
25#include "rheolef/mpi_scatter_end.h"
55template <
class InputIterator,
class InputSet,
class OutputMap>
60 InputIterator local_data,
61 const InputSet& ext_idx_set,
63 OutputMap& ext_idx_map)
66 typedef typename std::iterator_traits<InputIterator>::value_type data_type;
75 std::vector<size_type> ext_idx (ext_idx_set.size());
76 std::copy (ext_idx_set.begin(), ext_idx_set.end(), ext_idx.begin());
79 std::vector<size_type> id (ext_idx.size());
80 for (
size_type i = 0; i <
id.size(); i++)
id[i] = i;
85 ext_idx.begin().operator->(),
87 id.begin().operator->(),
89 ownership.
begin().operator->(),
96 std::vector<data_type> buffer (ext_idx.size());
99 buffer.begin().operator->(),
102 details::generic_set_op(),
112 details::generic_set_op(),
118 for (
size_type i = 0; i < buffer.size(); i++) {
119 ext_idx_map.insert (std::make_pair (ext_idx[i], buffer[i]));
field::size_type size_type
see the distributor page for the full documentation
size_type dis_size() const
global and local sizes
static tag_type get_new_tag()
returns a new tag
std::allocator< int >::size_type size_type
const communicator_type & comm() const
This file is part of Rheolef.
void mpi_scatter_map(const distributor &ownership, InputIterator local_data, const InputSet &ext_idx_set, OutputMap &ext_idx_map)
void mpi_scatter_end(InputIterator x, OutputIterator y, Message &from, Message &to, SetOp op, Tag tag, Comm comm)
void mpi_scatter_begin(InputIterator x, OutputIterator y, Message &from, Message &to, SetOp op, Tag tag, Comm comm)
std::iterator_traits< Iterator >::pointer get_pointer_from_iterator(Iterator iter)
void mpi_scatter_init(Size nidx, SizeRandomIterator1 idx, Size nidy, SizeRandomIterator2 idy, Size idy_maxval, SizeRandomIterator3 ownership, Tag tag, const distributor::communicator_type &comm, Message &from, Message &to)