Better error handling for parallel mesh

This commit is contained in:
YOANN AUDOUIN 2023-12-13 11:15:08 +01:00
parent 1dab7a05bb
commit d006955bea
2 changed files with 3 additions and 4 deletions

View File

@ -61,7 +61,6 @@ SMESH_ParallelMesh::~SMESH_ParallelMesh()
void SMESH_ParallelMesh::cleanup() void SMESH_ParallelMesh::cleanup()
{ {
DeletePoolThreads(); DeletePoolThreads();
std::cout << "Keeping tmp folder" << keepingTmpFolfer() << std::endl;
if(!keepingTmpFolfer()) if(!keepingTmpFolfer())
{ {
MESSAGE("Set SMESH_KEEP_TMP to > 0 to keep temporary folders") MESSAGE("Set SMESH_KEEP_TMP to > 0 to keep temporary folders")
@ -78,7 +77,6 @@ void SMESH_ParallelMesh::cleanup()
bool SMESH_ParallelMesh::keepingTmpFolfer() bool SMESH_ParallelMesh::keepingTmpFolfer()
{ {
const char* envVar = std::getenv("SMESH_KEEP_TMP"); const char* envVar = std::getenv("SMESH_KEEP_TMP");
std::cout << "smesh_keep_tmp: " << envVar << std::endl;
if (envVar && (envVar[0] != '\0')) if (envVar && (envVar[0] != '\0'))
{ {

View File

@ -244,10 +244,11 @@ def run_pylauncher(args):
del_tmp_folder = True del_tmp_folder = True
try: try:
val = int(environ.get("SMESH_KEEP_TMP", "0")) val = int(environ.get("SMESH_KEEP_TMP", "0"))
del_tmp_folder = val > 0 del_tmp_folder = val < 0
except Exception as e: except Exception as e:
del_tmp_folder = True del_tmp_folder = True
if del_tmp_folder:
launcher.clearJobWorkingDir(job_id) launcher.clearJobWorkingDir(job_id)
def def_arg(): def def_arg():