本文整理汇总了C++中AssemblyOptions::parallelizationOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ AssemblyOptions::parallelizationOptions方法的具体用法?C++ AssemblyOptions::parallelizationOptions怎么用?C++ AssemblyOptions::parallelizationOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssemblyOptions
的用法示例。
在下文中一共展示了AssemblyOptions::parallelizationOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
AbstractBoundaryOperator<BasisFunctionType, ResultType>::
collectOptionsDependentDataForAssemblerConstruction(
const AssemblyOptions& options,
const shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
const shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
shared_ptr<Fiber::OpenClHandler>& openClHandler,
bool& cacheSingularIntegrals) const
{
typedef LocalAssemblerConstructionHelper Helper;
Helper::makeOpenClHandler(options.parallelizationOptions().openClOptions(),
testRawGeometry, trialRawGeometry, openClHandler);
cacheSingularIntegrals = options.isSingularIntegralCachingEnabled();
}
示例2: reallyMakeAssemblers
std::pair<
shared_ptr<typename HypersingularIntegralOperator<
BasisFunctionType, KernelType, ResultType>::LocalAssembler>,
shared_ptr<typename HypersingularIntegralOperator<
BasisFunctionType, KernelType, ResultType>::LocalAssembler>
>
HypersingularIntegralOperator<BasisFunctionType, KernelType, ResultType>::makeAssemblers(
const QuadratureStrategy& quadStrategy,
const AssemblyOptions& options) const
{
typedef Fiber::RawGridGeometry<CoordinateType> RawGridGeometry;
typedef std::vector<const Fiber::Shapeset<BasisFunctionType>*> ShapesetPtrVector;
const bool verbose = (options.verbosityLevel() >= VerbosityLevel::DEFAULT);
shared_ptr<RawGridGeometry> testRawGeometry, trialRawGeometry;
shared_ptr<GeometryFactory> testGeometryFactory, trialGeometryFactory;
shared_ptr<Fiber::OpenClHandler> openClHandler;
shared_ptr<ShapesetPtrVector> testShapesets, trialShapesets;
bool cacheSingularIntegrals;
if (verbose)
std::cout << "Collecting data for assembler construction..." << std::endl;
this->collectDataForAssemblerConstruction(options,
testRawGeometry, trialRawGeometry,
testGeometryFactory, trialGeometryFactory,
testShapesets, trialShapesets,
openClHandler, cacheSingularIntegrals);
if (verbose)
std::cout << "Data collection finished." << std::endl;
bool makeSeparateOffDiagonalAssembler =
options.assemblyMode() == AssemblyOptions::ACA &&
options.acaOptions().mode == AcaOptions::HYBRID_ASSEMBLY;
return reallyMakeAssemblers(quadStrategy,
testGeometryFactory, trialGeometryFactory,
testRawGeometry, trialRawGeometry,
testShapesets, trialShapesets, openClHandler,
options.parallelizationOptions(),
options.verbosityLevel(),
cacheSingularIntegrals,
makeSeparateOffDiagonalAssembler);
}
示例3: runtime_error
//.........这里部分代码省略.........
// acaOptions.recompress, acaOptions.eps,
// acaOptions.maximumRank, blocks.get());
// matgen_omp(helper, blockCount, AhmedBemBlclusterTree.get(),
// acaOptions.eps, acaOptions.maximumRank, blocks.get());
// // Dump mblocks
// const int mblockCount = AhmedBemBlclusterTree->nleaves();
// for (int i = 0; i < mblockCount; ++i)
// if (blocks[i]->isdns())
// {
// char buffer[1024];
// sprintf(buffer, "mblock-dns-%d-%d.txt",
// blocks[i]->getn1(), blocks[i]->getn2());
// arma::Col<ResultType> block((ResultType*)blocks[i]->getdata(),
// blocks[i]->nvals());
// arma::diskio::save_raw_ascii(block, buffer);
// }
// else
// {
// char buffer[1024];
// sprintf(buffer, "mblock-lwr-%d-%d.txt",
// blocks[i]->getn1(), blocks[i]->getn2());
// arma::Col<ResultType> block((ResultType*)blocks[i]->getdata(),
// blocks[i]->nvals());
// arma::diskio::save_raw_ascii(block, buffer);
// }
AhmedLeafClusterArray leafClusters(bemBlclusterTree.get());
leafClusters.sortAccordingToClusterSize();
const size_t leafClusterCount = leafClusters.size();
const ParallelizationOptions& parallelOptions =
options.parallelizationOptions();
int maxThreadCount = 1;
if (!parallelOptions.isOpenClEnabled())
{
if (parallelOptions.maxThreadCount() == ParallelizationOptions::AUTO)
maxThreadCount = tbb::task_scheduler_init::automatic;
else
maxThreadCount = parallelOptions.maxThreadCount();
}
tbb::task_scheduler_init scheduler(maxThreadCount);
tbb::atomic<size_t> done;
done = 0;
std::vector<ChunkStatistics> chunkStats(leafClusterCount);
// typedef AcaWeakFormAssemblerLoopBody<BasisFunctionType, ResultType> Body;
// // std::cout << "Loop start" << std::endl;
// tbb::tick_count loopStart = tbb::tick_count::now();
// // tbb::parallel_for(tbb::blocked_range<size_t>(0, leafClusterCount),
// // Body(helper, leafClusters, blocks, acaOptions, done
// // , chunkStats));
// tbb::parallel_for(ScatteredRange(0, leafClusterCount),
// Body(helper, leafClusters, blocks, acaOptions, done
// , chunkStats));
// tbb::tick_count loopEnd = tbb::tick_count::now();
// // std::cout << "Loop end" << std::endl;
typedef AcaWeakFormAssemblerLoopBody<BasisFunctionType, ResultType> Body;
typename Body::LeafClusterIndexQueue leafClusterIndexQueue;
for (size_t i = 0; i < leafClusterCount; ++i)
leafClusterIndexQueue.push(i);
if (verbosityAtLeastDefault)