configure.in.base \
rfind
+salomeinclude_HEADERS = YACS_version.h
--- /dev/null
+// 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__
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
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)
AC_OUTPUT([ \
Makefile \
+ YACS_version.h \
Demo/Makefile \
doc/Makefile \
idl/Makefile \
#---------------------------------------------------------------------------
#
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
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
# 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 \
*.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
# 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
#---------------------------------------------------------------------------
# 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
# 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
EXTRA_DIST= _static exemples $(DOXFILES)
yacsdocdir=$(docdir)/gui/YACS
-yacsdevdocdir=$(docdir)/gui/YACS/dev
+yacsdevdocdir=$(docdir)/tui/YACS
SPHINXOPTS =
SOURCEDIR = $(srcdir)
yacsgen.rst
-EXTRA_DIST+= $(RSTFILES) images
+EXTRA_DIST+= $(RSTFILES) images
EXTRA_DIST+= \
ref/classDiagram.png \
.. _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
# 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
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:
- 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.
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).
- 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).
- 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:
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
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
In this case the trace is written in a file with name : $SALOME_TMP_DIR/<container identification>.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)
--- /dev/null
+.. _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`).
+
python
batch
optimizer
+ resource
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");
}
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();
#include "YacsTrace.hxx"
int Executor::_maxThreads(50);
+size_t Executor::_threadStackSize(1048576); // Default thread stack size is 1MB
Executor::Executor():_nbOfConcurrentThreads(0), _semForMaxThreads(_maxThreads)
{
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
void unsetStopOnError();
void waitPause();
static int _maxThreads;
+ static size_t _threadStackSize;
protected:
bool checkBreakPoints();
void waitResume();
// 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()
}
_out << " </inputPort>" << endl;
}
+
+ list<OutputPort *> setOfOutputPort = node->getSetOfOutputPort();
+ list<OutputPort *>::iterator oiter;
+ for(oiter = setOfOutputPort.begin(); oiter != setOfOutputPort.end(); oiter++)
+ {
+ _out << " <outputPort>" << endl;
+ _out << " <name>" << (*oiter)->getName() << "</name>" << endl;
+ try
+ {
+ _out << " ";
+ _out << (*oiter)->dump();
+ }
+ catch (YACS::Exception &e)
+ {
+ DEBTRACE("caught YACS:Exception: " << e.what());
+ _out << "<value><error><![CDATA[" << e.what() << "]]></error></value>" << endl;
+ }
+ _out << " </outputPort>" << endl;
+ }
+
_out << " </node>" << endl;
}
-I$(srcdir)/../bases \
-I$(srcdir)/../engine \
-I../../idl \
+ -I../.. \
$(LIBXML_INCLUDES)
include $(top_srcdir)/adm/unix/make_end.am
#endif
#include "yacsconfig.h"
+#include "YACS_version.h"
#include "RuntimeSALOME.hxx"
#include "SALOMEDispatcher.hxx"
#include "Proc.hxx"
}
}
+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);
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();
{
// 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();
}
#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
#include <SalomeApp_Application.h>
-#include <SalomeApp_Engine_i.hxx>
+#include <SalomeApp_Engine_i.h>
#include <QxScene_ViewManager.h>
#include <QxScene_ViewModel.h>
#include <QxScene_ViewWindow.h>
<section name="yacs_help">
<parameter name="sub_menu" value="%1 module"/>
<parameter name="User's Guide" value="%YACS_ROOT_DIR%/share/doc/salome/gui/YACS/index.html"/>
+ <parameter name="Developer's Guide" value="%YACS_ROOT_DIR%/share/doc/salome/tui/YACS/index.html"/>
</section>
<section name="YACS" >
<!-- Module preferences -->
// ----------------------------------------------------------------------------
+class outputParser: public stateParser
+{
+public:
+ virtual void init(const xmlChar** p, xmlParserBase* father=0)
+ {
+ //DEBTRACE("outputParser::init()");
+ _state = XMLNOCONTEXT;
+ _father = father;
+ YASSERT( dynamic_cast<nodeParser*> (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()");
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 + ">";
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