From: Anthony Geay Date: Tue, 18 Jun 2024 06:29:31 +0000 (+0200) Subject: [EDF30157] : Very first running of SSDShared case X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2003eefe5d39b95cb771e9f197116fd884b94cc;p=modules%2Fkernel.git [EDF30157] : Very first running of SSDShared case --- diff --git a/src/Basics/KernelBasis.cxx b/src/Basics/KernelBasis.cxx index 63e692922..d06fe8365 100644 --- a/src/Basics/KernelBasis.cxx +++ b/src/Basics/KernelBasis.cxx @@ -195,7 +195,7 @@ std::string SALOME::BigObjOnDiskProtocolToStr(BigObjTransferProtocol protocol) case SALOME::BigObjTransferProtocol::SSDCopyFileSystem: return SALOME::SSD_COPY_FILE_SYSTEM_PROTOCOL_STR; default: - throw std::runtime_error("FromIntToBigObjOnDiskProtocol unrecognized protocol ! should be in [0,1] !"); + throw std::runtime_error("BigObjOnDiskProtocolToStr unrecognized protocol ! should be in [0,1] !"); } } @@ -217,12 +217,12 @@ SALOME::BigObjTransferProtocol SALOME::GetBigObjOnDiskProtocolAndDirectory(std:: return SALOME::BigObjTransferProtocol::SharedFileSystem; } std::istringstream iss(protocol.substr(1,1)); iss.exceptions(std::istringstream::failbit | std::istringstream::badbit); - char iproxyprot = 0; + short iproxyprot = 0; iss >> iproxyprot; return FromIntToBigObjOnDiskProtocol( iproxyprot ); } -std::string SALOME::GetBigObjOnDiskDirectory() +std::string SALOME::GetBigObjOnDiskDirectoryCoarse() { return SALOME_FILE_BIG_OBJ_DIR; } diff --git a/src/Basics/KernelBasis.hxx b/src/Basics/KernelBasis.hxx index 2b3547e4b..360efc375 100644 --- a/src/Basics/KernelBasis.hxx +++ b/src/Basics/KernelBasis.hxx @@ -58,7 +58,7 @@ namespace SALOME BigObjTransferProtocol BASICS_EXPORT BigObjOnDiskProtocolFromStr(const std::string& protocol); BigObjTransferProtocol BASICS_EXPORT FromIntToBigObjOnDiskProtocol(char protocol); BigObjTransferProtocol BASICS_EXPORT GetBigObjOnDiskProtocolAndDirectory(std::string& directory); - std::string BASICS_EXPORT GetBigObjOnDiskDirectory(); + std::string BASICS_EXPORT GetBigObjOnDiskDirectoryCoarse(); void BASICS_EXPORT SetBigObjOnDiskDirectory(const std::string& directory); bool BASICS_EXPORT BigObjOnDiskDirectoryDefined(); void BASICS_EXPORT SetNumberOfRetry(int nbRetry); diff --git a/src/Basics/KernelBasis.i b/src/Basics/KernelBasis.i index c87b89a5a..3f2ed7dab 100644 --- a/src/Basics/KernelBasis.i +++ b/src/Basics/KernelBasis.i @@ -53,7 +53,6 @@ using namespace SALOME; %rename (HeatMarcel) HeatMarcelSwig; %rename (GetBigObjOnDiskThreshold) GetBigObjOnDiskThresholdSwig; %rename (SetBigObjOnDiskThreshold) SetBigObjOnDiskThresholdSwig; -%rename (GetBigObjOnDiskDirectory) GetBigObjOnDiskDirectorySwig; %rename (GetBigObjOnDiskProtocolAndDirectory) GetBigObjOnDiskProtocolAndDirectorySwig; %rename (BigObjOnDiskProtocolFromStr) BigObjOnDiskProtocolFromStrSwig; %rename (BigObjOnDiskProtocolToStr) BigObjOnDiskProtocolToStrSwig; @@ -132,11 +131,6 @@ void SetBigObjOnDiskThresholdSwig(int newThreshold) return SALOME::SetBigObjOnDiskThreshold(newThreshold); } -std::string GetBigObjOnDiskDirectorySwig() -{ - return SALOME::GetBigObjOnDiskDirectory(); -} - void SetBigObjOnDiskDirectorySwig(const std::string& directory) { return SALOME::SetBigObjOnDiskDirectory(directory); diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 4ac6468c8..8a322b92d 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -549,7 +549,7 @@ Engines::Container_ptr SALOME_ContainerManager::GiveContainer(const Engines::Con std::ostringstream envInfo; std::for_each( _override_env.begin(), _override_env.end(), [&envInfo](const std::pair& p) { envInfo << p.first << " = " << p.second << " "; } ); INFOS("[GiveContainer] container " << containerNameInNS << " override " << envInfo.str()); - cont->set_big_obj_on_disk_directory( SALOME::GetBigObjOnDiskDirectory().c_str() ); + cont->set_big_obj_on_disk_directory( SALOME::GetBigObjOnDiskDirectoryCoarse().c_str() ); cont->set_big_obj_on_disk_threshold( SALOME::GetBigObjOnDiskThreshold() ); cont->set_number_of_retry( SALOME::GetNumberOfRetry() ); Engines::FieldsDict envCorba; diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index 003e4edf6..c85d73ec7 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -156,7 +156,7 @@ class BigFileOnDiskBase(abc.ABC): def __init__(self, fileName): self._file_name = fileName - def getFileName(self, value): + def getFileName(self): return self._file_name @abc.abstractmethod @@ -276,7 +276,7 @@ def GetBigObjectDirectory(): protocol, directory = KernelBasis.GetBigObjOnDiskProtocolAndDirectory() if not directory: raise RuntimeError("An object of size higher than limit detected and no directory specified to dump it in file !") - return protocol, os.path.expanduser( os.path.expandvars( KernelBasis.GetBigObjOnDiskDirectory() ) ) + return protocol, os.path.expanduser( os.path.expandvars( directory ) ) def GetBigObjectFileName(): """ @@ -336,7 +336,7 @@ class BigObjectOnDiskBase: return self._filename def __dumpIntoFile(self, objSerialized): - DumpInFile( objSerialized, self._filename ) + DumpInFile( objSerialized, self._filename.getFileName() ) def get(self, visitor = None): return self._filename.get(visitor)