5 #include "indexedFddStorageExtern.cpp" 7 #include "_workerIFdd.h" 10 template <
typename K,
typename T>
12 T * d = this->localData->getData();
13 K * k = this->localData->getKeys();
14 size_t s = this->localData->getSize();
17 #pragma omp parallel for 18 for (
size_t i = 0; i < s; ++i){
19 updateFunc(k[i], d[i]);
25 template <
typename K,
typename T>
27 T * d = this->localData->getData();
28 std::pair<K,T> result;
29 size_t s = this->localData->getSize();
30 K * ik = this->localData->getKeys();
35 int nT = omp_get_num_threads();
36 size_t tN = omp_get_thread_num();
37 std::pair<K,T> partResult = {};
40 partResult = {ik[tN], d[tN] };
44 for (
size_t i = nT; i < s; ++i){
45 partResult = reduceFunc(partResult.first, partResult.second, ik[i], d[i]);
52 if ( (omp_get_thread_num() != 0) && ( tN < s ) ){
54 result = reduceFunc(result.first, result.second, partResult.first, partResult.second);
61 template <
typename K,
typename T>
63 K * ik = this->localData->getKeys();
64 return bulkReduceFunc(ik, (T*) this->localData->getData(), this->localData->getSize());
69 template <
typename K,
typename T>
77 rc = update( ( updateIFunctionP<K,T> ) func );
82 rp = reduce( ( IreduceIFunctionP<K,T> ) func );
87 rp = bulkReduce( ( IbulkReduceIFunctionP<K,T> ) func );
100 template <
typename K,
typename T>
102 this->localData->setData( keys, data, size);
105 template <
typename K,
typename T>
107 this->localData->setDataRaw(keys, data, size);
111 template <
typename K,
typename T>
113 this->localData->insert(*(K *) k, *(T*) in);
115 template <
typename K,
typename T>
117 insert( *(std::deque<std::pair<K,T>>*) in);
123 template <
typename K,
typename T>
125 this->localData->insert(key, in);
128 template <
typename K,
typename T>
131 if (this->localData->getSize() < in.size())
132 this->localData->grow(in.size());
134 for (
auto it = in.begin(); it != in.end(); it++){
135 this->localData->insert(it->first, it->second);
141 template <
typename K,
typename T>
143 if (op & (OP_GENERICMAP)){
144 applyDependent(func, op, dest);
146 applyIndependent(func, op, buffer);
152 template <
typename K,
typename T>
154 comm->sendFDDDataCollect(this->
id, this->localData->getKeys(), this->localData->getData(), this->localData->getSize());