From 33fc632115e554b442fcdf71a0da69a4f58ea8d3 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 13 Dec 2012 13:15:16 +0000 Subject: [PATCH] Merge from V6_main 13/12/2012 --- Makefile.am | 1 + YACS_version.h.in | 31 +++++++++++++++ clean_configure | 3 +- configure.in.base | 3 ++ doc/Doxyfile | 49 +++++++++++++++--------- doc/Makefile.am | 4 +- doc/calculator.rst | 2 +- doc/conf.py.in | 2 +- doc/principes.rst | 21 ++++------ doc/resource.rst | 35 +++++++++++++++++ doc/using.rst | 1 + src/bases/ThreadPT.cxx | 12 +++++- src/bases/ThreadPT.hxx | 2 +- src/engine/Executor.cxx | 3 +- src/engine/Executor.hxx | 1 + src/engine/Runtime.cxx | 20 +++++++--- src/engine/VisitorSaveState.cxx | 20 ++++++++++ src/runtime/Makefile.am | 1 + src/runtime/RuntimeSALOME.cxx | 10 +++++ src/runtime/RuntimeSALOME.hxx | 2 + src/runtime/SalomeProc.cxx | 2 +- src/salomegui/Yacsgui.cxx | 2 +- src/salomegui/resources/SalomeApp.xml.in | 1 + src/yacsloader/LoadState.cxx | 48 ++++++++++++++++++++++- src/yacsorb/YACS.py | 12 ++++++ 25 files changed, 239 insertions(+), 49 deletions(-) create mode 100644 YACS_version.h.in create mode 100644 doc/resource.rst diff --git a/Makefile.am b/Makefile.am index 1504843f7..548aef3f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,3 +44,4 @@ EXTRA_DIST = Misc \ configure.in.base \ rfind +salomeinclude_HEADERS = YACS_version.h diff --git a/YACS_version.h.in b/YACS_version.h.in new file mode 100644 index 000000000..665c6dffc --- /dev/null +++ b/YACS_version.h.in @@ -0,0 +1,31 @@ +// Copyright (C) 2006-2012 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#if !defined(__YACS_VERSION_H__) +#define __YACS_VERSION_H__ + +/* + YACS_VERSION is (major << 16) + (minor << 8) + patch. +*/ + +#define YACS_VERSION_STR "@VERSION@" +#define YACS_VERSION @XVERSION@ +#define YACS_DEVELOPMENT @VERSION_DEV@ + +#endif // __YACS_VERSION_H__ diff --git a/clean_configure b/clean_configure index aa98965bc..db4a63501 100755 --- a/clean_configure +++ b/clean_configure @@ -32,7 +32,8 @@ TO_CLEAN=${TO_CLEAN}' yacs_config.h.in' rm -rf $TO_CLEAN > /dev/null -find . -name "Makefile.in" -or -name "*~" -exec rm -f {} \; +find . -name "Makefile.in" -exec rm -f {} \; +find . -name "*~" -exec rm -f {} \; find . -name "semantic.cache" -exec rm {} \; find . -name "*.pyc" -exec rm {} \; rm -f src/salomegui_swig/doc.i diff --git a/configure.in.base b/configure.in.base index aebf91156..ffb518804 100644 --- a/configure.in.base +++ b/configure.in.base @@ -35,6 +35,8 @@ SHORT_VERSION=`echo $VERSION | awk -F. '{printf("%d.%d",$1,$2)}'` AC_SUBST(SHORT_VERSION) XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'` AC_SUBST(XVERSION) +VERSION_DEV=1 +AC_SUBST(VERSION_DEV) RELEASE=$VERSION AC_SUBST(RELEASE) @@ -166,6 +168,7 @@ fi AC_OUTPUT([ \ Makefile \ + YACS_version.h \ Demo/Makefile \ doc/Makefile \ idl/Makefile \ diff --git a/doc/Doxyfile b/doc/Doxyfile index 189f40e98..0dca9891c 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -23,8 +23,8 @@ #--------------------------------------------------------------------------- # PROJECT_NAME = YACS -PROJECT_NUMBER = 0.0.1 -OUTPUT_DIRECTORY = /home/prascle/SALOME2/YACS/BR_V0_0_1_PR/doc/ +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO @@ -44,7 +44,7 @@ ABBREVIATE_BRIEF = "The $name class" \ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/prascle/SALOME2/YACS/BR_V0_0_1_PR +STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO @@ -101,15 +101,26 @@ WARN_LOGFILE = # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = \ - /home/prascle/SALOME2/YACS/BR_V0_0_1_PR/YACS_SRC/src/bases \ - /home/prascle/SALOME2/YACS/BR_V0_0_1_PR/YACS_SRC/src/data \ - /home/prascle/SALOME2/YACS/BR_V0_0_1_PR/YACS_SRC/src/engine \ - /home/prascle/SALOME2/YACS/BR_V0_0_1_PR/YACS_SRC/src/runtime + ../doc/ref \ + ../idl \ + ../src/bases \ + ../src/engine \ + ../src/runtime \ + ../src/yacsloader \ + ../src/yacsorb \ + ../src/hmi \ + ../src/salomewrap \ + ../src/genericgui \ + ../src/salomegui \ + ../src/salomewrap \ + ../src/pyqt + FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ + *.py \ *.d \ *.java \ *.ii \ @@ -145,13 +156,13 @@ FILE_PATTERNS = *.c \ *.M \ *.MM RECURSIVE = YES -EXCLUDE = +EXCLUDE = ../src/yacsloader/tools EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = */Test/* EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO -IMAGE_PATH = +IMAGE_PATH = ../doc INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO @@ -159,7 +170,7 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES -INLINE_SOURCES = NO +INLINE_SOURCES = YES STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES @@ -167,17 +178,17 @@ VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 2 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES -HTML_OUTPUT = html +HTML_OUTPUT = htmldev HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = +HTML_HEADER = ../doc/sources/header.html +HTML_FOOTER = ../doc/sources/footer.html HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO @@ -264,13 +275,13 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO diff --git a/doc/Makefile.am b/doc/Makefile.am index ca3523a00..2487b5273 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -39,7 +39,7 @@ DOXFILES= ref/bases.dox ref/engine.dox ref/hmi.dox ref/python.dox ref/runtime.do EXTRA_DIST= _static exemples $(DOXFILES) yacsdocdir=$(docdir)/gui/YACS -yacsdevdocdir=$(docdir)/gui/YACS/dev +yacsdevdocdir=$(docdir)/tui/YACS SPHINXOPTS = SOURCEDIR = $(srcdir) @@ -116,7 +116,7 @@ optimizer.rst \ yacsgen.rst -EXTRA_DIST+= $(RSTFILES) images +EXTRA_DIST+= $(RSTFILES) images EXTRA_DIST+= \ ref/classDiagram.png \ diff --git a/doc/calculator.rst b/doc/calculator.rst index 3126f3fad..bebb02a4e 100644 --- a/doc/calculator.rst +++ b/doc/calculator.rst @@ -2,7 +2,7 @@ .. _calculator: MEDCoupling Calculator Component -========================= +=================================== This example is the following of the HELLO component. It's purpose is to show how to quickly create a new SALOME module, to introduce the use of MEDCoupling objects within SALOME/Corba context, to demonstrate the mechanism of exceptions, and to introduce the use of SALOME supervisor. The MED libraries diff --git a/doc/conf.py.in b/doc/conf.py.in index 362c3d7e1..b5a525db2 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -41,7 +41,7 @@ master_doc = 'index' # General information about the project. project = 'yacs' -copyright = '2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE, C. Caremoli, N. Crouzet, P. Rascle, A. Ribes, E. Fayolle, M. Tajchman' +copyright = '2007-2012 CEA/DEN, EDF R&D.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/doc/principes.rst b/doc/principes.rst index 72e2cfafa..4a1b70d9e 100644 --- a/doc/principes.rst +++ b/doc/principes.rst @@ -291,7 +291,7 @@ Data nodes A Data node is used to define data (DataIn node) or to collect results (DataOut node) of a calculation scheme. DataIn node -++++++++++++++++++ +................... A DataIn node has output data ports only that are used to define input data for the calculation scheme. These data have a name (the port name), a type (the port type) and an initial value. To create this type of node: @@ -301,7 +301,7 @@ To create this type of node: - from python interface, see :ref:`py_datain` DataOut node -++++++++++++++++++ +................... A DataOut node only has input data ports that are used to store output results from the calculation scheme. These results have a name (the port name) and a type (the port type). If the result is a file, a name can be given to the file into which the result file will be copied. All values of node results can be saved in a file at the end of the calculation. @@ -317,7 +317,7 @@ Study nodes A Study node is used to relate the elements of a SALOME study to the data and results of a calculation scheme. StudyIn node -++++++++++++++++++ +................... A StudyIn node has output data ports only. It is used to define data in the calculation scheme originating from a SALOME study. The associated study is given by its SALOME StudyID. A port corresponds to data stored in the associated study. The data has a name (the port name), a type (the port type), and a reference that gives the entry into the study. This reference is either a SALOME Entry (for example 0:1:1:2) or a path in the SALOME study tree (for example, /Geometry/box_1). @@ -329,7 +329,7 @@ To create this type of node: - from python interface, see :ref:`py_studyin` StudyOut node -++++++++++++++++++ +................... A StudyOut node only has input data ports. It is used to store results in a SALOME study. The associated study is given by its SALOME StudyID. A port corresponds to a result to be stored in an associated study. The result has a name (the port name), a type (the port type), and a reference that gives the entry into the study. This reference is either a SALOME Entry (for example 0:1:1:2) or a path in the SALOME study tree (for example, /Geometry/box_1). @@ -408,7 +408,7 @@ of the input port. There are three forms of compatibility: - type conversion (for example int -> double) Compatibility by conversion -+++++++++++++++++++++++++++++++ +...................................... Compatibility by conversion is applicable to basic types and to their derivatives (sequence, structure). The following conversions are accepted: @@ -424,7 +424,7 @@ sequence of doubles. YACS controls the conversion. This is also applicable to of structure, sequence of structure structures and types, etc. Compatibility by specialization -+++++++++++++++++++++++++++++++ +...................................... The compatibility rule is expressed differently for data (or dataflow) links and datastream links. For data (or dataflow) links, the type of output data port must be derived from (or identical to) the type of input @@ -613,6 +613,8 @@ nb_component_nodes int ?? parallelLib string ?? =================== ============= ============================================= +.. _catalogResources: + The resources catalog '''''''''''''''''''''''''''''''''''''''''' The list of resources (machines and SALOME installations) known to SALOME is given in the resources catalog, the CatalogResources.xml file @@ -853,13 +855,6 @@ the trace in an another file by setting the DSC_TRACE environment variable to 1 In this case the trace is written in a file with name : $SALOME_TMP_DIR/.tce. -Execution of concurrent branches -------------------------------------- -YACS can execute calculation nodes of a scheme simultaneously. -However, simultaneous execution of a large number of nodes can saturate the system. -The maximum number of simultaneous executions can be controlled by fixing the maximum number of threads used with the -YACS_MAX_THREADS environment variable. By default, this value is equal to 50. - Schema shutdown ----------------- When YACS executes a schema, it starts new containers or uses existing containers. When the execution is finished, YACS can shutdown (or stop) diff --git a/doc/resource.rst b/doc/resource.rst new file mode 100644 index 000000000..8a40e38cc --- /dev/null +++ b/doc/resource.rst @@ -0,0 +1,35 @@ +.. _resource: + +******************************************************* +Concurrent branches and multiple machine execution +******************************************************* + +.. _concurrent: + +Execution of concurrent branches +=================================== +YACS can execute calculation nodes of a scheme simultaneously. +However, simultaneous execution of a large number of nodes can saturate the system. +The maximum number of simultaneous executions can be controlled by fixing the maximum number of threads used with the +YACS_MAX_THREADS environment variable. By default, this value is equal to 50. + +Each of these threads needs some memory (stack) for its execution. If too much stack is allocated for each thread, +the system can run out of memory. If too little stack is allocated, you can experience some random crashes as the +thread writes to memory outside its allocated stack. The stack size for YACS threads can be controlled with the +YACS_THREADS_STACK_SIZE environment variable. It defines the size of the stack for each thread in bytes. The +default value is 1048576 (1MB). + + +.. _multi: + +Execution on multiple machines +=================================== +YACS can execute the nodes of a scheme on several machines where SALOME is +already installed. +Each machine is a resource which has to be declared in the resources catalog +(see :ref:`catalogResources`). + +Every node is executed by a container. +Containers use a set of constraints and rules for choosing the resource where +the node will be executed (see :ref:`containers`). + diff --git a/doc/using.rst b/doc/using.rst index 502b208ba..ebcbeda32 100644 --- a/doc/using.rst +++ b/doc/using.rst @@ -58,4 +58,5 @@ generates the necessary SALOME embedment starting from a brief description of th python batch optimizer + resource diff --git a/src/bases/ThreadPT.cxx b/src/bases/ThreadPT.cxx index 7e6133cc4..83a73c54e 100644 --- a/src/bases/ThreadPT.cxx +++ b/src/bases/ThreadPT.cxx @@ -28,11 +28,19 @@ using namespace YACS::BASES; -ThreadPT::ThreadPT(ThreadJob funcPtr, void *stack) +ThreadPT::ThreadPT(ThreadJob funcPtr, void *stack, size_t stackSize) { int err; void **stackT=(void **) stack; - err=pthread_create(&_threadId,0,funcPtr,stackT); + pthread_attr_t attr; + pthread_attr_init(&attr); + if (stackSize > 0) + { + err = pthread_attr_setstacksize(&attr, stackSize); + if (err != 0) throw Exception("Error when setting thread stack size"); + } + err = pthread_create(&_threadId, &attr, funcPtr, stackT); + pthread_attr_destroy(&attr); if(err!=0)throw Exception("Error in thread creation"); } diff --git a/src/bases/ThreadPT.hxx b/src/bases/ThreadPT.hxx index 972526513..c2d464aef 100644 --- a/src/bases/ThreadPT.hxx +++ b/src/bases/ThreadPT.hxx @@ -33,7 +33,7 @@ namespace YACS public: typedef void *(*ThreadJob)(void*); public: - ThreadPT(ThreadJob funcPtr, void *stack); + ThreadPT(ThreadJob funcPtr, void *stack, size_t stackSize = 0); bool operator==(const ThreadPT& other); void join(); static void detach(); diff --git a/src/engine/Executor.cxx b/src/engine/Executor.cxx index 615beff1f..3f1e07d4a 100644 --- a/src/engine/Executor.cxx +++ b/src/engine/Executor.cxx @@ -70,6 +70,7 @@ using YACS::BASES::Semaphore; #include "YacsTrace.hxx" int Executor::_maxThreads(50); +size_t Executor::_threadStackSize(1048576); // Default thread stack size is 1MB Executor::Executor():_nbOfConcurrentThreads(0), _semForMaxThreads(_maxThreads) { @@ -1035,7 +1036,7 @@ void Executor::launchTask(Task *task) task->begin(); //change state to ACTIVATED _mutexForSchedulerUpdate.unlock(); } // --- End of critical section - Thread(functionForTaskExecution,args); + Thread(functionForTaskExecution, args, _threadStackSize); } //! wait until a running task ends diff --git a/src/engine/Executor.hxx b/src/engine/Executor.hxx index 83e63cc40..60410a58b 100644 --- a/src/engine/Executor.hxx +++ b/src/engine/Executor.hxx @@ -113,6 +113,7 @@ namespace YACS void unsetStopOnError(); void waitPause(); static int _maxThreads; + static size_t _threadStackSize; protected: bool checkBreakPoints(); void waitResume(); diff --git a/src/engine/Runtime.cxx b/src/engine/Runtime.cxx index 61a354fdd..1e27ac9c7 100644 --- a/src/engine/Runtime.cxx +++ b/src/engine/Runtime.cxx @@ -123,11 +123,21 @@ Runtime::Runtime() // Get max threads number char *maxThreadStr = getenv("YACS_MAX_THREADS"); - if (!maxThreadStr) return; - int maxThreads = atoi(maxThreadStr); - DEBTRACE("maxThreads = " << maxThreads); - if (maxThreads <1) return; - Executor::_maxThreads = maxThreads; + if (maxThreadStr != NULL) + { + int maxThreads = atoi(maxThreadStr); + DEBTRACE("maxThreads = " << maxThreads); + if (maxThreads > 0) Executor::_maxThreads = maxThreads; + } + + // Get thread stack size + char *threadStackSizeStr = getenv("YACS_THREADS_STACK_SIZE"); + if (threadStackSizeStr != NULL) + { + size_t threadStackSize = strtoul(threadStackSizeStr, NULL, 0); + DEBTRACE("threadStackSize = " << threadStackSize); + if (threadStackSize > 0) Executor::_threadStackSize = threadStackSize; + } } void Runtime::removeRuntime() diff --git a/src/engine/VisitorSaveState.cxx b/src/engine/VisitorSaveState.cxx index b4de6249a..7abdd7da8 100644 --- a/src/engine/VisitorSaveState.cxx +++ b/src/engine/VisitorSaveState.cxx @@ -119,6 +119,26 @@ void VisitorSaveState::visitElementaryNode(ElementaryNode *node) } _out << " " << endl; } + + list setOfOutputPort = node->getSetOfOutputPort(); + list::iterator oiter; + for(oiter = setOfOutputPort.begin(); oiter != setOfOutputPort.end(); oiter++) + { + _out << " " << endl; + _out << " " << (*oiter)->getName() << "" << endl; + try + { + _out << " "; + _out << (*oiter)->dump(); + } + catch (YACS::Exception &e) + { + DEBTRACE("caught YACS:Exception: " << e.what()); + _out << "" << endl; + } + _out << " " << endl; + } + _out << " " << endl; } diff --git a/src/runtime/Makefile.am b/src/runtime/Makefile.am index ef9450e27..62ab7db6f 100644 --- a/src/runtime/Makefile.am +++ b/src/runtime/Makefile.am @@ -127,6 +127,7 @@ AM_CXXFLAGS = \ -I$(srcdir)/../bases \ -I$(srcdir)/../engine \ -I../../idl \ + -I../.. \ $(LIBXML_INCLUDES) include $(top_srcdir)/adm/unix/make_end.am diff --git a/src/runtime/RuntimeSALOME.cxx b/src/runtime/RuntimeSALOME.cxx index 4cc1b231f..cacfd292e 100644 --- a/src/runtime/RuntimeSALOME.cxx +++ b/src/runtime/RuntimeSALOME.cxx @@ -28,6 +28,7 @@ #endif #include "yacsconfig.h" +#include "YACS_version.h" #include "RuntimeSALOME.hxx" #include "SALOMEDispatcher.hxx" #include "Proc.hxx" @@ -401,6 +402,15 @@ void RuntimeSALOME::fini() } } +std::string RuntimeSALOME::getVersion() const +{ +#if YACS_DEVELOPMENT + return CORBA::string_dup(YACS_VERSION_STR"dev"); +#else + return CORBA::string_dup(YACS_VERSION_STR); +#endif +} + Proc* RuntimeSALOME::createProc(const std::string& name) { return new SalomeProc(name); diff --git a/src/runtime/RuntimeSALOME.hxx b/src/runtime/RuntimeSALOME.hxx index 472d429ab..04c0c31e7 100644 --- a/src/runtime/RuntimeSALOME.hxx +++ b/src/runtime/RuntimeSALOME.hxx @@ -89,6 +89,8 @@ namespace YACS static void setRuntime(long flags = UsePython+UseCorba+UseXml+UseCpp+UseSalome); // singleton creation friend RuntimeSALOME* getSALOMERuntime(); + + virtual std::string getVersion() const; virtual void init(long flags); virtual void fini(); diff --git a/src/runtime/SalomeProc.cxx b/src/runtime/SalomeProc.cxx index 17af4d360..6fe930371 100644 --- a/src/runtime/SalomeProc.cxx +++ b/src/runtime/SalomeProc.cxx @@ -33,7 +33,7 @@ SalomeProc::SalomeProc(const std::string& name):Proc(name) { // create default container with some default properties Container* cont=createContainer("DefaultContainer"); - cont->setProperty("name",Kernel_Utils::GetHostname()); + cont->setProperty("name", "localhost"); cont->setProperty("container_name","FactoryServer"); cont->decrRef(); } diff --git a/src/salomegui/Yacsgui.cxx b/src/salomegui/Yacsgui.cxx index f9ee254e7..3d460cb0f 100644 --- a/src/salomegui/Yacsgui.cxx +++ b/src/salomegui/Yacsgui.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/salomegui/resources/SalomeApp.xml.in b/src/salomegui/resources/SalomeApp.xml.in index f0201f272..848f31132 100644 --- a/src/salomegui/resources/SalomeApp.xml.in +++ b/src/salomegui/resources/SalomeApp.xml.in @@ -33,6 +33,7 @@
+
diff --git a/src/yacsloader/LoadState.cxx b/src/yacsloader/LoadState.cxx index bb57af20f..d3f340977 100644 --- a/src/yacsloader/LoadState.cxx +++ b/src/yacsloader/LoadState.cxx @@ -181,6 +181,52 @@ void graphParser::onEnd (const XML_Char* name) // ---------------------------------------------------------------------------- +class outputParser: public stateParser +{ +public: + virtual void init(const xmlChar** p, xmlParserBase* father=0) + { + //DEBTRACE("outputParser::init()"); + _state = XMLNOCONTEXT; + _father = father; + YASSERT( dynamic_cast (father)); + _stackState.push(_state); + if (p) getAttributes(p); + } + virtual void onStart (const XML_Char* elem, const xmlChar** p) + { + //DEBTRACE("outputParser::onStart" << elem); + string element(elem); + stateParser *parser = 0; + if (element == "name") parser = new attrParser(); + else if (element == "value") parser = new valueParser(); + else + { + _what = "expected name or value, got <" + element + ">"; + _state = XMLFATALERROR; + stopParse(_what); + } + if (parser) + { + _stackParser.push(parser); + XML_SetUserData(_xmlParser, parser); + parser->init(p, this); + } + } + virtual void onEnd (const XML_Char* name) + { + //DEBTRACE("outputParser::onEnd" << elem); + //DEBTRACE("portName: " << _mapAttrib["name"] << "value: " << _data ); + stateParser::onEnd(name); + } + virtual void addData(std::string /*value*/) + { + //DEBTRACE("outputParser::addData" << elem); + } +}; + +// ---------------------------------------------------------------------------- + void nodeParser::init(const xmlChar** p, xmlParserBase* father) { DEBTRACE("nodeParser::init()"); @@ -202,7 +248,7 @@ void nodeParser::onStart (const XML_Char* elem, const xmlChar** p) else if (element == "nsteps") parser = new attrParser(); else if (element == "nbdone") parser = new attrParser(); else if (element == "condition") parser = new attrParser(); - else if (element == "inputPort") parser = new portParser(); + else if (element == "outputPort") parser = new outputParser(); else { _what = "expected name, state or inputPort, got <" + element + ">"; diff --git a/src/yacsorb/YACS.py b/src/yacsorb/YACS.py index 36ca3a290..1261558c2 100644 --- a/src/yacsorb/YACS.py +++ b/src/yacsorb/YACS.py @@ -259,6 +259,18 @@ class YACS(YACS_ORB__POA.YACS_Gen, except : pass + """ + Get version information. + """ + def getVersion( self ): + try: + rt = SALOMERuntime.getSALOMERuntime() + version = rt.getVersion() + except: + version = "" + pass + return version + def LoadProc(self,xmlFile): """ load an XML graph in a YACS::ENGINE::proc, create a CORBA servant -- 2.30.2