const bool hasShapeToMesh,
const bool forExecutable)
{
- std::string cmd = GetExeName();
+ GHS3DPlugin_Hypothesis::ImplementedAlgorithms algoId = (ImplementedAlgorithms) hyp->myAlgorithm;
+ std::string cmd = GetExeName( algoId );
// check if any option is overridden by hyp->myTextOption
bool max_memory = hyp ? !hyp->HasOptionDefined("max_memory") : true;
bool auto_memory = hyp ? !hyp->HasOptionDefined("automatic_memory") : true;
useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
// MG-Tetra needs to know amount of memory it may use (MB).
- // Default memory is defined at MG-Tetra installation but it may be not enough,
- // so allow to use about all available memory
- if ( max_memory ) {
+ // Default memory is defined at MG-Tetra installation but it may be not enough, // so allow to use about all available memory
+ if ( algoId == MGTetra && max_memory ) {
float aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
cmd += " --max_memory ";
if ( aMaximumMemory < 0 ) cmd += SMESH_Comment( int( DefaultMaximumMemory() ));
else cmd += SMESH_Comment( int( aMaximumMemory ));
}
- if ( auto_memory && !useBndRecovery ) {
+ if ( algoId == MGTetra && ( auto_memory && !useBndRecovery ) ) {
float aInitialMemory = hyp ? hyp->myInitialMemory : -1;
cmd += " --automatic_memory ";
if ( aInitialMemory > 0 ) cmd += SMESH_Comment( int( aInitialMemory ));
cmd += " --optimisation_level none"; // issue 22608
}
else if ( optim_level && hyp && !useBndRecovery ) {
- if ( hyp->myOptimizationLevel >= 0 && hyp->myOptimizationLevel < 5 ) {
- const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
- cmd += " --optimisation_level ";
- cmd += level[ hyp->myOptimizationLevel ];
- }
+ const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
+ const short myOpt = hyp->myOptimizationLevel;
+
+ if ( myOpt >= 0 && myOpt < 5 && ( algoId == MGTetra || ( algoId == MGTetraHPC && myOpt != 3 ) ) ) {
+ cmd += " --optimisation_level ";
+ cmd += level[ myOpt ];
+ }
}
// to create internal nodes
cmd += " --gradation " + SMESH_Comment( hyp->myGradation );
if ( hyp->GetUseNumOfThreads() )
- {
+ {
cmd += " --max_number_of_threads " + SMESH_Comment( hyp->GetNumOfThreads() );
const char* pthreadMode[] = { "none" , "aggressive" , "safe" };
- if ( hyp->myPthreadModeMG >= 1 && hyp->myPthreadModeMG < 3 ) {
+ const char* parallelMode[] = { "none", "reproducible_given_max_number_of_threads", "reproducible", "aggressive" };
+
+ if ( algoId == MGTetra && hyp->myPthreadModeMG >= 1 && hyp->myPthreadModeMG < 3 ) {
cmd += " --pthreads_mode ";
cmd += pthreadMode[ hyp->myPthreadModeMG ];
}
+ else if ( algoId == MGTetraHPC && hyp->myPthreadModeMGHPC >= 1 && hyp->myPthreadModeMGHPC < 4 )
+ {
+ cmd += " --parallel_strategy ";
+ cmd += parallelMode[ hyp->myPthreadModeMGHPC ];
+ }
}
// proximity
*/
//================================================================================
-std::string GHS3DPlugin_Hypothesis::GetExeName()
+std::string GHS3DPlugin_Hypothesis::GetExeName( ImplementedAlgorithms algoId )
{
- return "mg-tetra.exe";
+ switch ( algoId )
+ {
+ case MGTetra:
+ return "mg-tetra.exe";
+ case MGTetraHPC:
+ return "mg-tetra_hpc.exe";
+ default:
+ throw( "Undefined algorithm id: ");
+ }
}
//================================================================================