void assignVarInContext(in string varName, in pickledArgs value) raises (SALOME::SALOME_Exception);
pickledArgs callMethodOnVarInContext(in string varName, in string methodName, in pickledArgs args) raises (SALOME::SALOME_Exception);
+
+ listofstring listAllVarsInContext() raises (SALOME::SALOME_Exception);
+
+ void removeAllVarsInContext() raises (SALOME::SALOME_Exception);
} ;
};
#include <vector>
#include <numeric>
#include <chrono>
-
-#include <iostream>
+#include <iomanip>
template<class T>
static void GetSlice(T start, T stop, const unsigned int sliceId, const unsigned int nbOfSlices, T& startSlice, T& stopSlice)
static long double SimulateOnAllCoresOfComputationNodeInternal(std::uint64_t nbTurn, unsigned int nbThreads)
{
- SIMPLE_MESSAGE( "Number of turn = 10**" << std::log10((double)nbTurn) );
+ SIMPLE_MESSAGE( "Number of turn = " << std::scientific << std::setprecision(12) << (double)nbTurn );
std::vector< std::thread > threads(nbThreads);
std::vector<long double> res(nbThreads);
for(auto iCore = 0 ; iCore < nbThreads ; ++iCore)
import os
if SALOME_FILE_BIG_OBJ_DIR not in os.environ:
raise RuntimeError("An object of size higher than limit detected and no directory specified to dump it in file !")
- return os.environ[SALOME_FILE_BIG_OBJ_DIR]
+ return os.path.expandvars( os.path.expandvars( os.environ[SALOME_FILE_BIG_OBJ_DIR] ) )
def GetBigObjectFileName():
"""
data = argsInPy.data()
_,kws=pickle.loads(data)
for elt in kws:
+ # fetch real data if necessary
kws[elt] = UnProxyObject( kws[elt] )
self.context.update(kws)
except Exception:
argsout.append(self.context[arg])
ret = [ ]
for arg in argsout:
+ # the proxy mecanism is catched here
argPickle = SpoolPickleObject( arg )
retArg = SenderByte_i( self.poa,argPickle )
id_o = self.poa.activate_object(retArg)
l=traceback.format_exception(exc_typ,exc_val,exc_fr)
raise SALOME.SALOME_Exception(SALOME.ExceptionStruct(SALOME.BAD_PARAM,"".join(l),"PyScriptNode:Second %s, outargsname: %s" % (self.nodeName,outargsname),0))
+ def listAllVarsInContext(self):
+ import re
+ pat = re.compile("^__([a-z]+)__$")
+ return [elt for elt in self.context if not pat.match(elt)]
+
+ def removeAllVarsInContext(self):
+ for elt in self.listAllVarsInContext():
+ del self.context[elt]
+
def getValueOfVarInContext(self,varName):
try:
return pickle.dumps(self.context[varName],-1)