Version: 9.15.0
SALOME_PyNode Namespace Reference

Data Structures

class  Generic
 
class  PyNode_i
 
class  SenderByte_i
 
class  CopyFileFromRemoteCtxMgr
 
class  BigFileOnDiskBase
 
class  BigFileOnDiskShare
 
class  BigFileOnDiskSSDNoShare
 
class  BigObjectDirHandler
 
class  BigObjectDirHandlerOnDiskShare
 
class  BigObjectDirHandlerOnDiskSSDNoShare
 
class  BigObjectOnDiskBase
 
class  BigObjectOnDisk
 
class  BigObjectOnDiskListElement
 
class  BigObjectOnDiskSequence
 
class  BigObjectOnDiskList
 
class  BigObjectOnDiskTuple
 
class  FileHolder
 
class  FileDeleter
 
class  MonitoringInfo
 
class  GenericPythonMonitoringLauncherCtxMgr
 
class  CPUMemInfo
 
class  InodeSizeInfo
 
class  SeqByteReceiver
 
class  PythonFunctionEvaluatorParams
 
class  ExchangeContextBridgeAbs
 
class  ExchangeContextUsingFile
 
class  ContextExchanger_i
 
class  ExchangeContextUsingTCP
 
class  ExchangeContextCltAbs
 
class  ExchangeContextUsingFileClt
 
class  ExchangeContextUsingTCPClt
 
class  LogOfCurrentExecutionSessionAbs
 
class  LogOfCurrentExecutionSession
 
class  LogOfCurrentExecutionSessionStub
 
class  PyScriptNode_Abstract_i
 
class  PyScriptNode_i
 
class  PyScriptNode_OutOfProcess_i
 
class  PyScriptNode_OutOfProcess_Replay_i
 
class  PyScriptNode_OutOfProcess_FT_i
 
class  PyScriptNode_OutOfProcess_Replay_FT_i
 

Functions

def IsRemote (hostName)
 
def RemoveFileSafe (fileName)
 
def RetrieveRemoteFileLocallyInSameFileName (remoteHostName, fileName)
 
def DestroyRemotely (remoteHostName, fileName)
 
def GetSizeOfBufferedReader (f)
 
def GetObjectFromFile (fname, visitor=None)
 
def DumpInFile (obj, fname)
 
def IncrRefInFile (fname)
 
def DecrRefInFile (fname)
 
def GetBigObjectOnDiskThreshold ()
 
def ActivateProxyMecanismOrNot (sizeInByte)
 
def GetBigObjectDirectory ()
 
def GetBigObjectFileName ()
 
def ProxyfyPickeled (obj, pickleObjInit=None, visitor=None)
 
def SpoolPickleObject (obj, visitor=None)
 
def UnProxyObjectSimple (obj, visitor=None)
 
def UnProxyObjectSimpleLocal (obj)
 
def FileSystemMonitoring (intervalInMs, dirNameToInspect, outFileName=None)
 
def CPUMemoryMonitoring (intervalInMs, outFileName=None)
 
def StopMonitoring (monitoringInfo)
 
def ReadCPUMemInfoInternal (fileName)
 
def ReadCPUMemInfo (monitoringInfo)
 
def ReadInodeSizeInfoInternal (fileName)
 
def ReadInodeSizeInfo (monitoringInfo)
 
def ExchangeModeServerSideFactory (exchangeMode)
 
def ExchangeModeCltSideFactory (exchangeMode, keepFilesToReplay)
 
def ExecCrashProofGeneric (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession, keepFilesToReplay, closeEyesOnErrorAtExit)
 
def ExecCrashProofWithReplay (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession)
 
def ExecCrashProofWithoutReplay (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession)
 
def ExecCrashProofWithReplayFT (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession)
 
def ExecCrashProofWithoutReplayFT (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession)
 
def ExecLocal (code, context, outargsname, containerRef, instanceOfLogOfCurrentSession)
 

Variables

string MY_CONTAINER_ENTRY_IN_GLBS = "my_container"
 
string MY_PERFORMANCE_LOG_ENTRY_IN_GLBS = "my_log_4_this_session"
 
string MY_KEY_TO_DETECT_FINISH = "neib av tuot"
 
dictionary BigFileOnDiskClsFromProtocol = { 0 : BigFileOnDiskShare, 1 : BigFileOnDiskSSDNoShare }
 
dictionary DicoForProxyFile = { }
 
dictionary BigObjectDirHandlerFromProtocol = { 0 : BigObjectDirHandlerOnDiskShare, 1 : BigObjectDirHandlerOnDiskSSDNoShare }
 
string FinalCode
 

Function Documentation

◆ ActivateProxyMecanismOrNot()

def SALOME_PyNode.ActivateProxyMecanismOrNot (   sizeInByte)

◆ CPUMemoryMonitoring()

def SALOME_PyNode.CPUMemoryMonitoring (   intervalInMs,
  outFileName = None 
)
Launch a subprocess monitoring self process.
This monitoring subprocess is a python process lauching every intervalInMs ms evaluation of
CPU usage and RSS memory of the calling process.
Communication between subprocess and self is done by file.

Args:
----
  outFileName (str) : name of file inside the results will be written. If None a new file is generated

See also FileSystemMonitoring

References SalomeOnDemandTK.extension_utilities.format.

Referenced by SALOME_PyNode.PyScriptNode_Abstract_i.executeSecond(), testPerfLogManager1.testPerfLogManager1.testPerfLogManager0(), and testPerfLogManager1.testPerfLogManager1.testPerfLogManager1().

◆ DecrRefInFile()

◆ DestroyRemotely()

def SALOME_PyNode.DestroyRemotely (   remoteHostName,
  fileName 
)

◆ DumpInFile()

def SALOME_PyNode.DumpInFile (   obj,
  fname 
)

◆ ExchangeModeCltSideFactory()

def SALOME_PyNode.ExchangeModeCltSideFactory (   exchangeMode,
  keepFilesToReplay 
)

Referenced by ExecCrashProofGeneric().

◆ ExchangeModeServerSideFactory()

def SALOME_PyNode.ExchangeModeServerSideFactory (   exchangeMode)

◆ ExecCrashProofGeneric()

def SALOME_PyNode.ExecCrashProofGeneric (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession,
  keepFilesToReplay,
  closeEyesOnErrorAtExit 
)
Equivalent of exec(code,context) but executed in a separate subprocess to avoid to make the current process crash.

Args:
-----

code (str) : python code to be executed using context
context (dict) : context to be used for execution. This context will be updated in accordance with the execution of code.
outargsname (list<str>) : list of arguments to be exported 
containerRef (Engines.Container) : Container ref (retrieving the Files to created when keepFilesToReplay is set to False)
instanceOfLogOfCurrentSession (LogOfCurrentExecutionSession) : instance of LogOfCurrentExecutionSession to build remotely the reference in order to log information
keepFilesToReplay (bool) : if True when something goes wrong during execution all the files to replay post mortem case are kept. If False only error is reported but files to replay are destoyed.
closeEyesOnErrorAtExit (bool) : if True in case of crash of subprocess, if MY_KEY_TO_DETECT_FINISH is displayed at the end of stdout

Return:
-------

ScriptExecInfo : instance serverside

In/Out:
-------

context will be modified by this method. elts in outargsname will be added and their corresponding value coming from evaluation.

References ExchangeModeCltSideFactory(), SalomeOnDemandTK.extension_utilities.format, and salome.salome_init().

Referenced by ExecCrashProofWithoutReplay(), ExecCrashProofWithoutReplayFT(), ExecCrashProofWithReplay(), and ExecCrashProofWithReplayFT().

◆ ExecCrashProofWithoutReplay()

def SALOME_PyNode.ExecCrashProofWithoutReplay (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession 
)

◆ ExecCrashProofWithoutReplayFT()

def SALOME_PyNode.ExecCrashProofWithoutReplayFT (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession 
)

◆ ExecCrashProofWithReplay()

def SALOME_PyNode.ExecCrashProofWithReplay (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession 
)

◆ ExecCrashProofWithReplayFT()

def SALOME_PyNode.ExecCrashProofWithReplayFT (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession 
)

◆ ExecLocal()

def SALOME_PyNode.ExecLocal (   code,
  context,
  outargsname,
  containerRef,
  instanceOfLogOfCurrentSession 
)

◆ FileSystemMonitoring()

def SALOME_PyNode.FileSystemMonitoring (   intervalInMs,
  dirNameToInspect,
  outFileName = None 
)
This method loops indefinitely every intervalInMs milliseconds to scan 
number of inodes and size of content recursively included into the in input directory.

Args:
----

outFileName (str) : name of file inside the results will be written. If None a new file is generated

See also CPUMemoryMonitoring

References SalomeOnDemandTK.extension_utilities.format.

Referenced by testPerfLogManager1.testPerfLogManager1.testPerfLogManager0(), and testPerfLogManager1.testPerfLogManager1.testPerfLogManager1().

◆ GetBigObjectDirectory()

def SALOME_PyNode.GetBigObjectDirectory ( )

Referenced by GetBigObjectFileName().

◆ GetBigObjectFileName()

def SALOME_PyNode.GetBigObjectFileName ( )
Return a filename in the most secure manner (see tempfile documentation)

References GetBigObjectDirectory().

Referenced by ProxyfyPickeled().

◆ GetBigObjectOnDiskThreshold()

◆ GetObjectFromFile()

def SALOME_PyNode.GetObjectFromFile (   fname,
  visitor = None 
)

◆ GetSizeOfBufferedReader()

def SALOME_PyNode.GetSizeOfBufferedReader (   f)
This method returns in bytes size of a file openned.

Args:
----
    f (io.IOBase): buffered reader returned by open
    
Returns
-------
    int: number of bytes

Referenced by GetObjectFromFile().

◆ IncrRefInFile()

def SALOME_PyNode.IncrRefInFile (   fname)
:param fname:
:type fname: str

Referenced by SALOME_PyNode.BigObjectOnDiskBase.incrRef().

◆ IsRemote()

def SALOME_PyNode.IsRemote (   hostName)

◆ ProxyfyPickeled()

def SALOME_PyNode.ProxyfyPickeled (   obj,
  pickleObjInit = None,
  visitor = None 
)
This method return a proxy instance of pickled form of object given in input.

Args:
----
    obj (pickelable type) : object to be proxified
    pickleObjInit (bytes) : Optionnal. Original pickeled form of object to be proxyfied if already computed. If not this method generate it

Returns
-------
    BigObjectOnDiskBase: proxy instance

References GetBigObjectFileName().

Referenced by SpoolPickleObject(), testPerfLogManager1.testPerfLogManager1.testPerfLogManager0(), and testPerfLogManager1.testPerfLogManager1.testPerfLogManager1().

◆ ReadCPUMemInfo()

def SALOME_PyNode.ReadCPUMemInfo (   monitoringInfo)
Retrieve CPU/Mem data of monitoring.

Args:
----
    monitoringInfo (MonitoringInfo): info returned by LaunchMonitoring

Returns
-------
  CPUMemInfo instance

References ReadCPUMemInfoInternal().

Referenced by SALOME_PyNode.PyScriptNode_Abstract_i.executeSecond(), testPerfLogManager1.testPerfLogManager1.testPerfLogManager0(), and testPerfLogManager1.testPerfLogManager1.testPerfLogManager1().

◆ ReadCPUMemInfoInternal()

def SALOME_PyNode.ReadCPUMemInfoInternal (   fileName)

