The highest level API should not change any more.
Tests need to be added.
}
}
+void ComposedNode::setProperty(const std::string& name,const std::string& value)
+{
+ Node::setProperty(name, value);
+}
+
+std::string ComposedNode::getProperty(const std::string& name)
+{
+ return Node::getProperty(name);
+}
+
+
//! redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
std::list<InputPort *> ComposedNode::getLocalInputPorts() const
{
void accept(Visitor *visitor);
virtual void cleanNodes();
virtual std::string getProgress() const { return "0"; }
+ void setProperty(const std::string& name,const std::string& value)override;
+ std::string getProperty(const std::string& name)override;
protected:
struct SortHierarc
{
}
DEBTRACE("End of RunB thread");
}
+
+void Executor::RunW(Scheduler *graph,int debug, bool fromScratch)
+{
+ std::string str_value = graph->getProperty("executor");
+ if(str_value == "WorkloadManager"
+ || str_value == "WORKLOADMANAGER"
+ || str_value == "workloadmanager"
+ || str_value == "WorkLoadManager")
+ newRun(graph, debug, fromScratch);
+ else
+ RunB(graph, debug, fromScratch);
+}
Executor();
virtual ~Executor();
void RunA(Scheduler *graph,int debug=0, bool fromScratch=true);
- void RunW(Scheduler *graph,int debug=0, bool fromScratch=true)
- {
- //RunB(graph, debug, fromScratch);
- newRun(graph, debug, fromScratch);
- }
+ void RunW(Scheduler *graph,int debug=0, bool fromScratch=true);
void RunB(Scheduler *graph,int debug=0, bool fromScratch=true);
void newRun(Scheduler *graph,int debug=0, bool fromScratch=true);
void setKeepGoingProperty(bool newVal) { _keepGoingOnFail=newVal; }
virtual bool isPlacementPredictableB4Run() const = 0;
virtual bool isMultiplicitySpecified(unsigned& value) const = 0;
virtual void forceMultiplicity(unsigned value) = 0;
+ virtual void setProperty(const std::string& name,const std::string& value)=0;
+ virtual std::string getProperty(const std::string& name)=0;
virtual ~Scheduler();
};
}
" args=pickle.loads(st)\n"
" return args\n";
-const char PythonNode::KEEP_CONTEXT_PROPERTY[]="KEEP_CONTEXT";
+const char PythonNode::KEEP_CONTEXT_PROPERTY[]="keep_context";
PythonEntry::PythonEntry():_context(0),_pyfuncSer(0),_pyfuncUnser(0),_pyfuncSimpleSer(0)
{
}
}
-// TODO: verify removing
std::string PythonEntry::GetContainerLog(const std::string& mode, Container *container, const Task *askingTask)
{
if(mode=="local")
bool PythonNode::keepContext()const
{
- std::string str_value = const_cast<PythonNode*>(this)->getProperty(KEEP_CONTEXT_PROPERTY);
- const char* yes_values[] = {"YES", "Yes", "yes", "TRUE", "True", "true", "1",
- "ON", "on", "On"};
bool found = false;
- for(const char* v : yes_values)
- if(str_value == v)
- {
- found = true;
- break;
- }
+ if(_container)
+ {
+ std::string str_value = _container->getProperty(KEEP_CONTEXT_PROPERTY);
+ const char* yes_values[] = {"YES", "Yes", "yes", "TRUE", "True", "true", "1",
+ "ON", "on", "On"};
+ for(const char* v : yes_values)
+ if(str_value == v)
+ {
+ found = true;
+ break;
+ }
+ }
return found;
}
-void PythonNode::setKeepContext(bool keep)
-{
- if(keep)
- setProperty(KEEP_CONTEXT_PROPERTY, "true");
- else
- setProperty(KEEP_CONTEXT_PROPERTY, "false");
-}
-
Node *PythonNode::simpleClone(ComposedNode *father, bool editionOnly) const
{
return new PythonNode(*this,father);
const std::string& container_name) override;
bool canAcceptImposedResource()override;
bool keepContext()const;
- void setKeepContext(bool keep);
std::string getContainerLog();
PythonNode* cloneNode(const std::string& name);
virtual std::string typeName() { return "YACS__ENGINE__PythonNode"; }