Commit 3fe5ac36 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

SolverOptions blasIsThreadSafe added

BLAS and OpenBLAS will be assumed not be thread safe
unless you explicitly mark them with
blasIsThreadSafe in SolverOptions
parent 91390839
......@@ -145,6 +145,11 @@ public:
return (model_.params().options.find("KronLoadBalance") != PsimagLite::String::npos);
}
bool blasIsThreadSafe() const
{
return (model_.params().options.find("blasIsThreadSafe") != PsimagLite::String::npos);
}
// -------------------
// copy vin(:) to yin(:)
// -------------------
......
......@@ -141,7 +141,10 @@ public:
KronConnectionsType kc(initKron_);
typedef PsimagLite::Parallelizer<KronConnectionsType> ParallelizerType;
ParallelizerType parallelConnections(PsimagLite::Concurrency::codeSectionParams);
SizeType threads = (initKron_.blasIsThreadSafe()) ? PsimagLite::Concurrency::
codeSectionParams.npthreads : 1 ;
PsimagLite::CodeSectionParams codeSectionParams(threads);
ParallelizerType parallelConnections(codeSectionParams);
if (initKron_.loadBalance())
parallelConnections.loopCreate(kc, initKron_.weightsOfPatchesNew());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment