Fixed: Deactivate multi-threading for patches with rigid couplings
This commit is contained in:
parent
7c0d5e8ee6
commit
d1e222590b
@ -3279,29 +3279,10 @@ void ASMs2D::generateThreadGroupsFromElms (const IntVec& elms)
|
|||||||
bool ASMs2D::addRigidCpl (int lindx, int ldim, int basis,
|
bool ASMs2D::addRigidCpl (int lindx, int ldim, int basis,
|
||||||
int& gMaster, const Vec3& Xmaster, bool extraPt)
|
int& gMaster, const Vec3& Xmaster, bool extraPt)
|
||||||
{
|
{
|
||||||
if (ldim == 1)
|
if (threadGroups.stripDir != ThreadGroups::NONE)
|
||||||
{
|
IFEM::cout <<" ** ASMs2D::addRigidCpl: Multi-threading deactivated"
|
||||||
ThreadGroups::StripDirection useDir = ThreadGroups::ANY;
|
<<" for Patch "<< idx+1 << std::endl;
|
||||||
switch (lindx) {
|
threadGroups.stripDir = ThreadGroups::NONE;
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
useDir = ThreadGroups::U;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
useDir = ThreadGroups::V;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (threadGroups.stripDir == ThreadGroups::ANY)
|
|
||||||
threadGroups.stripDir = useDir;
|
|
||||||
else if (threadGroups.stripDir != useDir)
|
|
||||||
{
|
|
||||||
threadGroups.stripDir = ThreadGroups::NONE;
|
|
||||||
IFEM::cout <<" ** ASMs2D::addRigidCpl: Conflicting strip directions."
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt);
|
return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "Vec3Oper.h"
|
#include "Vec3Oper.h"
|
||||||
#include "Vec3.h"
|
#include "Vec3.h"
|
||||||
#include "MPC.h"
|
#include "MPC.h"
|
||||||
|
#include "IFEM.h"
|
||||||
|
|
||||||
//! \brief Solves A1j*xi*eta + A2j*ci + A3j*eta = A4j, j=1,2 for xi,eta.
|
//! \brief Solves A1j*xi*eta + A2j*ci + A3j*eta = A4j, j=1,2 for xi,eta.
|
||||||
extern "C" void dslbln_(const int& ipsw, const int& iwr, const double& eps,
|
extern "C" void dslbln_(const int& ipsw, const int& iwr, const double& eps,
|
||||||
@ -318,6 +319,11 @@ bool ASMs2DC1::addRigidCpl (int lindx, int ldim, int basis,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (threadGroups.stripDir != ThreadGroups::NONE)
|
||||||
|
IFEM::cout <<" ** ASMs2DC1::addRigidCpl: Multi-threading deactivated"
|
||||||
|
<<" for Patch "<< idx+1 << std::endl;
|
||||||
|
threadGroups.stripDir = ThreadGroups::NONE;
|
||||||
|
|
||||||
return extraPt;
|
return extraPt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3505,7 +3505,13 @@ void ASMs3D::generateThreadGroups (size_t strip1, size_t strip2, size_t strip3,
|
|||||||
|
|
||||||
void ASMs3D::generateThreadGroups (char lIndex, bool silence, bool)
|
void ASMs3D::generateThreadGroups (char lIndex, bool silence, bool)
|
||||||
{
|
{
|
||||||
if (threadGroupsFace.find(lIndex) != threadGroupsFace.end()) return;
|
std::map<char,ThreadGroups>::iterator tit = threadGroupsFace.find(lIndex);
|
||||||
|
if (tit != threadGroupsFace.end())
|
||||||
|
{
|
||||||
|
if (tit->second.stripDir == ThreadGroups::NONE)
|
||||||
|
tit->second.oneGroup(nel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const int p1 = svol->order(0) - 1;
|
const int p1 = svol->order(0) - 1;
|
||||||
const int p2 = svol->order(1) - 1;
|
const int p2 = svol->order(1) - 1;
|
||||||
@ -3820,33 +3826,11 @@ void ASMs3D::generateThreadGroupsFromElms (const IntVec& elms)
|
|||||||
bool ASMs3D::addRigidCpl (int lindx, int ldim, int basis,
|
bool ASMs3D::addRigidCpl (int lindx, int ldim, int basis,
|
||||||
int& gMaster, const Vec3& Xmaster, bool extraPt)
|
int& gMaster, const Vec3& Xmaster, bool extraPt)
|
||||||
{
|
{
|
||||||
if (ldim == 2)
|
if (threadGroupsVol.stripDir != ThreadGroups::NONE)
|
||||||
{
|
IFEM::cout <<" ** ASMs3D::addRigidCpl: Multi-threading deactivated"
|
||||||
ThreadGroups::StripDirection useDir = ThreadGroups::ANY;
|
<<" for Patch "<< idx+1 << std::endl;
|
||||||
switch (lindx) {
|
threadGroupsVol.stripDir = ThreadGroups::NONE;
|
||||||
case 1:
|
threadGroupsFace[lindx].stripDir = ThreadGroups::NONE;
|
||||||
case 2:
|
|
||||||
useDir = ThreadGroups::U;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
useDir = ThreadGroups::V;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
case 6:
|
|
||||||
useDir = ThreadGroups::W;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (threadGroupsVol.stripDir == ThreadGroups::ANY)
|
|
||||||
threadGroupsVol.stripDir = useDir;
|
|
||||||
else if (threadGroupsVol.stripDir != useDir)
|
|
||||||
{
|
|
||||||
threadGroupsVol.stripDir = ThreadGroups::NONE;
|
|
||||||
IFEM::cout <<" ** ASMs3D::addRigidCpl: Conflicting strip directions."
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt);
|
return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user