Go to the documentation of this file.
56 if( nRows != graphParts[i].size() )
59 "inline void Foam::VRWGraph::mergeGraphs(const List<VRWGraph>&)"
67 # pragma omp parallel for schedule(static, 1)
69 for(
label rowI=0;rowI<nRows;++rowI)
72 for(
label i=0;i<nGraphs;++i)
73 sum += graphParts[i].sizeOfRow(rowI);
75 nElmtsInRow[rowI] =
sum;
83 # pragma omp parallel for schedule(static, 1)
85 for(
label rowI=0;rowI<nRows;++rowI)
91 graph_(rowI, --nElmtsInRow[rowI]) = gp(rowI, j);
102 label nThreads = 3 * omp_get_num_procs();
103 if( origGraph.
size() < 1000 )
106 const label nThreads(1);
109 label minRow(INT_MAX), maxRow(-1);
113 # pragma omp parallel num_threads(nThreads)
117 const label threadI = omp_get_thread_num();
119 const label threadI(0);
123 dot.setSize(nThreads);
127 label localMinRow(INT_MAX), localMaxRow(-1);
129 # pragma omp for schedule(static)
135 const label entryI = origGraph(rowI, i);
136 localMaxRow =
Foam::max(localMaxRow, entryI);
137 localMinRow =
Foam::min(localMinRow, entryI);
144 # pragma omp critical
159 # pragma omp for schedule(static)
161 for(
label i=0;i<maxRow;++i)
168 const label range = (maxRow - minRow) / nThreads + 1;
174 # pragma omp for schedule(static)
180 const label entryI = origGraph(rowI, j);
182 const label threadNo = (entryI - minRow) /
range;
184 if( threadNo == threadI )
186 ++nAppearances[entryI];
200 for(
label i=0;i<nThreads;++i)
203 dataForOtherThreads[i][threadI];
206 ++nAppearances[
data[j].first()];
230 for(
label i=0;i<threadI;++i)
233 dataForOtherThreads[i][threadI];
238 graph_(entryI, nAppearances[entryI]++) =
data[j].second();
244 # pragma omp for schedule(static)
250 const label entryI = origGraph(rowI, j);
253 graph_(entryI, nAppearances[entryI]++) = rowI;
258 for(
label i=threadI+1;i<nThreads;++i)
261 dataForOtherThreads[i][threadI];
266 graph_(entryI, nAppearances[entryI]++) =
data[j].second();
275 label nThreads = 3 * omp_get_num_procs();
279 const label nThreads(1);
290 # pragma omp parallel num_threads(nThreads)
294 const label threadI = omp_get_thread_num();
296 const label threadI(0);
299 nEntries[threadI] = 0;
302 # pragma omp for schedule(static)
329 counter += nEntries[i];
339 label rowStart(0), entryStart(0);
340 for(
label i=0;i<threadI;++i)
342 rowStart += nRows[i];
343 entryStart += nEntries[i];
348 # pragma omp for schedule(static)
353 el.
start() += entryStart;
359 newData[entryStart] =
graph_(rowI, i);
376 # pragma omp parallel
380 # pragma omp for schedule(static, 1)
386 # pragma omp for schedule(static, 1)
Class to create, store and output qgraph files.
#define forAll(list, i)
Loop across all elements in list.
VRWGraph & graph_
list containing the data
LocalMin-mean differencing scheme class.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
label size() const
Size of the active part of the list.
void setSize(const label)
Reset size of List.
LocalMax-mean differencing scheme class.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
labelLongList data_
list containing data
void optimizeMemoryUsage()
optimize memory usage
label size() const
Returns the number of rows.
void transfer(LongList< T, Offset > &)
transfer the list from another one without allocating it
void setSize(const label)
Reset the number of rows.
#define forAllRow(graph, rowI, index)
VRWGraphSMPModifier()
Disallow default construct.
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
errorManip< error > abort(error &err)
void reverseAddressing(const GraphType &origGraph)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
LongList< rowElement > rows_
number of rows
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
void operator=(const VRWGraphSMPModifier &)
Disallow bitwise assignment.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Pair< label > labelPair
Label pair.
Database for solution data, solver performance and other reduced data.
void setSizeAndRowSize(const ListType &)
set the size and row sizes
void mergeGraphs(const List< VRWGraph > &graphParts)