Referenced by ReadCPUMemInfo().

◆ ReadInodeSizeInfo()

def SALOME_PyNode.ReadInodeSizeInfo (   monitoringInfo)
Retrieve nb of inodes and size of monitoring

Args:
----
    monitoringInfo (MonitoringInfo): info returned by LaunchMonitoring

Returns
-------
  InodeSizeInfo

References ReadInodeSizeInfoInternal().

Referenced by testPerfLogManager1.testPerfLogManager1.testPerfLogManager0(), and testPerfLogManager1.testPerfLogManager1.testPerfLogManager1().

◆ ReadInodeSizeInfoInternal()

def SALOME_PyNode.ReadInodeSizeInfoInternal (   fileName)

Referenced by ReadInodeSizeInfo().

◆ RemoveFileSafe()

def SALOME_PyNode.RemoveFileSafe (   fileName)

◆ RetrieveRemoteFileLocallyInSameFileName()

def SALOME_PyNode.RetrieveRemoteFileLocallyInSameFileName (   remoteHostName,
  fileName 
)

◆ SpoolPickleObject()

def SALOME_PyNode.SpoolPickleObject (   obj,
  visitor = None 
)

◆ StopMonitoring()

def SALOME_PyNode.StopMonitoring (   monitoringInfo)
Kill monitoring subprocess.

Args:
----
    monitoringInfo (MonitoringInfo): info returned by LaunchMonitoring

Referenced by salome.LogManagerLaunchMonitoringFileCtxMgr.__exit__(), SALOME_PyNode.GenericPythonMonitoringLauncherCtxMgr.__exit__(), and KERNEL_PY.LogManagerLaunchMonitoringFileCtxMgr.__exit__().

◆ UnProxyObjectSimple()

def SALOME_PyNode.UnProxyObjectSimple (   obj,
  visitor = None 
)
Method to be called in Remote mode. Alterate the obj _status attribute. 
Because the slave process does not participate in the reference counting

Args:
----
    visitor (InOutputObjVisitor): A visitor to keep track of amount of memory on chip and those on HDD

References SalomeOnDemandTK.extension_utilities.format.

Referenced by SALOME_PyNode.PyScriptNode_Abstract_i.executeFirst(), testCrashProofContainer.testPerfLogManager1.test6(), testCrashProofContainer.testPerfLogManager1.test7(), testCrashProofContainer.testPerfLogManager1.test8(), and testCrashProofContainer.testPerfLogManager1.test9().

◆ UnProxyObjectSimpleLocal()

def SALOME_PyNode.UnProxyObjectSimpleLocal (   obj)
Method to be called in Local mode. Do not alterate the PyObj counter

Variable Documentation

◆ BigFileOnDiskClsFromProtocol

dictionary SALOME_PyNode.BigFileOnDiskClsFromProtocol = { 0 : BigFileOnDiskShare, 1 : BigFileOnDiskSSDNoShare }

◆ BigObjectDirHandlerFromProtocol

dictionary SALOME_PyNode.BigObjectDirHandlerFromProtocol = { 0 : BigObjectDirHandlerOnDiskShare, 1 : BigObjectDirHandlerOnDiskSSDNoShare }

◆ DicoForProxyFile

dictionary SALOME_PyNode.DicoForProxyFile = { }

◆ FinalCode

string SALOME_PyNode.FinalCode

◆ MY_CONTAINER_ENTRY_IN_GLBS

string SALOME_PyNode.MY_CONTAINER_ENTRY_IN_GLBS = "my_container"

◆ MY_KEY_TO_DETECT_FINISH

string SALOME_PyNode.MY_KEY_TO_DETECT_FINISH = "neib av tuot"

◆ MY_PERFORMANCE_LOG_ENTRY_IN_GLBS

string SALOME_PyNode.MY_PERFORMANCE_LOG_ENTRY_IN_GLBS = "my_log_4_this_session"