5 #include "_workerFdd.h" 7 #include "fastCommBuffer.h" 8 #include "fddStorageExtern.cpp" 15 localData =
new fddStorage<T>();
22 localData =
new fddStorage<T>();
24 localData =
new fddStorage<T>(size);
43 return localData->getData()[address];
47 return localData->getData();
51 return localData->getSize();
63 localData->setSize(s);
76 void printData(std::ofstream & outFile, std::vector<T> * data,
size_t s){
77 outFile.precision(10);
78 for (
size_t i = 0; i < s; i++){
79 for (
size_t j = 0; j < data[i].size(); j++){
80 outFile << data[i][j] <<
" ";
87 void printData(std::ofstream & outFile, T * data,
size_t s){
88 outFile.precision(10);
89 for (
size_t i = 0; i < s; i++){
90 outFile << data[i] <<
"\n";
96 std::string path = * (std::string*) pathP;
97 std::string sufix = * (std::string*) sufixP;
99 T * data = localData->getData();
100 size_t s = localData->getSize();
102 std::string filename(path + std::to_string(procId) + sufix);
103 std::ofstream outFile(filename, std::ofstream::out);
105 printData(outFile, data, s);
110 template <
typename T>
112 using std::chrono::system_clock;
113 using std::chrono::duration_cast;
114 using std::chrono::milliseconds;
117 fastCommBuffer &buffer = comm->getResultBuffer();
128 durationP = buffer.size();
129 buffer.advance(
sizeof(
size_t));
131 rStatP = buffer.size();
134 rSizeP = buffer.size();
135 buffer.advance(
sizeof(
size_t));
137 headerSize = buffer.size();
139 auto start = system_clock::now();
140 if (op & (OP_GENERICMAP | OP_GENERICREDUCE)){
141 this->apply(func, op, dest, buffer);
144 if (dest) buffer << size_t(dest->getSize());
146 auto end = system_clock::now();
147 auto duration = duration_cast<milliseconds>(end - start);
150 buffer.writePos(
size_t(duration.count()), durationP);
151 buffer.writePos(getProcStat(), rStatP);
152 buffer.writePos(
size_t(buffer.size() - headerSize), rSizeP);
154 comm->sendTaskResult();
unsigned int fddOpType
Dataset operation type.
unsigned int fddType
Dataset type.