29#ifndef __PASO_SHAREDCOMPONENTS_H__
30#define __PASO_SHAREDCOMPONENTS_H__
36struct SharedComponents;
44 const std::vector<index_t>& offset,
46 : local_length(localLength*m),
47 neighbour(neighbours),
48 offsetInShared(offset)
51 numSharedComponents = 0;
53 numSharedComponents = offset[neighbours.size()] * m;
55 shared =
new index_t[numSharedComponents];
56 if (!neighbours.empty() && !offset.empty()) {
58 for (int i = 0; i < offsetInShared.size(); i++) {
59 offsetInShared[i] *= m;
62#pragma omp parallel
for
63 for (
dim_t i = 0; i < offset[neighbours.size()]; i++) {
64 const index_t itmp = m * sharedArray[i] + b;
65 for (
dim_t j = 0; j < m; ++j)
66 shared[m*i+j] = itmp+j;
69 offsetInShared[neighbours.size()] = 0;
index_t dim_t
Definition DataTypes.h:66
int index_t
type for array/matrix indices used both globally and on each rank
Definition DataTypes.h:61
Definition BiCGStab.cpp:25
boost::shared_ptr< const SharedComponents > const_SharedComponents_ptr
Definition SharedComponents.h:38
boost::shared_ptr< SharedComponents > SharedComponents_ptr
Definition SharedComponents.h:37
#define PASO_DLL_API
Definition paso/src/system_dep.h:29
Definition SharedComponents.h:41
std::vector< index_t > offsetInShared
Definition SharedComponents.h:86
index_t * shared
Definition SharedComponents.h:90
SharedComponents(dim_t localLength, const std::vector< int > &neighbours, const index_t *sharedArray, const std::vector< index_t > &offset, index_t m=1, index_t b=0)
Definition SharedComponents.h:42
dim_t local_length
local array length shared
Definition SharedComponents.h:79
~SharedComponents()
Definition SharedComponents.h:73
dim_t numSharedComponents
= offsetInShared[numNeighbours]
Definition SharedComponents.h:93
std::vector< int > neighbour
list of the processors sharing values with this processor
Definition SharedComponents.h:82