mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-04 20:14:16 +05:00
Moving creation/deletion of temporary folder as __del__ is not called (Unregister removed from smeshBuilder)
This commit is contained in:
parent
3fb90fec5e
commit
e749ba3f4e
@ -289,6 +289,7 @@ bool SMESH_Gen::parallelComputeSubMeshes(
|
||||
// Pool of thread for computation
|
||||
// TODO: move when parallelMesh created
|
||||
aMesh.InitPoolThreads();
|
||||
aMesh.CreateTmpFolder();
|
||||
|
||||
TopAbs_ShapeEnum previousShapeType = TopAbs_VERTEX;
|
||||
int nbThreads = aMesh.GetNbThreads();
|
||||
@ -365,6 +366,7 @@ bool SMESH_Gen::parallelComputeSubMeshes(
|
||||
aMesh.wait();
|
||||
|
||||
aMesh.GetMeshDS()->Modified();
|
||||
aMesh.DeleteTmpFolder();
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
@ -124,9 +124,6 @@ SMESH_Mesh::SMESH_Mesh(int theLocalId,
|
||||
_callUp = NULL;
|
||||
_meshDS->ShapeToMesh( PseudoShape() );
|
||||
_subMeshHolder = new SubMeshHolder;
|
||||
// Temporary folder that will be used by parallel computation
|
||||
tmp_folder = fs::temp_directory_path()/fs::unique_path(fs::path("SMESH_%%%%-%%%%"));
|
||||
fs::create_directories(tmp_folder);
|
||||
|
||||
// assure unique persistent ID
|
||||
if ( _document->NbMeshes() > 1 )
|
||||
@ -243,9 +240,6 @@ SMESH_Mesh::~SMESH_Mesh()
|
||||
if(_pool)
|
||||
DeletePoolThreads();
|
||||
#endif
|
||||
#ifndef _DEBUG_
|
||||
fs::remove_all(tmp_folder);
|
||||
#endif
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
@ -2575,3 +2569,28 @@ void SMESH_Mesh::getAncestorsSubMeshes (const TopoDS_Shape& theSubSha
|
||||
// sort submeshes according to stored mesh order
|
||||
SortByMeshOrder( theSubMeshes );
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* \brief Build folder for parallel computation
|
||||
*/
|
||||
//=============================================================================
|
||||
void SMESH_Mesh::CreateTmpFolder()
|
||||
{
|
||||
// Temporary folder that will be used by parallel computation
|
||||
tmp_folder = fs::temp_directory_path()/fs::unique_path(fs::path("SMESH_%%%%-%%%%"));
|
||||
fs::create_directories(tmp_folder);
|
||||
}
|
||||
//
|
||||
//=============================================================================
|
||||
/*!
|
||||
* \brief Delete temporary folder used for parallel computation
|
||||
*/
|
||||
//=============================================================================
|
||||
void SMESH_Mesh::DeleteTmpFolder()
|
||||
{
|
||||
#ifndef _DEBUG_
|
||||
fs::remove_all(tmp_folder);
|
||||
#endif
|
||||
}
|
||||
|
@ -418,6 +418,9 @@ class SMESH_EXPORT SMESH_Mesh
|
||||
bool IsParallel(){return _NbThreads > 0;}
|
||||
#endif
|
||||
|
||||
void CreateTmpFolder();
|
||||
void DeleteTmpFolder();
|
||||
|
||||
// Temporary folder used during parallel Computation
|
||||
boost::filesystem::path tmp_folder;
|
||||
#ifndef WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user