ACLOCAL_AMFLAGS = -I salome_adm/unix/config_files
-SUBDIRS = salome_adm $(IDLDIR) src doc bin resources
+if WITHONLYLAUNCHER
+ SUBDIRS = src resources
+else
+ SUBDIRS = salome_adm $(IDLDIR) src doc bin resources
+endif
DIST_SUBDIRS= salome_adm idl src doc bin resources
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
- 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 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.
+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
+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
+See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
=================================================================
General information, for developpers and users
#
#clean appli
#
-rm -rf bin lib share doc env.d envd getAppliPath.py searchFreePort.sh runAppli runConsole runSession runRemote.sh runTests SalomeApp.xml *.pyc *~ .bashrc
+rm -rf bin lib share doc idl env.d envd getAppliPath.py searchFreePort.sh runAppli runConsole runSession runRemote.sh runTests SalomeApp.xml *.pyc *~ .bashrc
<!DOCTYPE ResourcesCatalog>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<resources>
<machine hostname="localhost" />
</resources>
+Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+
+Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+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
+
=======================================
Set of scripts for a SALOME application
=======================================
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<document>
<section name="desktop" >
<parameter name="state" value="max"/>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<application>
<prerequisites path="/data/tmplgls/secher/SALOME_V4.1.1_MD08/env_products.sh"/>
<modules>
help_str = "Launch session with gdb"
o_gdb = optparse.Option("--gdb-session",
action="store_true",
- dest="gdb_session",
- default=False,
- help=help_str)
-
+ dest="gdb_session", default=False,
+ help=help_str)
+
# All options
opt_list = [o_t,o_g, # GUI/Terminal
o_d,o_o, # Desktop
self.CMD+=['-test'] + self.args['test']
elif self.args.has_key('play'):
self.CMD+=['-play'] + self.args['play']
-
- if self.args["gdb_session"]:
+
+ if self.args["gdb_session"]:
f = open(".gdbinit4salome", "w")
f.write("set args ")
args = " ".join(self.CMD[1:])
f.close()
self.CMD = ["xterm", "-e", "gdb", "--command=.gdbinit4salome", self.CMD[0]]
pass
-
+
# ---
class LauncherServer(Server):
pass
pass
pass
-
+
if sys.platform == 'win32':
os.environ["SALOMEPATH"]=";".join(modules_root_dir_list)
else:
return
home_dir = os.path.expanduser(options.prefix)
+ #try to find python version of salome application and put it in versio
+ pys=[os.path.split(s)[1] for s in glob.glob(os.path.join(home_dir,get_lib_dir(),"python*.*"))]
+ if not pys :
+ versio=None
+ else:
+ versio=pys[0]
+
+ pys=[os.path.split(s)[1] for s in glob.glob(os.path.join(module_dir,get_lib_dir(),"python*.*"))]
+ #check if the module has a python version compatible with application version
+ if not pys :
+ pyversio=versio or py_version
+ elif versio is None:
+ pyversio=pys[0]
+ elif versio in pys:
+ pyversio=versio
+ else:
+ #incompatible python versions
+ print "incompatible python versions : application has version %s and module %s has not" % (versio,module_dir)
+ return
module_bin_dir=os.path.join(module_dir,'bin','salome')
+ module_idl_dir=os.path.join(module_dir,'idl','salome')
module_lib_dir=os.path.join(module_dir,get_lib_dir(),'salome')
- module_lib_py_dir=os.path.join(module_dir,get_lib_dir(),py_version,'site-packages','salome')
- module_lib_py_shared_dir=os.path.join(module_dir,get_lib_dir(),py_version,
+ module_lib_py_dir=os.path.join(module_dir,get_lib_dir(),pyversio,'site-packages','salome')
+ module_lib_py_shared_dir=os.path.join(module_dir,get_lib_dir(),pyversio,
'site-packages','salome','shared_modules')
module_share_dir=os.path.join(module_dir,'share','salome','resources')
module_doc_gui_dir=os.path.join(module_dir,'doc','salome','gui')
module_sharedoc_tui_dir=os.path.join(module_dir,'share','doc','salome','tui')
bin_dir=os.path.join(home_dir,'bin','salome')
+ idl_dir=os.path.join(home_dir,'idl','salome')
lib_dir=os.path.join(home_dir,'lib','salome')
- lib_py_dir=os.path.join(home_dir,'lib',py_version,'site-packages','salome')
- lib_py_shared_dir=os.path.join(home_dir,'lib',py_version,
+ lib_py_dir=os.path.join(home_dir,'lib',pyversio,'site-packages','salome')
+ lib_py_shared_dir=os.path.join(home_dir,'lib',pyversio,
'site-packages','salome','shared_modules')
share_dir=os.path.join(home_dir,'share','salome','resources')
doc_gui_dir=os.path.join(home_dir,'doc','salome','gui')
if options.clear:
rmtree(bin_dir)
+ rmtree(idl_dir)
rmtree(lib_dir)
rmtree(lib_py_dir)
rmtree(share_dir)
print module_bin_dir, " doesn't exist"
pass
+ #directory idl/salome : create it and link content
+ if os.path.exists(module_idl_dir):
+ mkdir(idl_dir)
+ for fn in os.listdir(module_idl_dir):
+ symlink(os.path.join(module_idl_dir, fn), os.path.join(idl_dir, fn))
+ else:
+ print module_idl_dir, " doesn't exist"
+
#directory lib/salome : create it and link content
if os.path.exists(module_lib_dir):
mkdir(lib_dir)
print module_lib_dir, " doesn't exist"
pass
- #directory lib/py_version/site-packages/salome : create it and link content
+ #directory lib/pyversio/site-packages/salome : create it and link content
if not os.path.exists(module_lib_py_dir):
print "Python directory %s does not exist" % module_lib_py_dir
else:
sleep 1
echo -n "#"
done
-./runSession waitNS.py
\ No newline at end of file
+./runSession waitNS.py
esac],[corba_gen=true])
AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
+# ---- option to build only launcher, resources manager and batch classes
+AC_ARG_WITH(onlylauncher,
+ --with-onlylauncher,
+ WITHONLYLAUNCHER="yes",WITHONLYLAUNCHER="no")
+AM_CONDITIONAL(WITHONLYLAUNCHER, test x$WITHONLYLAUNCHER = xyes)
+
# ----------------------------------------------------------------------------
echo
AM_PATH_PYTHON(2.3)
CHECK_SWIG
+echo
+echo ---------------------------------------------
+echo Testing libxml2
+echo ---------------------------------------------
+echo
+
+CHECK_LIBXML
+
+if test x$WITHONLYLAUNCHER = xno; then
echo
echo ---------------------------------------------
echo testing HDF5
CHECK_BOOST
-echo
-echo ---------------------------------------------
-echo Testing libxml2
-echo ---------------------------------------------
-echo
-
-CHECK_LIBXML
-
fi
# --- end test corba
# ----------------------------------------------------------------------------
+fi
+# --- end test ONLYLAUNCHER
+# ----------------------------------------------------------------------------
+
echo
echo ============================================================
echo testing parallel products
# --------------------------------------
-if test x$corba_gen = xtrue; then
- basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok"
+if test x$WITHONLYLAUNCHER = xno; then
+ if test x$corba_gen = xtrue; then
+ basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
+ else
+ basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
+ fi
else
- basic_mandatory_products="cc_ok threads_ok hdf5_ok"
+ basic_mandatory_products="cc_ok threads_ok libxml_ok"
fi
echo --- General mandatory products - Light configuration:
check_fatal_error $basic_mandatory_products
echo
-corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok libxml_ok"
-if test x$corba_gen = xtrue; then
- echo --- CORBA mandatory products - default configuration:
- summary $corba_mandatory_products
- check_fatal_error $corba_mandatory_products
-else
- echo --- CORBA products not required - option --disable-corba-gen
- if test x"$WITH_BATCH" = xyes; then
- echo --- BATCH mode mandatory products - default configuration:
- summary "python_ok"
- check_fatal_error "python_ok"
- else
+if test x$WITHONLYLAUNCHER = xno; then
+ corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
+ if test x$corba_gen = xtrue; then
+ echo --- CORBA mandatory products - default configuration:
+ summary $corba_mandatory_products
+ check_fatal_error $corba_mandatory_products
+ else
+ echo --- CORBA products not required - option --disable-corba-gen
+ if test x"$WITH_BATCH" = xyes; then
+ echo --- BATCH mode mandatory products - default configuration:
+ summary "python_ok"
+ check_fatal_error "python_ok"
+ else
echo --- Python not required - option --enable-batch=no
+ fi
fi
fi
echo
summary $htmldoc_products
echo
+if test x$WITHONLYLAUNCHER = xno; then
echo
echo "Default ORB : $DEFAULT_ORB"
echo
+fi
dnl generals files which could be included in every makefile
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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
-#
# Doxyfile 1.4.6
#---------------------------------------------------------------------------
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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
-#
# Doxyfile 1.3-rc1
#---------------------------------------------------------------------------
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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
-#
# Doxyfile 1.4.6
#---------------------------------------------------------------------------
<?xml version="1.0"?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
- File : DSC_Engines.xml
- Author : Andre RIBES, EDF
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : DSC_Engines.xml
+// Author : Andre RIBES, EDF
-->
-
<GridCCM_Interface_description
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='$PACOPATH/IDL2Tool/interface.xsd'
{
//put message into one special place for all servers using Logger
oneway void putMessage (in string message);
- void ping ();
+ void ping ();
void shutdown();
};
};
<?xml version="1.0"?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
- File : SALOME_Component.xml
- Author : Andre RIBES, EDF
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : SALOME_Component.xml
+// Author : Andre RIBES, EDF
-->
<GridCCM_Interface_description
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
*/
interface SalomeLauncher
{
+ long submitJob( in string xmlExecuteFile,
+ in string clusterName ) raises (SALOME::SALOME_Exception);
long submitSalomeJob( in string fileToExecute,
in FilesList filesToExport,
in FilesList filesToImport,
in BatchParameters batch_params,
in MachineParameters params ) raises (SALOME::SALOME_Exception);
- string querySalomeJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
- void deleteSalomeJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
- void getResultSalomeJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
+ string queryJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
+ void deleteJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
+ void getResultsJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
boolean testBatch(in MachineParameters params) raises (SALOME::SALOME_Exception);
<?xml version="1.0"?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
- File : SALOME_Exception.xml
- Author : Andre RIBES, EDF
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : SALOME_Exception.xml
+// Author : Andre RIBES, EDF
-->
<GridCCM_Interface_description
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
<?xml version="1.0"?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
- File : SALOME_Ports.xml
- Author : Andre RIBES, EDF
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : SALOME_Ports.xml
+// Author : Andre RIBES, EDF
-->
<GridCCM_Interface_description
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
<?xml version='1.0' encoding='us-ascii' ?>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<!-- XML data type catalog -->
<?xml version='1.0' encoding='us-ascii' ?>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<!-- XML component catalog -->
<begin-catalog>
<!DOCTYPE ResourcesCatalog>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<resources>
<machine hostname="localhost" />
</resources>
<?xml version='1.0' encoding='us-ascii' ?>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
<!-- XML component catalog -->
<begin-catalog>
# ===============================================================
#
-dist_salomeres_DATA = \
- CatalogDataType.xml \
+if WITHONLYLAUNCHER
+ dist_salomeres_DATA=\
+ CatalogResources.xml \
+ CatalogModulePersonnel.xml_skel
+else
+ dist_salomeres_DATA=\
+ CatalogResources.xml \
CatalogModulePersonnel.xml_skel \
channel.cfg \
- SALOMEDS_Resources
-
-nodist_salomeres_DATA = \
- CatalogResources.xml \
- KERNELCatalog.xml
+ KERNELCatalog.xml \
+ SALOMEDS_Resources
+endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# 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
-#
# =================================================================
# PARAM SETTINGS
#
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
dnl @author Ben Stanley
dnl @version $Id$
+dnl modified by Marc Tajchman (CEA) - 10/10/2002
dnl
+
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
[AC_CACHE_CHECK(whether the compiler has stringstream,
HAVE_SSTREAM,
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
dnl @synopsis AC_CXX_USE_STD_IOSTREAM
+dnl
dnl If the C++ library use std iostream
dnl
+dnl @author Bernard Secher (CEA) - 05/12/2003
+dnl
AC_DEFUN([AC_CXX_USE_STD_IOSTREAM],
[
// Module : SALOME
//
#include "Basics_Utils.hxx"
-
-#include "string.h"
+#include <string.h>
#ifndef WIN32
#include <unistd.h>
#include <fstream>
#include <sstream>
#include <cstdlib>
+#include <limits.h>
+
#include <sys/types.h>
#ifdef WIN32
# include <direct.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
-#include <limits.h>
#include "Batch_IOMutex.hxx"
#include "Batch_BatchManager_Local.hxx"
#include <fstream>
#include <sstream>
#include <sys/stat.h>
-#include <stdlib.h>
#include <string.h>
+#include <stdlib.h>
using namespace std;
// Second step : copy fileToExecute into
// batch tmp files directory
- command = copy_command;
- command += string(params[EXECUTABLE]);
- command += " ";
- if(_username != ""){
- command += _username;
- command += "@";
- }
- command += _hostname;
- command += ":";
- command += string(params[TMPDIR]);
- cerr << command.c_str() << endl;
- status = system(command.c_str());
- if(status) {
- std::ostringstream oss;
- oss << status;
- std::string ex_mess("Error of connection on remote host ! status = ");
- ex_mess += oss.str();
- throw EmulationException(ex_mess.c_str());
+ string executeFile = params[EXECUTABLE];
+ if( executeFile.size() > 0 ){
+ command = copy_command;
+ command += string(params[EXECUTABLE]);
+ command += " ";
+ if(_username != ""){
+ command += _username;
+ command += "@";
+ }
+ command += _hostname;
+ command += ":";
+ command += string(params[TMPDIR]);
+ cerr << command.c_str() << endl;
+ status = system(command.c_str());
+ if(status) {
+ std::ostringstream oss;
+ oss << status;
+ std::string ex_mess("Error of connection on remote host ! status = ");
+ ex_mess += oss.str();
+ throw EmulationException(ex_mess.c_str());
+ }
}
// Third step : copy filesToExportList into
return new MpiImpl_OPENMPI();
else if(mpiImpl == "slurm")
return new MpiImpl_SLURM();
+ else if(mpiImpl == "prun")
+ return new MpiImpl_PRUN();
+ else if(mpiImpl == "nompi")
+ throw EmulationException("you must specified an mpi implementation for batch manager");
else{
ostringstream oss;
oss << mpiImpl << " : not yet implemented";
{
public:
// Constructeur et destructeur
- BatchManager_eClient(const Batch::FactBatchManager * parent, const char* host="localhost", const char* protocol="ssh", const char* mpiImpl="indif");
+ BatchManager_eClient(const Batch::FactBatchManager * parent, const char* host="localhost", const char* protocol="ssh", const char* mpiImpl="mpich1");
virtual ~BatchManager_eClient();
void importOutputFiles( const Job & job, const std::string directory ) throw(EmulationException);
#include <fstream>
#include <sstream>
#include <sys/stat.h>
+#include <string.h>
#include <stdlib.h>
+
#include "Batch_BatchManager_eLSF.hxx"
#ifdef WIN32
# include <time.h>
Parametre params = job.getParametre();
const std::string dirForTmpFiles = params[TMPDIR];
const string fileToExecute = params[EXECUTABLE];
- string::size_type p1 = fileToExecute.find_last_of("/");
- string::size_type p2 = fileToExecute.find_last_of(".");
- std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+ std::string fileNameToExecute;
+ if( fileToExecute.size() > 0 ){
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+ }
+ else
+ fileNameToExecute = "command";
// export input files on cluster
exportInputFiles(job);
#ifndef WIN32 //TODO: need for porting on Windows
int status;
Parametre params = job.getParametre();
+ Environnement env = job.getEnvironnement();
const int nbproc = params[NBPROC];
const long edt = params[MAXWALLTIME];
const long mem = params[MAXRAMSIZE];
const string workDir = params[WORKDIR];
const std::string dirForTmpFiles = params[TMPDIR];
const string fileToExecute = params[EXECUTABLE];
- string::size_type p1 = fileToExecute.find_last_of("/");
- string::size_type p2 = fileToExecute.find_last_of(".");
- std::string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
- std::string fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename((char*)(fileToExecute.c_str())));
-
- int idx = dirForTmpFiles.find("Batch/");
- std::string filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ const string home = params[HOMEDIR];
+ const std::string queue = params[QUEUE];
+ std::string rootNameToExecute;
+ std::string fileNameToExecute;
+ std::string filelogtemp;
+ if( fileToExecute.size() > 0 ){
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+ char* basec=strdup(fileToExecute.c_str());
+ fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename(basec));
+ free(basec);
+
+ int idx = dirForTmpFiles.find("Batch/");
+ filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ }
+ else{
+ rootNameToExecute = "command";
+ }
std::string TmpFileName = BuildTemporaryFileName();
ofstream tempOutputFile;
tempOutputFile.open(TmpFileName.c_str(), ofstream::out );
tempOutputFile << "#! /bin/sh -f" << endl ;
+ if (queue != "")
+ tempOutputFile << "#BSUB -q " << queue << endl;
if( edt > 0 )
tempOutputFile << "#BSUB -W " << getWallTime(edt) << endl ;
if( mem > 0 )
tempOutputFile << "#BSUB -M " << mem*1024 << endl ;
tempOutputFile << "#BSUB -n " << nbproc << endl ;
- tempOutputFile << "#BSUB -o runSalome.output.log." << filelogtemp << endl ;
- tempOutputFile << "#BSUB -e runSalome.error.log." << filelogtemp << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << "#BSUB -o " << home << "/" << dirForTmpFiles << "/output.log." << filelogtemp << endl ;
+ tempOutputFile << "#BSUB -e " << home << "/" << dirForTmpFiles << "/error.log." << filelogtemp << endl ;
+ }
+ else{
+ tempOutputFile << "#BSUB -o " << dirForTmpFiles << "/" << env["LOGFILE"] << ".output.log" << endl ;
+ tempOutputFile << "#BSUB -e " << dirForTmpFiles << "/" << env["LOGFILE"] << ".error.log" << endl ;
+ }
if( workDir.size() > 0 )
tempOutputFile << "cd " << workDir << endl ;
- tempOutputFile << _mpiImpl->boot("",nbproc);
- tempOutputFile << _mpiImpl->run("",nbproc,fileNameToExecute);
- tempOutputFile << _mpiImpl->halt();
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << _mpiImpl->boot("",nbproc);
+ tempOutputFile << _mpiImpl->run("",nbproc,fileNameToExecute);
+ tempOutputFile << _mpiImpl->halt();
+ }
+ else{
+ tempOutputFile << "source " << env["SOURCEFILE"] << endl ;
+ tempOutputFile << env["COMMAND"];
+ }
+
tempOutputFile.flush();
tempOutputFile.close();
#ifdef WIN32
{
public:
// Constructeur et destructeur
- BatchManager_eLSF(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="indif") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
+ BatchManager_eLSF(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="nompi") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
virtual ~BatchManager_eLSF();
// Recupere le nom du serveur par defaut
#include <fstream>
#include <sstream>
#include <sys/stat.h>
+#include <string.h>
#include <stdlib.h>
+
#include "Batch_BatchManager_ePBS.hxx"
#ifdef WIN32
# include <time.h>
#ifndef WIN32 //TODO: need for porting on Windows
int status;
Parametre params = job.getParametre();
+ Environnement env = job.getEnvironnement();
const long nbproc = params[NBPROC];
const long edt = params[MAXWALLTIME];
const long mem = params[MAXRAMSIZE];
const std::string dirForTmpFiles = params[TMPDIR];
const string fileToExecute = params[EXECUTABLE];
const string home = params[HOMEDIR];
- string::size_type p1 = fileToExecute.find_last_of("/");
- string::size_type p2 = fileToExecute.find_last_of(".");
- std::string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
- std::string fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename((char*)(fileToExecute.c_str())));
-
- int idx = dirForTmpFiles.find("Batch/");
- std::string filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ const std::string queue = params[QUEUE];
+ std::string rootNameToExecute;
+ std::string fileNameToExecute;
+ std::string filelogtemp;
+ if( fileToExecute.size() > 0 ){
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+ char* basec=strdup(fileToExecute.c_str());
+ fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename(basec));
+ free(basec);
+
+ int idx = dirForTmpFiles.find("Batch/");
+ filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ }
+ else{
+ rootNameToExecute = "command";
+ }
std::string TmpFileName = BuildTemporaryFileName();
ofstream tempOutputFile;
tempOutputFile.open(TmpFileName.c_str(), ofstream::out );
tempOutputFile << "#! /bin/sh -f" << endl;
+ if (queue != "")
+ tempOutputFile << "#BSUB -q " << queue << endl;
if( edt > 0 )
tempOutputFile << "#PBS -l walltime=" << edt*60 << endl ;
if( mem > 0 )
tempOutputFile << "#PBS -l mem=" << mem << "mb" << endl ;
- tempOutputFile << "#PBS -o " << home << "/" << dirForTmpFiles << "/runSalome.output.log." << filelogtemp << endl ;
- tempOutputFile << "#PBS -e " << home << "/" << dirForTmpFiles << "/runSalome.error.log." << filelogtemp << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << "#PBS -o " << home << "/" << dirForTmpFiles << "/output.log." << filelogtemp << endl ;
+ tempOutputFile << "#PBS -e " << home << "/" << dirForTmpFiles << "/error.log." << filelogtemp << endl ;
+ }
+ else{
+ tempOutputFile << "#PBS -o " << dirForTmpFiles << "/" << env["LOGFILE"] << ".output.log" << endl ;
+ tempOutputFile << "#PBS -e " << dirForTmpFiles << "/" << env["LOGFILE"] << ".error.log" << endl ;
+ }
if( workDir.size() > 0 )
tempOutputFile << "cd " << workDir << endl ;
- tempOutputFile << _mpiImpl->boot("${PBS_NODEFILE}",nbproc);
- tempOutputFile << _mpiImpl->run("${PBS_NODEFILE}",nbproc,fileNameToExecute);
- tempOutputFile << _mpiImpl->halt();
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << _mpiImpl->boot("${PBS_NODEFILE}",nbproc);
+ tempOutputFile << _mpiImpl->run("${PBS_NODEFILE}",nbproc,fileNameToExecute);
+ tempOutputFile << _mpiImpl->halt();
+ }
+ else{
+ tempOutputFile << "source " << env["SOURCEFILE"] << endl ;
+ tempOutputFile << env["COMMAND"];
+ }
+
tempOutputFile.flush();
tempOutputFile.close();
#ifdef WIN32
{
public:
// Constructeur et destructeur
- BatchManager_ePBS(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="indif") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
+ BatchManager_ePBS(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="nompi") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
virtual ~BatchManager_ePBS();
// Recupere le nom du serveur par defaut
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * BatchManager_eSGE.cxx : emulation of SGE client
+ *
+ * Auteur : Bernard SECHER - CEA DEN
+ * Mail : mailto:bernard.secher@cea.fr
+ * Date : Thu Apr 24 10:17:22 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <sys/stat.h>
+#include "Batch_BatchManager_eSGE.hxx"
+#include <stdlib.h>
+#ifdef WIN32
+# include <time.h>
+# include <io.h>
+#else
+#include <libgen.h>
+#endif
+
+using namespace std;
+
+namespace Batch {
+
+ BatchManager_eSGE::BatchManager_eSGE(const FactBatchManager * parent, const char * host, const char * protocol, const char * mpiImpl) throw(InvalidArgumentException,ConnexionFailureException) : BatchManager_eClient(parent,host,protocol,mpiImpl)
+ {
+ // Nothing to do
+ }
+
+ // Destructeur
+ BatchManager_eSGE::~BatchManager_eSGE()
+ {
+ // Nothing to do
+ }
+
+ // Methode pour le controle des jobs : soumet un job au gestionnaire
+ const JobId BatchManager_eSGE::submitJob(const Job & job)
+ {
+ int status;
+ Parametre params = job.getParametre();
+ const std::string dirForTmpFiles = params[TMPDIR];
+ const string fileToExecute = params[EXECUTABLE];
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+
+ // export input files on cluster
+ exportInputFiles(job);
+
+ // build batch script for job
+ buildBatchScript(job);
+
+ // define name of log file
+ string logFile="/tmp/logs/";
+ logFile += getenv("USER");
+ logFile += "/batchSalome_";
+ srand ( time(NULL) );
+ int ir = rand();
+ ostringstream oss;
+ oss << ir;
+ logFile += oss.str();
+ logFile += ".log";
+
+ string command;
+
+ // define command to submit batch
+ command = _protocol;
+ command += " ";
+
+ if(_username != ""){
+ command += _username;
+ command += "@";
+ }
+
+ command += _hostname;
+ command += " \"cd " ;
+ command += dirForTmpFiles ;
+ command += "; qsub " ;
+ command += fileNameToExecute ;
+ command += "_Batch.sh\" > ";
+ command += logFile;
+ cerr << command.c_str() << endl;
+ status = system(command.c_str());
+ if(status)
+ throw EmulationException("Error of connection on remote host");
+
+ // read id of submitted job in log file
+ char line[128];
+ FILE *fp = fopen(logFile.c_str(),"r");
+ fgets( line, 128, fp);
+ fclose(fp);
+
+ string strjob;
+ istringstream iss(line);
+ iss >> strjob >> strjob >> strjob;
+
+ JobId id(this, strjob);
+ return id;
+ }
+
+ // Methode pour le controle des jobs : retire un job du gestionnaire
+ void BatchManager_eSGE::deleteJob(const JobId & jobid)
+ {
+ int status;
+ int ref;
+ istringstream iss(jobid.getReference());
+ iss >> ref;
+
+ // define command to submit batch
+ string command;
+ command = _protocol;
+ command += " ";
+
+ if (_username != ""){
+ command += _username;
+ command += "@";
+ }
+
+ command += _hostname;
+ command += " \"qdel " ;
+ command += iss.str();
+ command += "\"";
+ cerr << command.c_str() << endl;
+ status = system(command.c_str());
+ if(status)
+ throw EmulationException("Error of connection on remote host");
+
+ cerr << "jobId = " << ref << "killed" << endl;
+ }
+
+ // Methode pour le controle des jobs : suspend un job en file d'attente
+ void BatchManager_eSGE::holdJob(const JobId & jobid)
+ {
+ throw EmulationException("Not yet implemented");
+ }
+
+ // Methode pour le controle des jobs : relache un job suspendu
+ void BatchManager_eSGE::releaseJob(const JobId & jobid)
+ {
+ throw EmulationException("Not yet implemented");
+ }
+
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSGE::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
+ {
+ throw EmulationException("Not yet implemented");
+ }
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSGE::alterJob(const JobId & jobid, const Parametre & param)
+ {
+ alterJob(jobid, param, Environnement());
+ }
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSGE::alterJob(const JobId & jobid, const Environnement & env)
+ {
+ alterJob(jobid, Parametre(), env);
+ }
+
+ // Methode pour le controle des jobs : renvoie l'etat du job
+ JobInfo BatchManager_eSGE::queryJob(const JobId & jobid)
+ {
+ int id;
+ istringstream iss(jobid.getReference());
+ iss >> id;
+
+ // define name of log file
+ string logFile="/tmp/logs/";
+ logFile += getenv("USER");
+ logFile += "/batchSalome_";
+
+ ostringstream oss;
+ oss << this << "_" << id;
+ logFile += oss.str();
+ logFile += ".log";
+
+ string command;
+ int status;
+
+ // define command to submit batch
+ command = _protocol;
+ command += " ";
+
+ if (_username != ""){
+ command += _username;
+ command += "@";
+ }
+
+ command += _hostname;
+ command += " \"qstat | grep " ;
+ command += iss.str();
+ command += "\" > ";
+ command += logFile;
+ cerr << command.c_str() << endl;
+ status = system(command.c_str());
+ if(status && status != 256)
+ throw EmulationException("Error of connection on remote host");
+
+ JobInfo_eSGE ji = JobInfo_eSGE(id,logFile);
+ return ji;
+ }
+
+ // Methode pour le controle des jobs : teste si un job est present en machine
+ bool BatchManager_eSGE::isRunning(const JobId & jobid)
+ {
+ throw EmulationException("Not yet implemented");
+ }
+
+ void BatchManager_eSGE::buildBatchScript(const Job & job) throw(EmulationException)
+ {
+#ifndef WIN32
+ //TODO porting on Win32 platform
+ int status;
+ Parametre params = job.getParametre();
+ Environnement env = job.getEnvironnement();
+ const long nbproc = params[NBPROC];
+ const long edt = params[MAXWALLTIME];
+ const long mem = params[MAXRAMSIZE];
+ const string workDir = params[WORKDIR];
+ const std::string dirForTmpFiles = params[TMPDIR];
+ const string fileToExecute = params[EXECUTABLE];
+ const string home = params[HOMEDIR];
+ const std::string queue = params[QUEUE];
+ std::string rootNameToExecute;
+ std::string fileNameToExecute;
+ std::string filelogtemp;
+ if( fileToExecute.size() > 0 ){
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+ fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename((char *) fileToExecute.c_str()));
+
+ int idx = dirForTmpFiles.find("Batch/");
+ filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ }
+ else{
+ rootNameToExecute = "command";
+ }
+
+ std::string TmpFileName = BuildTemporaryFileName();
+ ofstream tempOutputFile;
+ tempOutputFile.open(TmpFileName.c_str(), ofstream::out );
+
+ tempOutputFile << "#! /bin/sh -f" << endl;
+ if (queue != "")
+ tempOutputFile << "#$ -q " << queue << endl;
+ tempOutputFile << "#$ -pe mpich " << nbproc << endl;
+ if( edt > 0 )
+ tempOutputFile << "#$ -l h_rt=" << getWallTime(edt) << endl ;
+ if( mem > 0 )
+ tempOutputFile << "#$ -l h_vmem=" << mem << "M" << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << "#$ -o " << home << "/" << dirForTmpFiles << "/output.log." << filelogtemp << endl ;
+ tempOutputFile << "#$ -e " << home << "/" << dirForTmpFiles << "/error.log." << filelogtemp << endl ;
+ }
+ else{
+ tempOutputFile << "#$ -o " << dirForTmpFiles << "/" << env["LOGFILE"] << ".output.log" << endl ;
+ tempOutputFile << "#$ -e " << dirForTmpFiles << "/" << env["LOGFILE"] << ".error.log" << endl ;
+ }
+ if( workDir.size() > 0 )
+ tempOutputFile << "cd " << workDir << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << _mpiImpl->boot("",nbproc);
+ tempOutputFile << _mpiImpl->run("${TMPDIR}/machines",nbproc,fileNameToExecute);
+ tempOutputFile << _mpiImpl->halt();
+ }
+ else{
+ tempOutputFile << "source " << env["SOURCEFILE"] << endl ;
+ tempOutputFile << env["COMMAND"];
+ }
+
+ tempOutputFile.flush();
+ tempOutputFile.close();
+ chmod(TmpFileName.c_str(), 0x1ED);
+ cerr << TmpFileName.c_str() << endl;
+
+ string command;
+ if( _protocol == "rsh" )
+ command = "rcp ";
+ else if( _protocol == "ssh" )
+ command = "scp ";
+ else
+ throw EmulationException("Unknown protocol");
+ command += TmpFileName;
+ command += " ";
+ if(_username != ""){
+ command += _username;
+ command += "@";
+ }
+ command += _hostname;
+ command += ":";
+ command += dirForTmpFiles ;
+ command += "/" ;
+ command += rootNameToExecute ;
+ command += "_Batch.sh" ;
+ cerr << command.c_str() << endl;
+ status = system(command.c_str());
+ if(status)
+ throw EmulationException("Error of connection on remote host");
+
+ RmTmpFile(TmpFileName);
+#endif //WIN32
+ }
+
+ std::string BatchManager_eSGE::getWallTime(const long edt)
+ {
+ long h, m;
+ h = edt / 60;
+ m = edt - h*60;
+ ostringstream oss;
+ if( m >= 10 )
+ oss << h << ":" << m;
+ else
+ oss << h << ":0" << m;
+ return oss.str();
+ }
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * BatchManager_eSGE.hxx : emulation of SGE client
+ *
+ * Auteur : Bernard SECHER - CEA DEN
+ * Mail : mailto:bernard.secher@cea.fr
+ * Date : Thu Apr 24 10:17:22 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#ifndef _BATCHMANAGER_eLSF_H_
+#define _BATCHMANAGER_eLSF_H_
+
+#include "Batch_Defines.hxx"
+#include "Batch_JobId.hxx"
+#include "Batch_JobInfo.hxx"
+#include "Batch_JobInfo_eSGE.hxx"
+#include "Batch_InvalidArgumentException.hxx"
+#include "Batch_ConnexionFailureException.hxx"
+#include "Batch_APIInternalFailureException.hxx"
+#include "Batch_NotYetImplementedException.hxx"
+#include "Batch_BatchManager.hxx"
+#include "Batch_BatchManager_eClient.hxx"
+
+namespace Batch {
+
+ class Job;
+ class JobId;
+ class JobInfo;
+ class FactBatchManager;
+
+ class BATCH_EXPORT BatchManager_eSGE : public BatchManager_eClient
+ {
+ public:
+ // Constructeur et destructeur
+ BatchManager_eSGE(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="nompi") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
+ virtual ~BatchManager_eSGE();
+
+ // Recupere le nom du serveur par defaut
+ // static string BatchManager_LSF::getDefaultServer();
+
+ // Methodes pour le controle des jobs
+ virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+ virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
+ virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
+ virtual void releaseJob(const JobId & jobid); // relache un job suspendu
+ virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env); // modifie un job en file d'attente
+ virtual void alterJob(const JobId & jobid, const Parametre & param); // modifie un job en file d'attente
+ virtual void alterJob(const JobId & jobid, const Environnement & env); // modifie un job en file d'attente
+ virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
+ virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
+
+ virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
+ virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
+
+
+ protected:
+ void buildBatchScript(const Job & job) throw(EmulationException);
+ std::string getWallTime(const long edt);
+
+ private:
+
+#ifdef SWIG
+ public:
+ // Recupere le l'identifiant d'un job deja soumis au BatchManager
+ //virtual const JobId getJobIdByReference(const string & ref) { return BatchManager::getJobIdByReference(ref); }
+ virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
+#endif
+
+ };
+
+}
+
+#endif
#include <string>
#include <sstream>
+#include <iostream>
#include "Batch_BatchManagerCatalog.hxx"
#include "Batch_FactBatchManager.hxx"
-#include "utilities.h"
using namespace std;
namespace Batch {
FactBatchManager::FactBatchManager(const string & _t) : type(_t)
{
BatchManagerCatalog::addFactBatchManager(type.c_str(), this);
- /*
- #ifndef WIN32
- Win32 limitation: it's impossible to create new thread of LocalTraceCollector
- during initialization of static objects of DLL
- Be careful with static objects of types inherited from FactBatchManager class
- */
ostringstream msg;
msg << "FactBatchManager of type '" << type << "' inserted into catalog";
- MESSAGE(msg.str().c_str());
- //#endif
+ cerr << msg.str().c_str() << endl;
}
// Destructeur
*
*/
-#include <string>
#include "Batch_BatchManager_PBS.hxx"
#include "Batch_FactBatchManager_PBS.hxx"
-#include "utilities.h"
using namespace std;
namespace Batch {
// Functor
BatchManager * FactBatchManager_PBS::operator() (const char * hostname) const
{
- MESSAGE("Building new BatchManager_PBS on host '" << hostname << "'");
return new BatchManager_PBS(this, hostname);
}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * FactBatchManager_eSGE.cxx :
+ *
+ * Auteur : Bernard SECHER - CEA DEN
+ * Date : Avril 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#include <string>
+#include "Batch_BatchManager_eSGE.hxx"
+#include "Batch_FactBatchManager_eSGE.hxx"
+//#include "utilities.h"
+
+namespace Batch {
+
+ static FactBatchManager_eSGE sFBM_eSGE;
+
+ // Constructeur
+ FactBatchManager_eSGE::FactBatchManager_eSGE() : FactBatchManager_eClient("eSGE")
+ {
+ // Nothing to do
+ }
+
+ // Destructeur
+ FactBatchManager_eSGE::~FactBatchManager_eSGE()
+ {
+ // Nothing to do
+ }
+
+ // Functor
+ BatchManager * FactBatchManager_eSGE::operator() (const char * hostname) const
+ {
+ // MESSAGE("Building new BatchManager_SGE on host '" << hostname << "'");
+ return new BatchManager_eSGE(this, hostname);
+ }
+
+ BatchManager_eClient * FactBatchManager_eSGE::operator() (const char * hostname, const char * protocol, const char * mpiImpl) const
+ {
+ // MESSAGE("Building new BatchManager_SGE on host '" << hostname << "'");
+ return new BatchManager_eSGE(this, hostname, protocol, mpiImpl);
+ }
+
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * FactBatchManager_eSGE.hxx :
+ *
+ * Auteur : Bernard SECHER : CEA DEN
+ * Date : Avril 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#ifndef _FACTBATCHMANAGER_eSGE_H_
+#define _FACTBATCHMANAGER_eSGE_H_
+
+#include "Batch_Defines.hxx"
+
+#include "Batch_BatchManager_eClient.hxx"
+#include "Batch_FactBatchManager_eClient.hxx"
+
+namespace Batch {
+
+ class BatchManager_eSGE;
+
+ class BATCH_EXPORT FactBatchManager_eSGE : public FactBatchManager_eClient
+ {
+ public:
+ // Constructeur et destructeur
+ FactBatchManager_eSGE();
+ virtual ~FactBatchManager_eSGE();
+
+ virtual BatchManager * operator() (const char * hostname) const;
+ virtual BatchManager_eClient * operator() (const char * hostname, const char * protocol, const char * mpiImpl) const;
+
+ protected:
+
+ private:
+
+ };
+
+}
+
+#endif
#include "Batch_Parametre.hxx"
#include "Batch_Environnement.hxx"
-using namespace std;
-
namespace Batch {
class BATCH_EXPORT JobInfo
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * JobInfo_eSGE.cxx : emulation of SGE client
+ *
+ * Auteur : Bernard SECHER - CEA DEN
+ * Mail : mailto:bernard.secher@cea.fr
+ * Date : Thu Apr 24 10:17:22 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#include <cstdio>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include "Batch_Parametre.hxx"
+#include "Batch_Environnement.hxx"
+#include "Batch_RunTimeException.hxx"
+#include "Batch_APIInternalFailureException.hxx"
+#include "Batch_JobInfo_eSGE.hxx"
+
+using namespace std;
+
+namespace Batch {
+
+
+
+ // Constructeurs
+ JobInfo_eSGE::JobInfo_eSGE(int id, string logFile) : JobInfo()
+ {
+ // On remplit les membres _param et _env
+ ostringstream oss;
+ oss << id;
+ _param[ID] = oss.str();
+
+ // read of log file
+ char line[128];
+ ifstream fp(logFile.c_str(),ios::in);
+
+ string status;
+ string sline;
+ fp.getline(line,80,'\n');
+ sline = string(line);
+
+ if( sline.length() > 0 ){
+ istringstream iss(sline);
+ iss >> status >> status >> status >> status >> status;
+ }
+ else
+ status = "e";
+
+ _param[STATE] = status;
+
+ if( status.find("r") != string::npos)
+ _running = true;
+
+ }
+
+ // Teste si un job est present en machine
+ bool JobInfo_eSGE::isRunning() const
+ {
+ return _running;
+ }
+
+
+ // Destructeur
+ JobInfo_eSGE::~JobInfo_eSGE()
+ {
+ // Nothing to do
+ }
+
+ // Convertit une date HH:MM:SS en secondes
+ long JobInfo_eSGE::HMStoLong(const string & s)
+ {
+ long hour, min, sec;
+
+ sscanf( s.c_str(), "%ld:%ld:%ld", &hour, &min, &sec);
+ return ( ( ( hour * 60L ) + min ) * 60L ) + sec;
+ }
+
+ // Methode pour l'interfacage avec Python (SWIG) : affichage en Python
+ string JobInfo_eSGE::__str__() const
+ {
+ ostringstream sst;
+ sst << "<JobInfo_eSGE (" << this << ") :" << endl;
+ sst << " ID = " <<_param[ID] << endl;
+ sst << " STATE = " <<_param[STATE] << endl;
+
+ return sst.str();
+ }
+
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+/*
+ * JobInfo_eSGE.hxx : emulation of SGE client
+ *
+ * Auteur : Bernard SECHER - CEA DEN
+ * Mail : mailto:bernard.secher@cea.fr
+ * Date : Thu Apr 24 10:17:22 2008
+ * Projet : PAL Salome
+ *
+ */
+
+#ifndef _JOBINFO_SGE_H_
+#define _JOBINFO_SGE_H_
+
+#include <string>
+#include "Batch_Defines.hxx"
+#include "Batch_RunTimeException.hxx"
+#include "Batch_JobInfo.hxx"
+
+namespace Batch {
+
+ class BATCH_EXPORT JobInfo_eSGE : public JobInfo
+ {
+ public:
+ // Constructeurs et destructeur
+ JobInfo_eSGE() : _running(false) {};
+ JobInfo_eSGE(int id,std::string logFile);
+ virtual ~JobInfo_eSGE();
+
+ // Constructeur par recopie
+ JobInfo_eSGE(const JobInfo_eSGE & jinfo) : JobInfo(jinfo) {};
+
+ // Teste si un job est present en machine
+ virtual bool isRunning() const;
+
+ // Methodes pour l'interfacage avec Python (SWIG)
+ // TODO : supprimer ces methodes et transferer leur definitions dans SWIG
+ std::string __str__() const; // SWIG : affichage en Python
+ std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python
+
+ protected:
+ bool _running; // etat du job en machine
+
+ private:
+ // Convertit une date HH:MM:SS en secondes
+ long HMStoLong(const std::string &);
+
+ };
+
+}
+
+#endif
Batch_FactBatchManager_ePBS.hxx \
Batch_JobInfo_ePBS.hxx \
MpiImpl.hxx \
- Batch_Defines.hxx
+ Batch_Defines.hxx \
+ Batch_BatchManager_eSGE.hxx \
+ Batch_FactBatchManager_eSGE.hxx \
+ Batch_JobInfo_eSGE.hxx \
+ MpiImpl.hxx
LIB_SRC = \
Batch_BatchManager_ePBS.cxx \
Batch_FactBatchManager_ePBS.cxx \
Batch_JobInfo_ePBS.cxx \
+ Batch_BatchManager_eSGE.cxx \
+ Batch_FactBatchManager_eSGE.cxx \
+ Batch_JobInfo_eSGE.cxx \
MpiImpl.cxx
LIB_CPPFLAGS = \
- ${PYTHON_INCLUDES} \
+ ${PYTHON_INCLUDES}
+if !WITHONLYLAUNCHER
+ LIB_CPPFLAGS += \
-I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
-I$(top_builddir)/salome_adm/unix
+endif
-LIB_LIBADD = \
- ${PYTHON_LIBS} \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
+LIB_LIBADD =
+if !WITHONLYLAUNCHER
+ LIB_LIBADD += \
../Basics/libSALOMEBasics.la
+endif
+LIB_LIBADD += $(PYTHON_LIBS)
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Batch_Job_Local.cxx \
Batch_IOMutex.cxx
-LIB_CPPFLAGS += -DHAVE_CONFIG_H
+if !WITHONLYLAUNCHER
+ LIB_CPPFLAGS += -DHAVE_CONFIG_H
+endif
endif
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/*
- * BatchManager.cxx :
- *
- * Auteur : Bernard SECHER - CEA/DEN
- * Date : Juillet 2007
- * Projet : SALOME
- *
- */
#include <iostream>
#include <sstream>
string MpiImpl_MPICH1::size()
{
- throw MpiImplException("mpich1 doesn't work with this batch system to submit salome session");
+ return "${MPIRUN_NPROCS}";
}
string MpiImpl_MPICH1::rank()
{
- throw MpiImplException("mpich1 doesn't work with this batch system to submit salome session");
+ return "${MPIRUN_RANK}";
}
string MpiImpl_MPICH1::boot(const string machinefile, const unsigned int nbnodes)
string MpiImpl_MPICH2::boot(const string machinefile, const unsigned int nbnodes)
{
ostringstream oss;
- oss << "mpdboot -n " << nbnodes << " -f " << machinefile << endl;
+ oss << "mpdboot" << " -n " << nbnodes;
+ if (machinefile!="")
+ oss << " -f " << machinefile;
+ oss << endl;
return oss.str();
}
return "";
}
+// prun implementation
+// Constructor
+MpiImpl_PRUN::MpiImpl_PRUN() : MpiImpl()
+{
+}
+
+// Destructor
+MpiImpl_PRUN::~MpiImpl_PRUN()
+{
+}
+
+string MpiImpl_PRUN::size()
+{
+ return "${RMS_NPROCS}";
+}
+
+string MpiImpl_PRUN::rank()
+{
+ return "${RMS_RANK}";
+}
+
+string MpiImpl_PRUN::boot(const string machinefile, const unsigned int nbnodes)
+{
+ return "";
+}
+
+string MpiImpl_PRUN::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+{
+ ostringstream oss;
+ oss << "prun -n " << nbproc << " " << "-p mpi " << fileNameToExecute << endl;
+ return oss.str();
+}
+
+string MpiImpl_PRUN::halt()
+{
+ return "";
+}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/*
- * BatchManager.hxx :
- *
- * Auteur : Bernard SECHER - CEA/DEN
- * Date : Juillet 2007
- * Projet : SALOME
- *
- */
#ifndef _BL_MPIIMPL_H_
#define _BL_MPIIMPL_H_
};
+class BATCH_EXPORT MpiImpl_PRUN : public MpiImpl
+{
+public:
+ // Constructeur et destructeur
+ MpiImpl_PRUN(); // constructor
+ virtual ~MpiImpl_PRUN(); //Destructor
+
+ std::string size(); // get number of process of current job
+ std::string rank(); // get process number of current job
+ std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
+ std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
+ std::string halt(); // get stop command
+
+protected:
+
+private:
+
+};
+
#endif
# The library will be installed in the common place.
#
+BUILT_SOURCES = swig_wrap.cpp
+
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Batch
SWIG_SOURCES = libBatch_Swig.i libBatch_Swig_exception.i libBatch_Swig_typemap.i
-nodist_salomepython_PYTHON = libBatch_Swig.py
-salomepyexec_LTLIBRARIES = _libBatch_Swig.la
-nodist__libBatch_Swig_la_SOURCES = swig_wrap.cpp
-_libBatch_Swig_la_SOURCES = $(SWIG_SOURCES)
+salomepython_PYTHON = libBatch_Swig.py
+salomepyexec_LTLIBRARIES = _libBatch_Swig.la
+_libBatch_Swig_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libBatch_Swig_la_CPPFLAGS = @PYTHON_INCLUDES@ -I$(srcdir) -I$(srcdir)/../Batch
_libBatch_Swig_la_LDFLAGS = -module
_libBatch_Swig_la_LIBADD = ../Batch/libSalomeBatch.la @PYTHON_LIBS@
swig_wrap.cpp : $(SWIG_SOURCES)
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-CLEANFILES = swig_wrap.cpp libBatch_Swig.py
+CLEANFILES = swig_wrap.cpp
#
/* Le nom du module Python tel qu'il est importe */
%module libBatch_Swig
+/* generate docstrings with types */
+%feature("autodoc", "1");
+
/* Inclusion des conversions de type */
%include libBatch_Swig_typemap.i
#include "Batch_PyVersatile.hxx"
#include "Batch_JobId.hxx"
#include "Batch_FactBatchManager.hxx"
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
%}
# // supprime toutes les definitions par defaut => sert au debug
}
}
+%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Batch::Parametre
+{
+ $1 = PyDict_Check($input)? 1 : 0;
+}
# // construction d'un dictionnaire Python a partir d'un objet Parametre C++
%typemap(out) Batch::Parametre
}
}
+%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Batch::Environnement
+{
+ $1 = PyDict_Check($input)? 1 : 0;
+}
# // construction d'un dictionnaire Python a partir d'un objet Environnement C++
%typemap(out) Batch::Environnement
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// 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
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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
//
#include "Receiver.hxx"
#include <string.h>
# The library will be installed in the common place.
#
+BUILT_SOURCES = swig_wrap.cpp
+
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Communication
SWIG_SOURCES = libSALOME_Comm.i
-nodist_salomepython_PYTHON = libSALOME_Comm.py
+salomepython_PYTHON = libSALOME_Comm.py
salomepyexec_LTLIBRARIES = _libSALOME_Comm.la
-nodist__libSALOME_Comm_la_SOURCES = swig_wrap.cpp
-_libSALOME_Comm_la_SOURCES = $(SWIG_SOURCES)
+_libSALOME_Comm_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libSALOME_Comm_la_CPPFLAGS =\
@PYTHON_INCLUDES@ \
-I$(srcdir) -I$(srcdir)/../Communication \
swig_wrap.cpp : $(SWIG_SOURCES)
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-CLEANFILES = swig_wrap.cpp libSALOME_Comm.py
+CLEANFILES = swig_wrap.cpp
#
//
%module libSALOME_Comm
+%feature("autodoc", "1");
+
%{
#include "ReceiverFactory.hxx"
#include "MatrixClient.hxx"
* \param instanceName unique instance name for this object (see Container_i)
* \param interfaceName component class name
* \param notif use of notification
+ * \param regist (true or false) use of registry (default true)
*/
//=============================================================================
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif) :
+ bool notif,
+ bool regist) :
_instanceName(instanceName),
_interfaceName(interfaceName),
_myConnexionToRegistry(0),
_contId = 0;
}
const CORBA::String_var ior = _orb->object_to_string(_container);
- _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str());
+ if(regist)
+ _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str());
_notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
}
MESSAGE("Engines_Component_i::destroy()");
//SCRUTE(pd_refCount);
- delete _notifSupplier;
- _notifSupplier = 0;
-
- delete _myConnexionToRegistry;
+ if(_myConnexionToRegistry)delete _myConnexionToRegistry;
_myConnexionToRegistry = 0 ;
+ if(_notifSupplier)delete _notifSupplier;
+ _notifSupplier = 0;
if(_id)
delete(_id) ;
//SCRUTE(pd_refCount);
*/
std::map<std::string, Engines::Component_var>::iterator itm;
for (itm = _listInstances_map.begin(); itm != _listInstances_map.end(); itm++)
- itm->second->destroy();
+ {
+ try
+ {
+ itm->second->destroy();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore this entry and continue
+ }
+ catch(...)
+ {
+ // ignore this entry and continue
+ }
+ }
_NS->Destroy_FullDirectory(_containerName.c_str());
_NS->Destroy_Name(_containerName.c_str());
MESSAGE("=================================================================");
MESSAGE("Python Initialization...");
MESSAGE("=================================================================");
+ // set stdout to line buffering (aka C++ std::cout)
+ setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
Py_SetProgramName(argv[0]);
Py_Initialize(); // Initialize the interpreter
PySys_SetArgv(argc, argv);
SALOME_Container_LDADD = \
libSalomeContainer.la \
../Basics/libSALOMEBasics.la \
- ../HDFPersist/libSalomeHDFPersist.la \
$(HDF5_LIBS) \
$(MPI_LIBS) \
$(CORBA_LIBS) \
TestSalome_file_LDADD =\
libSalomeContainer.la \
../Basics/libSALOMEBasics.la \
- ../HDFPersist/libSalomeHDFPersist.la \
$(HDF5_LIBS) \
$(MPI_LIBS) \
$(CORBA_LIBS) \
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif = false);
- // Consructeur pour composant parallele: ne pas faire appel au registry
+ bool notif = false,
+ bool regist=true);
+ // Constructor for parallel component : don't call registry
Engines_Component_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
PortableServer::ObjectId * contId,
MESSAGE( "SALOME_Container_i::import_component" )
ret=0
try:
- print "try import ",componentName
+ if verbose(): print "try import ",componentName
__import__(componentName)
- print "import ",componentName," successful"
+ if verbose(): print "import ",componentName," successful"
ret=1
except:
- import traceback
- traceback.print_exc()
- print "import ",componentName," not possible"
+ if verbose():
+ import traceback
+ traceback.print_exc()
+ print "import ",componentName," not possible"
return ret
#-------------------------------------------------------------------------
#include "PaCO++.h"
#endif
-#define TIME_OUT_TO_LAUNCH_CONT 21
+#define TIME_OUT_TO_LAUNCH_CONT 61
using namespace std;
if( isOK ){
vector<string> vec = _NS->list_directory_recurs();
list<string> lstCont;
- for(vector<string>::iterator iter = vec.begin();iter!=vec.end();iter++){
+ for(vector<string>::iterator iter = vec.begin();iter!=vec.end();iter++)
+ {
SCRUTE((*iter));
CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
- Engines::Container_var cont=Engines::Container::_narrow(obj);
- if(!CORBA::is_nil(cont)){
- lstCont.push_back((*iter));
- }
+ try
+ {
+ Engines::Container_var cont=Engines::Container::_narrow(obj);
+ if(!CORBA::is_nil(cont))
+ lstCont.push_back((*iter));
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore this entry and continue
+ }
}
MESSAGE("Container list: ");
for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
CORBA::Object_var obj = _NS->Resolve(containerNameInNS.c_str());
if ( !CORBA::is_nil(obj) )
{
- // shutdown the registered container if it exists
- Engines::Container_var cont=Engines::Container::_narrow(obj);
- if(!CORBA::is_nil(cont))
- {
- try
- {
- cont->Shutdown();
- }
- catch(CORBA::Exception&)
- {
- INFOS("CORBA::Exception ignored.");
- }
- }
+ try
+ {
+ // shutdown the registered container if it exists
+ Engines::Container_var cont=Engines::Container::_narrow(obj);
+ if(!CORBA::is_nil(cont))
+ cont->Shutdown();
+ }
+ catch(CORBA::Exception&)
+ {
+ INFOS("CORBA::Exception ignored.");
+ }
}
//redirect stdout and stderr in a file
// launch container with a system call
int status=system(command.c_str());
- RmTmpFile(); // command file can be removed here
if (status == -1){
MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " <<
"(system command status -1)");
+ RmTmpFile(); // command file can be removed here
return Engines::Container::_nil();
}
else if (status == 217){
MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " <<
"(system command status 217)");
+ RmTmpFile(); // command file can be removed here
return Engines::Container::_nil();
}
else{
ret->logfilename(logFilename.c_str());
}
+ RmTmpFile(); // command file can be removed here
return ret;
}
}
if verbose(): print "import ",componentName," successful"
ret=1
except:
- import traceback
- traceback.print_exc()
- print "import ",componentName," not possible"
+ if verbose():
+ import traceback
+ traceback.print_exc()
+ print "import ",componentName," not possible"
return ret
#-------------------------------------------------------------------------
#=============================================================================
if __name__ == "__main__":
+ # change the stdout buffering to line buffering (same as C++ cout buffering)
+ sys.stdout=os.fdopen(1,"w",1)
#initialise the ORB and find the root POA
if verbose():print "Starting ",sys.argv[1]
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
#include <iostream>
#include <fstream>
#include <sstream>
-#include <stdlib.h>
#include "HDFascii.hxx"
+#include <stdlib.h>
using namespace std;
# This local variable defines the list of CPPFLAGS common to all target in this package.
COMMON_CPPFLAGS=\
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../HDFPersist \
- @HDF5_INCLUDES@ \
@BOOST_CPPFLAGS@
# This local variable defines the list of dependant libraries common to all target in this package.
-COMMON_LIBS =\
- ../HDFPersist/libSalomeHDFPersist.la \
- @HDF5_LIBS@
+COMMON_LIBS =
#
# ===============================================================
bin_PROGRAMS = testDF
testDF_SOURCES = testDF.cxx
testDF_CPPFLAGS = $(COMMON_CPPFLAGS)
-testDF_LDADD = ./libDF.la \
- $(HDF5_LIBS)
+testDF_LDADD = ./libDF.la
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif) : Engines_Component_i(orb, poa, container, instanceName, interfaceName)
+ bool notif,
+ bool regist) :
+ Engines_Component_i(orb, poa, container, instanceName, interfaceName,notif,regist)
{
#ifdef _DEBUG_
std::cerr << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl;
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif = false);
+ bool notif = false,
+ bool regist = true );
virtual ~Engines_DSC_i();
#
AM_CFLAGS = -fexceptions
-salomepython_PYTHON = dsccalcium.py
-nodist_salomepython_PYTHON = calcium.py
+salomepython_PYTHON = calcium.py dsccalcium.py
salomepyexec_LTLIBRARIES = _calcium.la
-MY_SWIG_FLAGS = $(SWIG_FLAGS) -noexcept -I$(top_srcdir)/src/DSC/DSC_User/Datastream/Calcium
-SWIG_SRC = calcium.i
-nodist__calcium_la_SOURCES = calcium_wrap.cpp
-_calcium_la_SOURCES = $(SWIG_SRC)
+MY_SWIG_FLAGS= $(SWIG_FLAGS) -noexcept -I$(top_srcdir)/src/DSC/DSC_User/Datastream/Calcium
+SWIG_SRC=calcium.i
+_calcium_la_SOURCES = calcium_wrap.cpp
_calcium_la_LDFLAGS = -module
_calcium_la_LIBADD = ../DSC_User/Datastream/Calcium/libCalciumC.la \
../DSC_User/Datastream/libSalomeDatastream.la \
_calcium_la_CXXFLAGS = $(PYTHON_INCLUDES) $(COMMON_CPPFLAGS)
-calcium_wrap.cpp calcium.py:$(SWIG_SRC)
+EXTRA_DIST=calcium_wrap.cpp calcium.i
+
+calcium_wrap.cpp calcium.py:calcium.i
$(SWIG) $(MY_SWIG_FLAGS) -o calcium_wrap.cpp $<
-CLEANFILES = calcium_wrap.cpp calcium.py
+CLEANFILES = calcium_wrap.cpp
COMMON_CPPFLAGS= -I$(top_builddir)/idl \
-I$(top_srcdir)/src/DSC/DSC_Basic \
-I$(top_srcdir)/src/DSC/DSC_User \
+ -I$(top_srcdir)/src/Container \
+ -I$(top_srcdir)/src/Notification \
+ -I$(top_srcdir)/src/SALOMELocalTrace \
+ -I$(top_srcdir)/src/Basics \
+ -I$(top_srcdir)/src/Utils \
-I$(top_builddir)/salome_adm/unix \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
libSalomeDSCSupervBasic_la_CXXFLAGS = $(COMMON_CPPFLAGS)
libSalomeDSCSupervBasic_la_LDFLAGS = -no-undefined -version-info=0:0:0
+libSalomeDSCSupervBasic_la_LIBADD = ../libSalomeDSCSuperv.la
// Module : KERNEL
//
#include "basic_port_factory.hxx"
+#include "Superv_Component_i.hxx"
using namespace std;
-basic_port_factory::basic_port_factory() {}
+basic_port_factory::basic_port_factory() {
+ Superv_Component_i::register_factory("BASIC",this);
+}
basic_port_factory::~basic_port_factory() {}
rtn_port = new data_short_port_uses();
return rtn_port;
}
+
+static basic_port_factory myfactory;
const char *instanceName,
const char *interfaceName,
bool notif) :
- Superv_Component_i(orb, poa,contain, instanceName, interfaceName)
+ Superv_Component_i(orb, poa,contain, instanceName, interfaceName,false,false)
{
}
#define _PORT_TRAITS_HXX_
#include "Superv_Component_i.hxx"
+#include "calcium_port_factory.hxx"
// PROVIDES PORT TRAITS
template <class T> struct UnknownProvidesPortType {};
#
# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS= -I$(srcdir) -I$(top_srcdir)/src/DSC/DSC_User \
+COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \
-I$(top_srcdir)/src/DSC/DSC_User/Datastream \
-I$(top_srcdir)/src/DSC/DSC_User/Datastream/Palm \
-I$(top_srcdir)/src/DSC/DSC_User/Basic \
// Id : $Id$
//
#include "calcium_port_factory.hxx"
+#include "Superv_Component_i.hxx"
using namespace std;
-calcium_port_factory::calcium_port_factory() {}
+calcium_port_factory::calcium_port_factory() {
+ Superv_Component_i::register_factory("CALCIUM",this);
+}
calcium_port_factory::~calcium_port_factory() {}
return rtn_port;
}
+
+static calcium_port_factory myfactory;
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS = $(top_builddir)/src/DSC/DSC_User/Datastream/Palm/libSalomePalm.la \
- $(top_builddir)/src/DSC/DSC_User/Datastream/Calcium/libSalomeCalcium.la
+ $(top_builddir)/src/DSC/DSC_User/Datastream/Calcium/libSalomeCalcium.la \
+ ../libSalomeDSCSuperv.la
#
# ===============================================================
COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \
-I$(top_srcdir)/src/DSC/DSC_User/Datastream \
-I$(top_srcdir)/src/DSC/DSC_Basic \
+ -I$(top_srcdir)/src/Container \
+ -I$(top_srcdir)/src/Notification \
+ -I$(top_srcdir)/src/SALOMELocalTrace \
+ -I$(top_srcdir)/src/Basics \
-I$(top_srcdir)/src/Utils \
-I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl \
// Id : $Id$
//
#include "palm_port_factory.hxx"
+#include "Superv_Component_i.hxx"
using namespace std;
palm_port_factory::palm_port_factory() {
+ Superv_Component_i::register_factory("PALM",this);
}
palm_port_factory::~palm_port_factory() {}
uses_port * rtn_port = NULL;
return rtn_port;
}
+
+static palm_port_factory myfactory;
#
# This local variable defines the list of CPPFLAGS common to all target in this package.
-COMMON_CPPFLAGS= -I$(srcdir) -I$(srcdir)/Basic \
- -I$(srcdir)/Datastream \
- -I$(srcdir)/Datastream/Palm \
- -I$(srcdir)/Datastream/Calcium \
+COMMON_CPPFLAGS= \
-I$(top_srcdir)/src/Container \
-I$(top_srcdir)/src/Notification \
-I$(top_srcdir)/src/DSC/DSC_Basic \
libSalomeDSCSuperv_la_CXXFLAGS = $(COMMON_CPPFLAGS)
libSalomeDSCSuperv_la_LDFLAGS = -no-undefined -version-info=0:0:0
+libSalomeDSCSuperv_la_LIBADD = ../DSC_Basic/libSalomeDSCContainer.la
#
# ===============================================================
test_DSC_Exception_LDADD = $(top_builddir)/src/Utils/libOpUtil.la \
$(CORBA_LIBS)
-SUBDIRS = Basic Datastream
+SUBDIRS = . Basic Datastream
//
#include "Superv_Component_i.hxx"
-using namespace std;
-
DSC_EXCEPTION_CXX(Superv_Component_i,BadFabType);
DSC_EXCEPTION_CXX(Superv_Component_i,BadType);
DSC_EXCEPTION_CXX(Superv_Component_i,BadCast);
DSC_EXCEPTION_CXX(Superv_Component_i,NilPort);
DSC_EXCEPTION_CXX(Superv_Component_i,BadProperty);
+std::map<std::string, port_factory*> Superv_Component_i::_factory_map;
+
Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
PortableServer::ObjectId * contId,
#ifdef _DEBUG_
std::cerr << "--Superv_Component_i : MARK 1 ---- " << instanceName << "----" << std::endl;
#endif
- register_factory("BASIC", new basic_port_factory());
- register_factory("PALM", new palm_port_factory());
- register_factory("CALCIUM", new calcium_port_factory());
}
Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif) : Engines_DSC_i(orb, poa, container, instanceName, interfaceName)
+ bool notif,
+ bool regist) :
+ Engines_DSC_i(orb, poa, container, instanceName, interfaceName,notif,regist)
{
#ifdef _DEBUG_
std::cerr << "--Superv_Component_i : MARK 1 ---- " << instanceName << "----" << std::endl;
#endif
- register_factory("BASIC", new basic_port_factory());
- register_factory("PALM", new palm_port_factory());
- register_factory("CALCIUM", new calcium_port_factory());
}
#include "provides_port.hxx"
#include "port_factory.hxx"
-// default ports factories in the Kernel
-#include "basic_port_factory.hxx"
-#include "palm_port_factory.hxx"
-#include "calcium_port_factory.hxx"
-
#include "DSC_Exception.hxx"
+#include <vector>
+
/*! \class Superv_Component_i
* \brief This class implements DSC_User component.
Engines::Container_ptr container,
const char *instanceName,
const char *interfaceName,
- bool notif = false);
+ bool notif = false,
+ bool regist = true );
virtual ~Superv_Component_i();
// Exceptions declarations.
* and Superv_Component_i::create_uses_data_port)
* \param factory_ptr factory pointer (destroyed by the component)
*/
- virtual void register_factory(const std::string & factory_name,
+ static void register_factory(const std::string & factory_name,
port_factory * factory_ptr);
/*!
private:
// Factory map
typedef std::map<std::string, port_factory*> factory_map_t;
- factory_map_t _factory_map;
+ static factory_map_t _factory_map;
/*-------------------------------------------------*/
// A Superv_Component port.
}
#include "HDFcontainerObject.hxx"
#include "HDFexception.hxx"
-//#include "utilities.h"
using namespace std;
HDFcontainerObject::HDFcontainerObject(const char *name)
{
sonToDelete = _firstson;
_firstson = _firstson->GetNextBrother();
-// MESSAGE("son to delete: " << sonToDelete);
delete sonToDelete;
}
-// MESSAGE("destruction: " << this);
}
int HDFcontainerObject::nInternalObjects()
void HDFcontainerObject::AddSon(HDFinternalObject *son)
{
-// MESSAGE("add son ") MESSAGE("add to this" << this);
-// MESSAGE("add son " << son);
-// MESSAGE("firstson " << _firstson);
-// MESSAGE("lastson " << _lastson);
-
if (_nsons == 0)
{
_firstson = son;
_lastson = son;
}
_nsons ++;
-// MESSAGE("firstson " << _firstson);
-// MESSAGE("lastson " << _lastson);
}
HDFinternalObject *HDFcontainerObject::GetFirstSon()
#include "hdfi.h"
}
-#include <string>
-//#include "utilities.h"
+#include <string.h>
+#include <stdlib.h>
using namespace std;
HDFobject::HDFobject(const char *name)
{
- // MESSAGE("-------- constructor " << name << " " << this);
HDFerrorModeLock();
- _name = new char[strlen(name)+1];
- strcpy(_name,name);
+ _name = strdup(name);
_id = -1;
}
HDFobject::~HDFobject()
{
- //delete [] _name;
- delete _name;
- // MESSAGE("-------- destructor ------" << this);
+ free(_name);
}
hdf_idt HDFobject::GetId()
libSalomeHDFPersist_la_LDFLAGS = -no-undefined -version-info=0:0:0
-libSalomeHDFPersist_la_CPPFLAGS = @HDF5_INCLUDES@ -D@MACHINE@ \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../Basics
+libSalomeHDFPersist_la_CPPFLAGS = @HDF5_INCLUDES@ -D@MACHINE@
libSalomeHDFPersist_la_LIBADD = @HDF5_LIBS@
test7.cxx \
test8.cxx \
test9.cxx
-
-#bin_PROGRAMS=HDFtest1 HDFtest2 HDFtest3
-#HDFtest1_SOURCES = test1.c
-#HDFtest2_SOURCES = test2.c
-#HDFtest3_SOURCES = test3.cxx
-
-#AM_CFLAGS= @CAS_CPPFLAGS@ @HDF5_INCLUDES@ -D@MACHINE@ \
-# -I$(srcdir)/../SALOMELocalTrace \
-# -I$(srcdir)/../Basics
-#AM_CXXFLAGS= @CAS_CPPFLAGS@ @HDF5_INCLUDES@ -D@MACHINE@ \
-# -I$(srcdir)/../SALOMELocalTrace \
-# -I$(srcdir)/../Basics
-#AM_LDFLAGS= @HDF5_LIBS@
std::string batch_type = _batch_descr.batch.in();
// Basic test
- if (batch_type == "slurm")
+ if (batch_type == "lsf")
{
- INFOS("test_jobsubmit_simple not yet implemented for slurm... return OK");
+ INFOS("test_jobsubmit_simple not yet implemented for lsf... return OK");
+ result = "OK";
+ return result;
+ }
+ if (batch_type == "sge")
+ {
+ INFOS("test_jobsubmit_simple not yet implemented for sge... return OK");
result = "OK";
return result;
}
mpiImpl = new MpiImpl_MPICH2();
else if(mpi_type == "openmpi")
mpiImpl = new MpiImpl_OPENMPI();
+ else if(mpi_type == "slurm")
+ mpiImpl = new MpiImpl_SLURM();
else
{
result += "Error MPI impl not supported : " + mpi_type;
return result;
}
- // SLURM not yet implemented...
- if (batch_type == "slurm")
+ // LSF et SGE not yet implemented...
+ if (batch_type == "lsf")
+ {
+ INFOS("test_jobsubmit_simple not yet implemented for lsf... return OK");
+ result = "OK";
+ return result;
+ }
+
+ if (batch_type == "sge")
{
- INFOS("test_jobsubmit_simple not yet implemented for slurm... return OK");
+ INFOS("test_jobsubmit_simple not yet implemented for sge... return OK");
result = "OK";
return result;
}
#include "Batch_FactBatchManager_eLSF.hxx"
#include "Batch_FactBatchManager_ePBS.hxx"
#include "Batch_BatchManager_eClient.hxx"
-
+#include "Batch_FactBatchManager_eSGE.hxx"
+#include "SALOME_Launcher_Handler.hxx"
+#include "Launcher.hxx"
#include <iostream>
#include <sstream>
#include <sys/stat.h>
#include <time.h>
+using namespace std;
+
//=============================================================================
/*!
* Constructor
delete it2->second;
}
+//=============================================================================
+/*! CORBA Method:
+ * Submit a batch job on a cluster and returns the JobId
+ * \param xmlExecuteFile : to define the execution on the batch cluster
+ * \param clusterName : name of the batch cluster
+ */
+//=============================================================================
+long Launcher_cpp::submitJob( const std::string xmlExecuteFile,
+ const std::string clusterName) throw(LauncherException)
+{
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cout << "BEGIN OF Launcher_cpp::submitJob" << endl;
+#endif
+ long jobId;
+ vector<string> aMachineList;
+
+ if(!_ResManager)
+ throw LauncherException("You must set Resources Manager to Launcher!!");
+
+ // verify if cluster is in resources catalog
+ machineParams params;
+ params.hostname = clusterName;
+ vector<string> aCompoList ;
+ try{
+ aMachineList = _ResManager->GetFittingResources(params, aCompoList);
+ }
+ catch(const ResourcesException &ex){
+ throw LauncherException(ex.msg.c_str());
+ }
+ if (aMachineList.size() == 0)
+ throw LauncherException("This cluster is not in resources catalog");
+
+ // Parsing xml file
+ ParseXmlFile(xmlExecuteFile);
+
+ // verify if clustername is in xml file
+ map<std::string,MachineParameters>::const_iterator it1 = _launch.MachinesList.find(clusterName);
+ if(it1 == _launch.MachinesList.end())
+ throw LauncherException("This cluster is not in xml file");
+
+ ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]);
+ string cname(p.Alias);
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cout << "Choose cluster: " << cname << endl;
+#endif
+
+ // search batch manager for that cluster in map or instanciate one
+ map < string, Batch::BatchManager_eClient * >::const_iterator it2 = _batchmap.find(cname);
+ if(it2 == _batchmap.end())
+ {
+ _batchmap[cname] = FactoryBatchManager(p);
+ // TODO: Add a test for the cluster !
+ }
+
+ try{
+
+ // directory on cluster to put files to execute
+ string remotedir = _launch.MachinesList[clusterName].WorkDirectory;
+ // local directory to get files to execute and to put results
+ string localdir = _launch.RefDirectory;
+
+ int idx1 = xmlExecuteFile.find_last_of("/");
+ if(idx1 == string::npos) idx1 = -1;
+ int idx2 = xmlExecuteFile.find(".xml");
+ string logfile = xmlExecuteFile.substr(idx1+1,idx2-idx1-1);
+ string ologfile = logfile + ".output.log";
+ string elogfile = logfile + ".error.log";
+
+ // create and submit job on cluster
+ Batch::Parametre param;
+ param[USER] = p.UserName;
+ param[EXECUTABLE] = "";
+ for(int i=0; i<_launch.InputFile.size();i++)
+ param[INFILE] += Batch::Couple( localdir + "/" + _launch.InputFile[i], remotedir + "/" + _launch.InputFile[i] );
+ for(int i=0; i<_launch.OutputFile.size();i++)
+ param[OUTFILE] += Batch::Couple( localdir + "/" + _launch.OutputFile[i], remotedir + "/" + _launch.OutputFile[i] );
+ param[OUTFILE] += Batch::Couple( localdir + "/" + ologfile, remotedir + "/" + ologfile );
+ param[OUTFILE] += Batch::Couple( localdir + "/" + elogfile, remotedir + "/" + elogfile );
+ param[NBPROC] = _launch.NbOfProcesses;
+ param[WORKDIR] = remotedir;
+ param[TMPDIR] = remotedir;
+ param[MAXWALLTIME] = getWallTime("");
+ param[MAXRAMSIZE] = getRamSize("");
+ param[HOMEDIR] = "";
+
+ Batch::Environnement env;
+ env["COMMAND"] = _launch.Command;
+ env["SOURCEFILE"] = _launch.MachinesList[clusterName].EnvFile;
+ env["LOGFILE"] = logfile;
+
+ Batch::Job* job = new Batch::Job(param,env);
+
+ // submit job on cluster
+ Batch::JobId jid = _batchmap[cname]->submitJob(*job);
+
+ // get job id in long
+ istringstream iss(jid.getReference());
+ iss >> jobId;
+
+ _jobmap[ pair<string,long>(cname,jobId) ] = job;
+ }
+ catch(const Batch::EmulationException &ex){
+ throw LauncherException(ex.msg.c_str());
+ }
+
+ return jobId;
+}
+
//=============================================================================
/*! CORBA Method:
* Submit a batch job on a cluster and returns the JobId
long jobId;
vector<string> aMachineList;
+ if(!_ResManager)
+ throw LauncherException("You must set Resources Manager to Launcher!!");
+
// check batch params
if ( !check(batch_params) )
throw LauncherException("Batch parameters are bad (see informations above)");
for(int i=0;i<filesToExport.size();i++)
param[INFILE] += Batch::Couple( filesToExport[i], getRemoteFile(tmpdir,filesToExport[i]) );
-
ostringstream file_name_output;
- file_name_output << "~/" << tmpdir << "/" << "runSalome.output.log*";
+ file_name_output << "~/" << tmpdir << "/" << "output.log*";
ostringstream file_name_error;
- file_name_error << "~/" << tmpdir << "/" << "runSalome.error.log*";
+ file_name_error << "~/" << tmpdir << "/" << "error.log*";
ostringstream file_container_log;
file_container_log << "~/" << tmpdir << "/" << "YACS_Server*";
param[OUTFILE] = Batch::Couple( "", file_name_output.str());
param[MAXWALLTIME] = getWallTime(batch_params.expected_during_time);
param[MAXRAMSIZE] = getRamSize(batch_params.mem);
param[HOMEDIR] = getHomeDir(p, tmpdir);
+ param[QUEUE] = p.batchQueue;
Batch::Environnement env;
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-string Launcher_cpp::querySalomeJob( long id,
- const machineParams& params) throw(LauncherException)
+string Launcher_cpp::queryJob( long id,
+ const machineParams& params) throw(LauncherException)
{
+ if(!_ResManager)
+ throw LauncherException("You must set Resources Manager to Launcher!!");
+
// find a cluster matching params structure
vector<string> aCompoList ;
vector<string> aMachineList = _ResManager->GetFittingResources( params , aCompoList ) ;
if(it == _batchmap.end())
throw LauncherException("no batchmanager for that cluster");
- ostringstream oss;
- oss << id;
- Batch::JobId jobId( _batchmap[clustername], oss.str() );
+ Batch::Parametre par;
+ try{
+ ostringstream oss;
+ oss << id;
+ Batch::JobId jobId( _batchmap[clustername], oss.str() );
+
+ Batch::JobInfo jinfo = jobId.queryJob();
+ par = jinfo.getParametre();
+ }
+ catch(const Batch::EmulationException &ex){
+ throw LauncherException(ex.msg.c_str());
+ }
- Batch::JobInfo jinfo = jobId.queryJob();
- Batch::Parametre par = jinfo.getParametre();
return par[STATE];
}
+string Launcher_cpp::queryJob( long id,
+ const std::string clusterName)
+{
+ machineParams params;
+ params.hostname = clusterName;
+ return queryJob(id,params);
+}
+
//=============================================================================
/*! CORBA Method:
* Delete a batch job on a cluster
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-void Launcher_cpp::deleteSalomeJob( const long id,
- const machineParams& params) throw(LauncherException)
+void Launcher_cpp::deleteJob( const long id,
+ const machineParams& params) throw(LauncherException)
{
+ if(!_ResManager)
+ throw LauncherException("You must set Resources Manager to Launcher!!");
+
// find a cluster matching params structure
vector<string> aCompoList ;
vector<string> aMachineList = _ResManager->GetFittingResources( params , aCompoList ) ;
jobId.deleteJob();
}
+void Launcher_cpp::deleteJob( long id,
+ const std::string clusterName)
+{
+ machineParams params;
+ params.hostname = clusterName;
+ deleteJob(id,params);
+}
+
//=============================================================================
/*! CORBA Method:
* Get result files of job on a cluster
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-void Launcher_cpp::getResultSalomeJob( const string directory,
- const long id,
- const machineParams& params) throw(LauncherException)
+void Launcher_cpp::getResultsJob( const string directory,
+ const long id,
+ const machineParams& params) throw(LauncherException)
{
+ if(!_ResManager)
+ throw LauncherException("You must set Resources Manager to Launcher!!");
+
vector<string> aCompoList ;
vector<string> aMachineList = _ResManager->GetFittingResources( params , aCompoList ) ;
ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]);
_batchmap[clustername]->importOutputFiles( *job, directory );
}
+void Launcher_cpp::getResultsJob( const std::string directory,
+ long id,
+ const std::string clusterName)
+{
+ machineParams params;
+ params.hostname = clusterName;
+ getResultsJob(directory,id,params);
+}
+
//=============================================================================
/*!
* Factory to instanciate the good batch manager for choosen cluster.
case slurm:
mpi = "slurm";
break;
+ case prun:
+ mpi = "prun";
+ break;
+ case nompi:
+ throw LauncherException("you must specified an mpi implementation for batch manager");
+ break;
default:
- mpi = "indif";
+ throw LauncherException("unknown mpi implementation");
break;
}
#if defined(_DEBUG_) || defined(_DEBUG)
#endif
fact = new Batch::FactBatchManager_eLSF;
break;
+ case sge:
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cout << "Instantiation of SGE batch manager" << endl;
+#endif
+ fact = new Batch::FactBatchManager_eSGE;
+ break;
default:
#if defined(_DEBUG_) || defined(_DEBUG)
cerr << "BATCH = " << params.Batch << endl;
tempOutputFile << dirForTmpFiles ;
tempOutputFile << ":$PYTHONPATH" << endl ;
+ // Adding user script
+ std::string script = params.userCommands;
+ if (script != "")
+ tempOutputFile << script << endl;
// Test node rank
- tempOutputFile << "if test " ;
+ tempOutputFile << "if test \"" ;
tempOutputFile << mpiImpl->rank() ;
- tempOutputFile << " = 0; then" << endl ;
+ tempOutputFile << "\" = \"0\"; then" << endl ;
// -----------------------------------------------
// Code for rank 0 : launch runAppli and a container
return new MpiImpl_OPENMPI();
case slurm:
return new MpiImpl_SLURM();
- case indif:
- throw LauncherException("you must specify a mpi implementation in CatalogResources.xml file");
+ case prun:
+ return new MpiImpl_PRUN();
+ case nompi:
+ throw LauncherException("you must specify an mpi implementation for batch manager");
default:
ostringstream oss;
oss << mpi << " : not yet implemented";
return 0;
}
-std::string
-Launcher_cpp::getHomeDir(const ParserResourcesType& p, const std::string& tmpdir)
+void Launcher_cpp::ParseXmlFile(string xmlExecuteFile)
{
- std::string home;
- std::string command;
- int idx = tmpdir.find("Batch/");
- std::string filelogtemp = tmpdir.substr(idx+6, tmpdir.length());
- filelogtemp = "/tmp/logs" + filelogtemp + "_home";
-
- if( p.Protocol == rsh )
- command = "rsh ";
- else if( p.Protocol == ssh )
- command = "ssh ";
- else
- throw LauncherException("Unknown protocol");
- if (p.UserName != ""){
- command += p.UserName;
- command += "@";
+ SALOME_Launcher_Handler* handler = new SALOME_Launcher_Handler(_launch);
+
+ const char* aFilePath = xmlExecuteFile.c_str();
+ FILE* aFile = fopen(aFilePath, "r");
+
+ if (aFile != NULL)
+ {
+ xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0);
+
+ if (aDoc != NULL)
+ handler->ProcessXmlDocument(aDoc);
+ else{
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cout << "ResourcesManager_cpp: could not parse file "<< aFilePath << endl;
+#endif
+ }
+
+ // Free the document
+ xmlFreeDoc(aDoc);
+
+ fclose(aFile);
}
- command += p.Alias;
- command += " 'echo $HOME' > ";
- command += filelogtemp;
+ else{
#if defined(_DEBUG_) || defined(_DEBUG)
- std::cerr << command.c_str() << std::endl;
+ cout << "Launcher_cpp: file "<<aFilePath<<" is not readable." << endl;
#endif
- int status = system(command.c_str());
- if(status)
- throw LauncherException("Error of launching home command on remote host");
-
- std::ifstream file_home(filelogtemp.c_str());
- std::getline(file_home, home);
- file_home.close();
- return home;
+ }
+
+ delete handler;
+
+}
+
+std::string Launcher_cpp::getHomeDir(const ParserResourcesType& p, const std::string& tmpdir)
+{
+ std::string home;
+ std::string command;
+ int idx = tmpdir.find("Batch/");
+ std::string filelogtemp = tmpdir.substr(idx+6, tmpdir.length());
+ filelogtemp = "/tmp/logs" + filelogtemp + "_home";
+
+ if( p.Protocol == rsh )
+ command = "rsh ";
+ else if( p.Protocol == ssh )
+ command = "ssh ";
+ else
+ throw LauncherException("Unknown protocol");
+ if (p.UserName != ""){
+ command += p.UserName;
+ command += "@";
+ }
+ command += p.Alias;
+ command += " 'echo $HOME' > ";
+ command += filelogtemp;
+#if defined(_DEBUG_) || defined(_DEBUG)
+ std::cerr << command.c_str() << std::endl;
+#endif
+ int status = system(command.c_str());
+ if(status)
+ throw LauncherException("Error of launching home command on remote host");
+
+ std::ifstream file_home(filelogtemp.c_str());
+ std::getline(file_home, home);
+ file_home.close();
+ return home;
}
#include <SALOME_ResourcesCatalog_Parser.hxx>
#include "ResourcesManager.hxx"
+#include "SALOME_Launcher_Parser.hxx"
#include <string>
#include <vector>
Launcher_cpp();
~Launcher_cpp();
+ long submitJob(const std::string xmlExecuteFile,
+ const std::string clusterName) throw(LauncherException);
+
long submitSalomeJob(const std::string fileToExecute ,
const std::vector<std::string>& filesToExport ,
const std::vector<std::string>& filesToImport ,
const batchParams& batch_params,
const machineParams& params) throw(LauncherException);
- std::string querySalomeJob( const long jobId, const machineParams& params) throw(LauncherException);
- void deleteSalomeJob( const long jobId, const machineParams& params) throw(LauncherException);
- void getResultSalomeJob( const std::string directory, const long jobId, const machineParams& params ) throw(LauncherException);
+ std::string queryJob( const long jobId, const machineParams& params) throw(LauncherException);
+ std::string queryJob( const long jobId, const std::string clusterName);
+ void deleteJob( const long jobId, const machineParams& params) throw(LauncherException);
+ void deleteJob( const long jobId, const std::string clusterName);
+ void getResultsJob( const std::string directory, const long jobId, const machineParams& params ) throw(LauncherException);
+ void getResultsJob( const std::string directory, const long jobId, const std::string clusterName );
void SetResourcesManager( ResourcesManager_cpp* rm ) { _ResManager = rm; }
bool check(const batchParams& batch_params);
long getWallTime(std::string edt);
long getRamSize(std::string mem);
+ void ParseXmlFile(std::string xmlExecuteFile);
+
+ //! will contain the informations on the data type catalog(after parsing)
+ ParserLauncherType _launch;
+
};
#endif
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# SALOME Container : implementation of container and engine for Kernel
-# File : Makefile.am
-# Author : Guillaume Boulant (CSSI)
-# Module : KERNEL
-# $Header$
-#
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
#
#
# header files
salomeinclude_HEADERS = \
- BatchTest.hxx \
- SALOME_Launcher.hxx \
- SALOME_Launcher_defs.hxx \
- Launcher.hxx
+ SALOME_Launcher_Parser.hxx \
+ SALOME_Launcher_Handler.hxx \
+ BatchTest.hxx \
+ SALOME_Launcher_defs.hxx \
+ SALOME_Launcher.hxx \
+ Launcher.hxx
# Scripts to be installed
dist_salomescript_DATA =
# Libraries targets
# ===============================================================
#
-lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la
+if WITHONLYLAUNCHER
+ lib_LTLIBRARIES = libLauncher.la
+else
+ lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la
+endif
libSalomeLauncher_la_SOURCES=\
- BatchTest.cxx \
- SALOME_Launcher.cxx
+ BatchTest.cxx \
+ SALOME_Launcher.cxx
libSalomeLauncher_la_CPPFLAGS =\
$(COMMON_CPPFLAGS)
$(COMMON_LIBS) libLauncher.la
libLauncher_la_SOURCES=\
+ SALOME_Launcher_Parser.cxx \
+ SALOME_Launcher_Handler.cxx \
Launcher.cxx
libLauncher_la_CPPFLAGS =\
- $(COMMON_CPPFLAGS) \
+ -I$(srcdir)/../Batch \
-I$(srcdir)/../ResourcesManager \
@MPI_INCLUDES@ \
@LIBXML_INCLUDES@
libLauncher_la_LIBADD =\
../Batch/libSalomeBatch.la \
- ../ResourcesManager/libResourcesManager.la \
+ ../ResourcesManager/libSalomeResourcesManager.la \
@MPI_LIBS@ \
@LIBXML_LIBS@
# Executables targets
# ===============================================================
#
-bin_PROGRAMS = SALOME_LauncherServer
+if !WITHONLYLAUNCHER
+ bin_PROGRAMS = SALOME_LauncherServer
+endif
SALOME_LauncherServer_SOURCES =\
SALOME_LauncherServer.cxx
}
+//=============================================================================
+/*! CORBA Method:
+ * Submit a batch job on a cluster and returns the JobId
+ * \param xmlExecuteFile : .xml to parse to execute on the batch cluster
+ * \param clusterName : cluster name
+ */
+//=============================================================================
+CORBA::Long SALOME_Launcher::submitJob(const char * xmlExecuteFile,
+ const char * clusterName)
+{
+ CORBA::Long jobId;
+
+ try{
+ jobId = _l.submitJob(xmlExecuteFile,clusterName);
+ }
+ catch(const LauncherException &ex){
+ INFOS(ex.msg.c_str());
+ THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::INTERNAL_ERROR);
+ }
+ return jobId;
+}
+
//=============================================================================
/*! CORBA Method:
* Submit a batch job on a cluster and returns the JobId
rtn = true;
}
}
- catch(const SALOME_Exception &ex){
- INFOS(ex.what());
- THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR);
+ catch(const LauncherException &ex){
+ INFOS(ex.msg.c_str());
+ THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::INTERNAL_ERROR);
}
return rtn;
}
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-char* SALOME_Launcher::querySalomeJob( const CORBA::Long jobId,
- const Engines::MachineParameters& params)
+char* SALOME_Launcher::queryJob( const CORBA::Long jobId,
+ const Engines::MachineParameters& params)
{
string status;
machineParams p;
p.mem_mb = params.mem_mb;
try{
- status = _l.querySalomeJob(jobId,p);
+ status = _l.queryJob(jobId,p);
}
catch(const LauncherException &ex){
- INFOS("Caught exception.");
+ INFOS(ex.msg.c_str());
THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::BAD_PARAM);
}
return CORBA::string_dup(status.c_str());
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-void SALOME_Launcher::deleteSalomeJob( const CORBA::Long jobId,
- const Engines::MachineParameters& params)
+void SALOME_Launcher::deleteJob( const CORBA::Long jobId,
+ const Engines::MachineParameters& params)
{
machineParams p;
p.hostname = params.hostname;
p.mem_mb = params.mem_mb;
try{
- _l.deleteSalomeJob(jobId,p);
+ _l.deleteJob(jobId,p);
}
catch(const LauncherException &ex){
INFOS("Caught exception.");
* \param params : Constraints for the choice of the batch cluster
*/
//=============================================================================
-void SALOME_Launcher::getResultSalomeJob( const char *directory,
- const CORBA::Long jobId,
- const Engines::MachineParameters& params)
+void SALOME_Launcher::getResultsJob( const char *directory,
+ const CORBA::Long jobId,
+ const Engines::MachineParameters& params)
{
machineParams p;
p.hostname = params.hostname;
p.mem_mb = params.mem_mb;
try{
- _l.getResultSalomeJob( directory, jobId, p );
+ _l.getResultsJob( directory, jobId, p );
}
catch(const LauncherException &ex){
INFOS("Caught exception.");
SALOME_Launcher(CORBA::ORB_ptr orb, PortableServer::POA_var poa);
~SALOME_Launcher();
+ CORBA::Long submitJob(const char * xmlExecuteFile,
+ const char * clusterName);
+
CORBA::Long submitSalomeJob(const char * fileToExecute ,
const Engines::FilesList& filesToExport ,
const Engines::FilesList& filesToImport ,
char* querySalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params);
void deleteSalomeJob( CORBA::Long jobId, const Engines::MachineParameters& params);
void getResultSalomeJob( const char * directory, CORBA::Long jobId, const Engines::MachineParameters& params );
+ char* queryJob( CORBA::Long jobId, const Engines::MachineParameters& params);
+ void deleteJob( CORBA::Long jobId, const Engines::MachineParameters& params);
+ void getResultsJob( const char * directory, CORBA::Long jobId, const Engines::MachineParameters& params );
CORBA::Boolean testBatch(const Engines::MachineParameters& params);
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
+// File : SALOME_Laucher_Handler.cxx
+// Author : Bernard Secher
+// Module : SALOME
+// $Header$
+//
+#include "SALOME_Launcher_Handler.hxx"
+#include <iostream>
+#include <map>
+
+using namespace std;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//=============================================================================
+/*!
+ * Constructor
+ * \param listOfResources: map of ParserResourcesType to fill when parsing
+ */
+//=============================================================================
+
+SALOME_Launcher_Handler::SALOME_Launcher_Handler(ParserLauncherType& launch):
+ _launch(launch)
+{
+ //XML tags initialisation
+ test_machine_list = "machine-list";
+ test_main = "main";
+
+ test_machine = "machine";
+ test_env_file = "env-file";
+ test_work_directory = "work-directory";
+ test_ref_directory = "ref-directory";
+ test_nb_processes = "nb-processes";
+ test_input_file = "input-file";
+ test_output_file = "output-file";
+ test_command = "command";
+
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+
+SALOME_Launcher_Handler::~SALOME_Launcher_Handler()
+{
+ // cout << "SALOME_Launcher_Handler destruction") << endl;
+}
+
+//=============================================================================
+/*!
+ * Retrieves DS after the file parse.
+ */
+//=============================================================================
+
+const ParserLauncherType&
+SALOME_Launcher_Handler::GetLauncherAfterParsing() const
+{
+ return _launch;
+}
+
+//=============================================================================
+/*!
+ * Processes XML document and fills the list of resources
+ */
+//=============================================================================
+
+void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
+{
+// if (MYDEBUG) cout << "Begin parse document" << endl;
+
+ // Empty private elements
+ _launch.Clear();
+
+ // Get the document root node
+ xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc);
+
+ aCurNode = aCurNode->xmlChildrenNode;
+
+ // Processing the document nodes
+ while(aCurNode != NULL){
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){
+ xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode;
+ while(aCurNode2 != NULL){
+ if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
+ _machp.Clear();
+ xmlChar* name = xmlNodeGetContent(aCurNode2);
+ string clusterName = (const char*)name;
+ xmlFree(name);
+
+ if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
+ xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
+ _machp.EnvFile = (const char*)envfile;
+ xmlFree(envfile);
+ }
+
+ if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
+ xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
+ _machp.WorkDirectory = (const char*)workdirectory;
+ xmlFree(workdirectory);
+ }
+ _launch.MachinesList[clusterName]=_machp ;
+ }
+ aCurNode2 = aCurNode2->next;
+ }
+ }
+
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_ref_directory) ){
+ xmlChar* refdirectory = xmlNodeGetContent(aCurNode);
+ _launch.RefDirectory = (const char*)refdirectory;
+ xmlFree(refdirectory);
+ }
+
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){
+ xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode);
+ _launch.NbOfProcesses = atoi((const char*)nbofprocesses);
+ xmlFree(nbofprocesses);
+ }
+
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){
+ xmlChar* inputfile = xmlNodeGetContent(aCurNode);
+ _launch.InputFile.push_back((const char*)inputfile);
+ xmlFree(inputfile);
+ }
+
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){
+ xmlChar* outputfile = xmlNodeGetContent(aCurNode);
+ _launch.OutputFile.push_back((const char*)outputfile);
+ xmlFree(outputfile);
+ }
+
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){
+ xmlChar* command = xmlNodeGetContent(aCurNode);
+ _launch.Command = (const char*)command;
+ xmlFree(command);
+ }
+
+ aCurNode = aCurNode->next;
+ }
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
+// File : SALOME_Launcher_Handler.hxx
+// Author : Bernard SECHER
+// Module : SALOME
+//$Header$
+//
+#ifndef SALOME_LAUNCHER_HANDLER
+#define SALOME_LAUNCHER_HANDLER
+
+#include "SALOME_Launcher_Parser.hxx"
+
+#include <string>
+#include <vector>
+
+#include <libxml/parser.h>
+
+class SALOME_Launcher_Handler
+{
+
+public :
+ SALOME_Launcher_Handler(ParserLauncherType& launch);
+
+ virtual ~SALOME_Launcher_Handler();
+
+ const ParserLauncherType& GetLauncherAfterParsing() const;
+
+ void ProcessXmlDocument(xmlDocPtr theDoc);
+
+private :
+ ParserLauncherType& _launch;
+ MachineParameters _machp;
+
+ const char *test_machine_list;
+ const char *test_main;
+
+ const char *test_machine;
+ const char *test_env_file;
+ const char *test_work_directory;
+ const char *test_ref_directory;
+ const char *test_nb_processes;
+ const char *test_input_file;
+ const char *test_output_file;
+ const char *test_command;
+
+};
+
+#endif // SALOME_LAUNCHER_HANDLER
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+#include "SALOME_Launcher_Parser.hxx"
+#include <iostream>
+#include <sstream>
+
+#define NULL_VALUE 0
+
+using namespace std;
+
+void MachineParameters::Clear()
+{
+ EnvFile = "";
+ WorkDirectory = "";
+}
+
+void MachineParameters::Print() const
+{
+ ostringstream oss;
+ oss << " EnvFile: " << EnvFile
+ << " WorkDirectory: " << WorkDirectory << endl;
+
+ cout << oss.str();
+}
+
+void ParserLauncherType::Print() const
+{
+ ostringstream oss;
+ oss << endl <<
+ "RefDirectory: " << RefDirectory << endl <<
+ "NbOfProcesses: " << NbOfProcesses << endl <<
+ "InputFile: ";
+ for(int i=0; i <InputFile.size();i++)
+ oss << InputFile[i] << " ";
+ oss << endl << "OutputFile: ";
+ for(int i=0; i <OutputFile.size();i++)
+ oss << OutputFile[i] << " ";
+ oss << endl <<
+ "Command: " << Command << endl <<
+ "Machines: " << endl;
+
+ cout << oss.str();
+
+ std::map < string, MachineParameters >::const_iterator it;
+ for(it=MachinesList.begin();it!=MachinesList.end();it++){
+ cout << " " << it->first;
+ it->second.Print();
+ }
+
+}
+
+void ParserLauncherType::Clear()
+{
+ MachinesList.clear();
+ RefDirectory = "";
+ NbOfProcesses = 1;
+ InputFile.clear();
+ OutputFile.clear();
+ Command = "";
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
+// File : SALOME_Launcher_Parser.hxx
+// Author : Bernard Secher
+// Module : SALOME
+//$Header$
+//
+#ifndef SALOME_LAUNCHER_PARSER
+#define SALOME_LAUNCHER_PARSER
+
+#include <string>
+#include <vector>
+#include <map>
+#include <iostream>
+
+struct MachineParameters
+ {
+ std::string EnvFile;
+ std::string WorkDirectory;
+ void Print() const;
+ void Clear();
+ };
+
+struct ParserLauncherType
+ {
+ std::map<std::string,MachineParameters> MachinesList;
+ std::string RefDirectory;
+ long NbOfProcesses;
+ std::vector<std::string> InputFile;
+ std::vector<std::string> OutputFile;
+ std::string Command;
+
+ void Print() const;
+ void Clear();
+ };
+
+#endif //SALOME_LAUNCHER_PARSER
../Registry/libRegistry.la \
../Notification/libSalomeNotification.la \
../Container/libSalomeContainer.la \
- ../HDFPersist/libSalomeHDFPersist.la \
$(COMMON_LIBS) \
@CORBA_LIBS@
../Registry/libRegistry.la \
../Notification/libSalomeNotification.la \
../Container/libSalomeContainer.la \
- ../HDFPersist/libSalomeHDFPersist.la \
- ../HDFPersist/libSalomeHDFPersist.la \
$(COMMON_LIBS) \
@CORBA_LIBS@
$(RPATH)/Utils/Test/libUtilsTest.la $(RPATH)/Utils/libOpUtil.la \
$(RPATH)/SALOMELocalTrace/Test/libSALOMELocalTraceTest.la $(RPATH)/SALOMELocalTrace/libSALOMELocalTrace.la \
$(RPATH)/SALOMETraceCollector/Test/libSALOMETraceCollectorTest.la \
- $(RPATH)/HDFPersist/libSalomeHDFPersist.la \
$(top_builddir)/idl/libSalomeIDLKernel.la
#
# The library will be installed in the same place.
#
+BUILT_SOURCES = swig_wrap.cpp
+
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../LifeCycleCORBA -I$(srcdir)/../Utils
SWIG_SOURCES = libSALOME_LifeCycleCORBA.i
-nodist_salomepython_PYTHON = libSALOME_LifeCycleCORBA.py
+salomepython_PYTHON = libSALOME_LifeCycleCORBA.py
salomepyexec_LTLIBRARIES = _libSALOME_LifeCycleCORBA.la
-nodist__libSALOME_LifeCycleCORBA_la_SOURCES = swig_wrap.cpp
-_libSALOME_LifeCycleCORBA_la_SOURCES = $(SWIG_SOURCES)
+_libSALOME_LifeCycleCORBA_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libSALOME_LifeCycleCORBA_la_CPPFLAGS =\
@PYTHON_INCLUDES@ \
-I$(srcdir) \
swig_wrap.cpp : $(SWIG_SOURCES)
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-CLEANFILES = swig_wrap.cpp libSALOME_LifeCycleCORBA.py
+CLEANFILES = swig_wrap.cpp
#
//
%module libSALOME_LifeCycleCORBA
+%feature("autodoc", "1");
+
%include <std_except.i>
#include "SALOME_NamingService.hxx"
#include "ServiceUnreachable.hxx"
#include "Utils_SALOME_Exception.hxx"
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
using namespace std;
$result = PyString_FromString($1.c_str());
}
-%typemap(typecheck) const Engines::MachineParameters &,
- Engines::MachineParameters const &
+%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Engines::MachineParameters const &
+{
+ $1 = PyDict_Check($input)? 1 : 0;
+}
+%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) const Engines::MachineParameters &
{
- $1 = PyDict_Check($input);
+ $1 = PyDict_Check($input)? 1 : 0;
}
%typemap(typecheck) std::string,
SALOME_Logger_Server_CPPFLAGS =\
-I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl \
- -I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../Basics \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
# Libraries targets
#define SALOME_Logger_Server_include
#include <SALOMEconfig.h>
-
#include <fstream>
+
#ifdef WIN32
#include <iosfwd>
#endif
bool m_putIntoFile;
//ofstream class specialized for disk file output
std::ofstream m_outputFile;
+
//synchronisation object
static omni_mutex myLock;
+
CORBA::ORB_ptr _orb;
};
// Module : SALOME
//
#include <iostream>
-#include <stdlib.h>
#include "SALOME_Logger_Server.hxx"
#include <SALOMEconfig.h>
#include <sys/types.h>
+#include <stdlib.h>
+
#ifndef WIN32
# include <unistd.h>
#else
#include <iostream.h>
#include <dlfcn.h>
#include <stdio.h>
+#include "Basics_Utils.hxx"
#include "SALOME_Component_i.hxx"
#include "MPIContainer_i.hxx"
#include "SALOME_NamingService.hxx"
# check_cppunit for example with CPPUNIT_IS_OK.
#
+if WITHONLYLAUNCHER
+ SUBDIRS = Batch Batch_SWIG ResourcesManager Launcher
+else
+
SUBDIRS = $(SUBDIR_BASE)
if WITH_BATCH
SUBDIRS += $(SUBDIR_CORBA)
endif
-#if MPI_IS_OK
-# SUBDIRS += $(SUBDIR_MPI)
-#endif
+if MPI_IS_OK
+ SUBDIRS += $(SUBDIR_MPI)
+endif
if CPPUNIT_IS_OK
if CORBA_GEN
endif
endif
if WITH_PACO_PARALLEL
-SUBDIRS += $(SUBDIR_PARALLEL)
+ SUBDIRS += $(SUBDIR_PARALLEL)
endif
+endif
EXTRA_DIST = win32pm
// duplicate service by default
S_out.Servicebydefault = S_in.Servicebydefault;
- unsigned int _length, ind2;
+ unsigned int _length;
// duplicate in Parameters
_length = S_in.ServiceinParameter.length();
S_out.ServiceinParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinParameter[ind2],
S_in.ServiceinParameter[ind2]);
_length = S_in.ServiceoutParameter.length();
S_out.ServiceoutParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutParameter[ind2],
S_in.ServiceoutParameter[ind2]);
_length = S_in.ServiceinDataStreamParameter.length();
S_out.ServiceinDataStreamParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinDataStreamParameter[ind2],
S_in.ServiceinDataStreamParameter[ind2]);
if(MYDEBUG) SCRUTE(_length);
S_out.ServiceoutDataStreamParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutDataStreamParameter[ind2],
S_in.ServiceoutDataStreamParameter[ind2]);
}
SALOME_ModuleCatalog::ListOfComponents_var list_composants
= Catalogue->GetComponentList();
- unsigned int ind;
+
// Typed component list
MESSAGE("Get Typed Component list (GEOM Type)");
SALOME_ModuleCatalog::ListOfComponents_var list_typed_composants
= Catalogue->GetTypedComponentList(SALOME_ModuleCatalog::GEOM);
- for (ind = 0; ind < list_typed_composants->length();ind++)
+ for (unsigned int ind = 0; ind < list_typed_composants->length();ind++)
MESSAGE("Component GEOM list : " << list_typed_composants[ind]);
MESSAGE("Get Typed Component list (SUPERV Type)");
list_typed_composants
= Catalogue->GetTypedComponentList(SALOME_ModuleCatalog::SUPERV);
- for (ind = 0; ind < list_typed_composants->length();ind++)
+ for (unsigned int ind = 0; ind < list_typed_composants->length();ind++)
MESSAGE("Component SUPERV list : " << list_typed_composants[ind]);
// Get list of couple (component name, component icone)
SALOME_ModuleCatalog::ListOfIAPP_Affich_var list_composants_icone
= Catalogue->GetComponentIconeList();
- for (ind = 0; ind < list_composants_icone->length();ind++)
+ for (unsigned int ind = 0; ind < list_composants_icone->length();ind++)
{
MESSAGE("Component name: " << list_composants_icone[ind].modulename);
MESSAGE("Component icone: " << list_composants_icone[ind].moduleicone);
_typeList.push_back(aType);
}
else
- MESSAGE ( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." );
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
}
else
- MESSAGE ( "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." );
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." << std::endl;
}
else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"sequence" ))
{
_typeList.push_back(aType);
}
else
- MESSAGE ( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." );
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
}
else
{
- MESSAGE ( "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." );
+ std::cerr << "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." << std::endl;
}
}
else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"objref" ))
}
else
{
- MESSAGE ( "Warning: this objref type (" << aType.name << ") has unknown base type (" << base << "), it will be ignored." );
+ std::cerr << "Warning: this objref type (" << aType.name << ") has unknown base type (" << base << "), it will be ignored." << std::endl;
error=1;
break;
}
_typeList.push_back(aType);
}
else
- MESSAGE ( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." );
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
}
}
else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"struct" ))
}
else
{
- MESSAGE ( "Warning: this struct type (" << aType.name << ") has unknown member type (" << member.first << "," << member.second << "), it will be ignored." );
+ std::cerr << "Warning: this struct type (" << aType.name << ") has unknown member type (" << member.first << "," << member.second << "), it will be ignored." << std::endl;
error=1;
break;
}
_typeList.push_back(aType);
}
else
- MESSAGE ( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." );
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
}
} // end of struct
aTypeNode = aTypeNode->next;
timer.ShowAbsolute();
#endif
orb->run();
- MESSAGE ( "server returned from orb->run()" );
+ std::cerr << "server returned from orb->run()" << std::endl;
orb->destroy();
// mgr->deactivate(true,true);
char* _path = NULL;
bool _find = false ;
- unsigned int ind, ind1;
-
// Parse all the path prefixes
// looking for the wanted computer
- for (ind = 0 ; ind < _personal_path_list.size() ; ind++)
+ for (unsigned int ind = 0 ; ind < _personal_path_list.size() ; ind++)
{
- for (ind1 = 0 ; ind1 < _personal_path_list[ind].listOfComputer.size() ; ind1++)
+ for (unsigned int ind1 = 0 ; ind1 < _personal_path_list[ind].listOfComputer.size() ; ind1++)
{
if (strcmp(machinename, _personal_path_list[ind].listOfComputer[ind1].c_str()) == 0)
{
if (!_find)
{
- for (ind = 0 ; ind < _general_path_list.size() ; ind++)
+ for (unsigned int ind = 0 ; ind < _general_path_list.size() ; ind++)
{
- for (ind1 = 0 ; ind1 < _general_path_list[ind].listOfComputer.size() ; ind1++)
+ for (unsigned int ind1 = 0 ; ind1 < _general_path_list[ind].listOfComputer.size() ; ind1++)
{
if (strcmp(machinename, _general_path_list[ind].listOfComputer[ind1].c_str()) == 0)
{
_list_components->length(_personal_module_list.size());
- unsigned int ind;
-
// All the components defined in the personal catalog are taken
- for(ind=0; ind < _personal_module_list.size();ind++){
+ for(unsigned int ind=0; ind < _personal_module_list.size();ind++){
_list_components[ind]=(_personal_module_list[ind].name).c_str();
if(MYDEBUG) SCRUTE(_list_components[ind]) ;
}
// The components in the general catalog are taken only if they're
// not defined in the personal catalog
- for(ind=0; ind < _general_module_list.size();ind++){
+ for(unsigned int ind=0; ind < _general_module_list.size();ind++){
_find = false;
for(unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++){
// searching if the component is already defined in
_list_components_icone->length(_personal_module_list.size());
- unsigned int ind;
-
// All the components defined in the personal catalog are taken
- for(ind=0; ind < _personal_module_list.size();ind++){
+ for(unsigned int ind=0; ind < _personal_module_list.size();ind++){
_list_components_icone[ind].modulename=(_personal_module_list[ind].name).c_str();
_list_components_icone[ind].moduleusername=(_personal_module_list[ind].username).c_str();
_list_components_icone[ind].moduleicone=(_personal_module_list[ind].icon).c_str();
// The components in the general catalog are taken only if they're
// not defined in the personal catalog
- for(ind=0; ind < _general_module_list.size();ind++){
+ for(unsigned int ind=0; ind < _general_module_list.size();ind++){
_find = false;
for(unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++){
// searching if the component is aleready defined in
break;
}
- unsigned int ind;
-
// All the components in the personal catalog are taken
- for (ind=0; ind < _personal_module_list.size();ind++)
+ for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
{
if (_personal_module_list[ind].type == _temp_component_type)
{
// The components in the general catalog are taken only if they're
// not defined in the personal catalog
- for (ind=0; ind < _general_module_list.size();ind++)
+ for (unsigned int ind=0; ind < _general_module_list.size();ind++)
{
_find = false;
{
ParserComponent * C_parser = NULL;
- unsigned int ind;
-
if (!C_parser)
- for (ind=0; ind < _personal_module_list.size();ind++)
+ for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
{
if (name.compare(_personal_module_list[ind].name) == 0)
{
}
if (!C_parser)
- for (ind=0; ind < _general_module_list.size();ind++)
+ for (unsigned int ind=0; ind < _general_module_list.size();ind++)
{
if (name.compare(_general_module_list[ind].name) == 0)
{
S_corba.TypeOfNode = S_parser.typeOfNode;
- unsigned int _length, ind2;
+ unsigned int _length;
// duplicate in Parameters
_length = S_parser.inParameters.size();
S_corba.ServiceinParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceinParameter[ind2],
S_parser.inParameters[ind2]);
_length = S_parser.outParameters.size();
S_corba.ServiceoutParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceoutParameter[ind2],
S_parser.outParameters[ind2]);
_length = S_parser.inDataStreamParameters.size();
S_corba.ServiceinDataStreamParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceinDataStreamParameter[ind2],
S_parser.inDataStreamParameters[ind2]);
// if(MYDEBUG) SCRUTE(_length);
S_corba.ServiceoutDataStreamParameter.length(_length);
- for (ind2 = 0; ind2 < _length ; ind2 ++)
+ for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceoutDataStreamParameter[ind2],
S_parser.outDataStreamParameters[ind2]);
}
bool _return_value = true;
vector<string> _machine_list;
- unsigned int ind, ind1;
-
// Fill a list of all computers indicated in the path list
- for (ind = 0; ind < pathList.size(); ind++)
+ for (unsigned int ind = 0; ind < pathList.size(); ind++)
{
- for (ind1 = 0 ; ind1 < pathList[ind].listOfComputer.size(); ind1++)
+ for (unsigned int ind1 = 0 ; ind1 < pathList[ind].listOfComputer.size(); ind1++)
{
_machine_list.push_back(pathList[ind].listOfComputer[ind1]);
}
}
// Parse if a computer name is twice in the list of computers
- for (ind = 0; ind < _machine_list.size(); ind++)
+ for (unsigned int ind = 0; ind < _machine_list.size(); ind++)
{
- for (ind1 = ind+1 ; ind1 < _machine_list.size(); ind1++)
+ for (unsigned int ind1 = ind+1 ; ind1 < _machine_list.size(); ind1++)
{
if(_machine_list[ind].compare(_machine_list[ind1]) == 0)
{
self.parent = None
self.childs = []
self.comments = []
+ self.attrs={}
def addChild(self, tree):
if tree is not None:
d = depth
if self.name != '':
s = string.ljust('', 4*depth)
- s += '<' + self.name + '>'
+ s += '<' + self.name
+ for k,v in self.attrs.items():
+ s += ' ' + k + '="' + v + '"'
+ s += '>'
if self.content != '':
s += self.content
else:
L_merge.addChild(i_ext)
self.replaceChild(L_merge)
+
+ def setAttrib(self, name,value):
+ self.attrs[name]=value
parser.parse(filename)
else:
t = self.addNamedChild('begin-catalog')
+ t.addNamedChild('type-list')
t.addNamedChild('component-list')
n = self.getChild('begin-catalog')
return
if n.getChild('path-prefix-list') is None:
n.insertFirstNamedChild('path-prefix-list')
+ if n.getChild('type-list') is None:
+ p=n.childs.index(n.getChild('path-prefix-list'))
+ n.childs.insert(p+1,Tree('type-list'))
if n.getChild('component-list') is None:
n.addNamedChild('component-list')
e = p.addChild(parameter(mode='in'))
elif name == 'outParameter':
e = p.addChild(parameter(mode='out'))
+ elif name == 'sequence':
+ e = p.addChild(SeqType(attrs["name"],attrs["content"]))
+ elif name == 'objref':
+ e = p.addChild(ObjType(attrs["name"]))
+ elif name == 'struct':
+ e = p.addChild(StructType(attrs["name"]))
+ elif name == 'type':
+ e = p.addChild(Type(attrs["name"],attrs["kind"]))
+ elif name == 'member':
+ e = p.addChild(Member(attrs["name"],attrs["type"]))
else:
e = p.addNamedChild(name)
self.list.append(e)
print ' replace component', i_ext.getChild('component-name').content
i_int.merge(i_ext)
-
-
+ def mergeType(self, type):
+ L_int = self.getNode('type-list')
+ if L_int is None:
+ error("Catalog.mergeType : 'type-list' is not found")
+ return
+ for t in L_int.childs:
+ if t.attrs["name"] == type.attrs["name"]:
+ t.merge(type)
+ return
+
+ L_int.addChild(type)
+
+class Member(Tree):
+ def __init__(self, name,type):
+ Tree.__init__(self, 'member')
+ self.setAttrib("name",name)
+ self.setAttrib("type",type)
+
+class Type(Tree):
+ def __init__(self, name,kind):
+ Tree.__init__(self, 'type')
+ self.setAttrib("name",name)
+ self.setAttrib("kind",kind)
+
+ def merge(self,t):
+ self.setAttrib("kind",t.attrs["kind"])
+
+class SeqType(Tree):
+ def __init__(self, name,content):
+ Tree.__init__(self, 'sequence')
+ self.setAttrib("name",name)
+ self.setAttrib("content",content)
+
+ def merge(self,t):
+ self.setAttrib("content",t.attrs["content"])
+
+class StructType(Tree):
+ def __init__(self, name):
+ Tree.__init__(self, 'struct')
+ self.setAttrib("name",name)
+
+ def merge(self,t):
+ #remove childs and replace by t childs
+ self.childs=[]
+ for c in t.childs:
+ self.childs.append(c)
+
+class ObjType(Tree):
+ def __init__(self, name):
+ Tree.__init__(self, 'objref')
+ self.setAttrib("name",name)
+
+ def merge(self,t):
+ RepoId=t.attrs.get("id")
+ if RepoId:
+ self.setAttrib("id",RepoId)
+ #remove childs and replace by t childs
+ self.childs=[]
+ for c in t.childs:
+ self.childs.append(c)
# IDL file reader
def __init__(self, catalog):
self.catalog = catalog
self.EngineType = 0
+ self.currentScope=None
def visitAST(self, node):
for n in node.declarations():
- n.accept(self)
+ if n.mainFile():
+ n.accept(self)
def visitModule(self, node):
+ self.currentScope=node
for n in node.definitions():
n.accept(self)
def visitInterface(self, node):
-
if node.mainFile():
self.EngineType = 0
for i in node.inherits():
s = i.scopedName();
- if ((s[0] == "Engines") & (s[1] == "Component")):
+ if s[0] == "Engines":
+ if s[1] == "Component":
self.EngineType = 1; break
+ if s[1] == "Superv_Component":
+ self.EngineType = 2; break
- Comp = Component(node.identifier())
+ if self.EngineType:
+ #This interface is a SALOME component
+ Comp = Component(node.identifier())
- self.currentInterface = Comp.createInterface(node.identifier())
+ self.currentInterface = Comp.createInterface(node.identifier())
- for c in node.callables():
+ for c in node.callables():
if isinstance(c, idlast.Operation):
c.accept(self)
- for c in node.declarations():
+ for c in node.declarations():
if isinstance(c, idlast.Struct):
c.accept(self)
- for i in node.comments():
+ for i in node.comments():
self.currentInterface.comments.append(str(i))
- self.currentInterface.processDataStreams()
+ if self.EngineType == 2:
+ self.currentInterface.processDataStreams()
- if (self.EngineType):
- global nb_components
- nb_components = nb_components + 1
- self.catalog.mergeComponent(Comp)
+ global nb_components
+ nb_components = nb_components + 1
+ self.catalog.mergeComponent(Comp)
+
+ else:
+ #This interface is not a component : use it as a DataType
+ t=ObjType("/".join(node.scopedName()))
+ for i in node.inherits():
+ t.addNamedChild("base","/".join(i.scopedName()))
+ self.catalog.mergeType(t)
self.EngineType = 0
def visitDeclaredType(self, type):
- self.currentType = type.name()
+ name=type.name()
+ scoped_name="/".join(type.scopedName())
+ self.currentType = scoped_name
def visitBaseType(self, type):
self.currentType = ttsMap[type.kind()]
self.currentService.createOutParameter \
(node.identifier(), self.currentType)
+ def visitSequenceType(self,type):
+ type.seqType().accept(self)
+ if type.bound() == 0:
+ self.contentType=self.currentType
+ self.currentType = "sequence"
+ else:
+ self.currentType = None
+
+ def visitTypedef(self, node):
+ if node.constrType():
+ node.aliasType().decl().accept(self)
+
+ node.aliasType().accept(self)
+ type = self.currentType
+ if not type:
+ return
+ decll = []
+ for d in node.declarators():
+ d.accept(self)
+ if self.__result_declarator:
+ decll.append(self.__result_declarator)
+ if type == "sequence":
+ #it's a sequence type
+ for name in decll:
+ scoped_name="/".join(self.currentScope.scopedName()+[name])
+ self.catalog.mergeType(SeqType(scoped_name,self.contentType))
+ #else:
+ #it's an alias
+ # for name in decll:
+ # scoped_name="/".join(self.currentScope.scopedName()+[name])
+ # self.catalog.mergeType(Type(scoped_name,type))
+
+ def visitStruct(self, node):
+ t=StructType("/".join(node.scopedName()))
+ for m in node.members():
+ if m.constrType():
+ m.memberType().decl().accept(self)
+
+ m.memberType().accept(self)
+ type = self.currentType
+ for d in m.declarators():
+ d.accept(self)
+ t.addChild(Member(self.__result_declarator,type))
+
+ self.catalog.mergeType(t)
+
+ def visitDeclarator(self, node):
+ if node.sizes():
+ self.__result_declarator =None
+ else:
+ self.__result_declarator =node.identifier()
+
#--------------------------------------------------
# parse idl and store xml file
#--------------------------------------------------
+Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+
+Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+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
+______________________________________________________________________
+
+
Outil de generation du catalogue de module
a partir des fichiers idl corba.
version 0.1 (12/4/2002)
export ROOT_SRCDIR
ROOT_BUILDDIR=@ROOT_BUILDDIR@
export ROOT_BUILDDIR
-SRCDIR=${ROOT_SRCDIR}/SALOME/src/ModuleGenerator
+SRCDIR=${ROOT_SRCDIR}/src/ModuleGenerator
export SRCDIR
${SRCDIR}/tests/test$1.sh
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : AddComponent.idl
+// Author : Jean Rahuel
+//
+#ifndef _ADDCOMPONENT_IDL
+#define _ADDCOMPONENT_IDL
+
+#include "SALOME_Component.idl"
+
+module SuperVisionTest {
+
+ interface Adder ;
+
+ interface AddComponent : Engines::Component {
+ double Add( in double x , in double y , out double z ) ;
+ double AddWithoutSleep( in double x , in double y , out double z ) ;
+ void Setx( in double x ) ;
+ void Sety( in double y ) ;
+ double Addxy() ;
+ double AddyTox( in double y ) ;
+ long Sigma( in long n ) ;
+ double LastResult() ;
+
+ Adder Addition() ;
+ boolean AdditionObjRef1( out Adder anAdder ) ;
+ void AdditionObjRef2( out boolean FuncValue , out Adder anAdder ) ;
+ boolean AdditionObjRefs( in AddComponent AddComponent1 ,
+ in AddComponent Adder2 ,
+ in AddComponent Adder3 ,
+ out AddComponent RetAddComponent1 ,
+ out AddComponent RetAdder2 ,
+ out AddComponent RetAdder3 ) ;
+ };
+
+ interface Adder : Engines::Component {
+ double Add( in double x , in double y , out double z ) ;
+ double AddWithoutSleep( in double x , in double y , out double z ) ;
+ double AddAndCompare( in double x , in double y , in Adder anOtherAdder,
+ out double z ) ;
+ void SetLastResult( in double z ) ;
+ void LastResult( out double z ) ;
+ Engines::Component LccAddComponent( in string aContainer ,
+ in string aComponentName ) ;
+ };
+
+} ;
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// File : SubComponent.idl
+// Author : Jean Rahuel
+//
+#ifndef _SUBCOMPONENT_IDL
+#define _SUBCOMPONENT_IDL
+
+#include "SALOME_Component.idl"
+
+module SuperVisionTest {
+
+ interface SubComponent : Engines::Component {
+ void Sub( in double x , in double y , out double z ) ;
+ } ;
+};
+
+
+#endif
\rm -f my_catalog.xml*
-${ROOT_BUILDDIR}/bin/runIDLparser \
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
-Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+ ${SRCDIR}/tests/AddComponent.idl
# File : test1b.sh
# Module : SALOME
#
-echo "test6:
+echo "test1b:
test derivation Engine::Component
"
--> creation d'un nouveau catalogue avec un composant
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml \
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml \
${SRCDIR}/tests/TrucComponent.idl
--> creation d'un nouveau catalogue avec un composant
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
-Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+ ${SRCDIR}/tests/AddComponent.idl
echo "
--> ajout d'un nouveau composant dans le catalogue
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
-Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/SubComponent.idl
+ ${SRCDIR}/tests/SubComponent.idl
echo "
--> remplacement du premier composant dans le catalogue
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
-Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+ ${SRCDIR}/tests/AddComponent.idl
--> creation d'un nouveau catalogue avec un composant
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml \
+ ${SRCDIR}/tests/AddComponent.idl
+
echo "
--> remplacement du composant dans le catalogue (meme idl)
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml \
+ ${SRCDIR}/tests/AddComponent.idl
--> creation d'un nouveau catalogue avec un composant
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml \
- ${ROOT_SRCDIR}/idl/AddComponent.idl
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml \
+ ${SRCDIR}/tests/AddComponent.idl
mv my_catalog.xml C1
--> remplacement du composant dans le catalogue (autre idl)
"
-${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml \
- ${SRCDIR}/tests/Truc2Component.idl
+sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml \
+ ${SRCDIR}/tests/Truc2Component.idl
# File : test5.sh
# Module : SALOME
#
-echo "test4:
+echo "test5:
creation d'un catalogue avec tous les idl de Salome
(au 29/3/2002)
echo
echo " processing " `basename $i`
echo
- ${ROOT_BUILDDIR}/bin/runIDLparser \
- -Wbcatalog=my_catalog.xml $i
+ sh ${ROOT_BUILDDIR}/bin/runIDLparser -p ${SRCDIR} \
+ -I${ROOT_SRCDIR}/idl \
+ -Wbcatalog=my_catalog.xml $i
done
# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
# see also LifeCycleCORBA_SWIG
#
+BUILT_SOURCES = swig_wrap.cpp
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Notification
SWIG_SOURCES = NOTIFICATION.i
-nodist_salomepython_PYTHON = libNOTIFICATION.py
+salomepython_PYTHON = libNOTIFICATION.py
salomepyexec_LTLIBRARIES = _libNOTIFICATION.la
-nodist__libNOTIFICATION_la_SOURCES = swig_wrap.cpp
-_libNOTIFICATION_la_SOURCES = $(SWIG_SOURCES) \
+_libNOTIFICATION_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES) \
NOTIFICATION_Swig.cxx NOTIFICATION_Swig.hxx SALOME_NOTIFICATION_SWIG.hxx
_libNOTIFICATION_la_CPPFLAGS =\
@PYTHON_INCLUDES@ -DHAVE_CONFIG_H \
- -I$(srcdir) \
-I$(srcdir)/../Notification \
-I$(srcdir)/../Basics \
-I$(srcdir)/../SALOMELocalTrace \
_libNOTIFICATION_la_LDFLAGS = -module
-_libNOTIFICATION_la_LIBADD = @PYTHON_LIBS@ ../Notification/libSalomeNotification.la
+_libNOTIFICATION_la_LIBADD = ../Notification/libSalomeNotification.la
swig_wrap.cpp : $(SWIG_SOURCES)
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-CLEANFILES = swig_wrap.cpp libNOTIFICATION.py
+CLEANFILES = swig_wrap.cpp
//
%module libNOTIFICATION
+%feature("autodoc", "1");
%{
//#define __declspec(a)
#include "SALOME_ParallelComponent_i.hxx"
#include "SALOME_ParallelContainer_i.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
#include <stdio.h>
#ifndef WIN32
#include <dlfcn.h>
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
using namespace std;
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
using namespace std;
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
#ifdef DEBUG_PARALLEL
#include <signal.h>
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
using namespace std;
#ifdef DEBUG_PARALLEL
#include "SALOME_FileRef_i.hxx"
#include "SALOME_FileTransfer_i.hxx"
#include "SALOME_NamingService.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
#include <string.h>
#include <stdio.h>
# Libraries targets
# ===============================================================
#
-lib_LTLIBRARIES = libResourcesManager.la libSalomeResourcesManager.la
+if WITHONLYLAUNCHER
+ lib_LTLIBRARIES = libResourcesManager.la
+else
+ lib_LTLIBRARIES = libResourcesManager.la libSalomeResourcesManager.la
+endif
libSalomeResourcesManager_la_SOURCES =\
SALOME_ResourcesManager.cxx
libResourcesManager_la_LDFLAGS = -no-undefined -version-info=0:0:0
libResourcesManager_la_LIBADD =\
- ../Basics/libSALOMEBasics.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
+ ../Utils/libOpUtil.la \
@LIBXML_LIBS@
#include <string.h>
#include <map>
#include <list>
-#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <libxml/parser.h>
-#ifndef WIN32
-# include <unistd.h>
-#endif
+#include <algorithm>
#define MAX_SIZE_FOR_HOSTNAME 256;
*/
//=============================================================================
-ResourcesManager_cpp::ResourcesManager_cpp()
+ResourcesManager_cpp::ResourcesManager_cpp() throw(ResourcesException)
{
#if defined(_DEBUG_) || defined(_DEBUG)
cerr << "ResourcesManager_cpp constructor" << endl;
#endif
_isAppliSalomeDefined = (getenv("APPLI") != 0);
+ if(!getenv("KERNEL_ROOT_DIR"))
+ throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!!");
if (_isAppliSalomeDefined)
{
ResourcesManager_cpp::GetFittingResources(const machineParams& params,
const std::vector<std::string>& componentList) throw(ResourcesException)
{
-//#if defined(_DEBUG_) || defined(_DEBUG)
-// cerr << "ResourcesManager_cpp::GetFittingResources" << endl;
-//#endif
vector <std::string> vec;
ParseXmlFile();
#endif
if (hostname[0] != '\0'){
-//#if defined(_DEBUG_) || defined(_DEBUG)
-// cerr << "ResourcesManager_cpp::GetFittingResources : hostname specified" << endl;
-//#endif
if ( strcmp(hostname, "localhost") == 0 ||
strcmp(hostname, Kernel_Utils::GetHostname().c_str()) == 0 )
// --- params.hostname is in the list of resources so return it.
vec.push_back(hostname);
}
+
else if (_resourcesBatchList.find(hostname) != _resourcesBatchList.end())
{
// --- params.hostname is in the list of resources so return it.
vec.push_back(hostname);
}
+
else
{
// Cas d'un cluster: nombre de noeuds > 1
if( (*iter).second.DataForSort._nbOfNodes > 1 ){
if( strncmp(hostname,(*iter).first.c_str(),strlen(hostname)) == 0 ){
vec.push_back((*iter).first.c_str());
-//#if defined(_DEBUG_) || defined(_DEBUG)
-// cerr << "SALOME_ResourcesManager_cpp::GetFittingResources vector["
-// << cpt << "] = " << (*iter).first.c_str() << endl ;
-//#endif
cpt++;
}
}
public:
ResourcesManager_cpp(const char *xmlFilePath);
- ResourcesManager_cpp();
+ ResourcesManager_cpp() throw(ResourcesException);
~ResourcesManager_cpp();
//$Header$
//
#include "SALOME_ResourcesCatalog_Handler.hxx"
+#include "Basics_Utils.hxx"
#include <iostream>
#include <map>
-#include "utilities.h"
using namespace std;
-#ifdef _DEBUG_
-static int MYDEBUG = 1;
-#else
-static int MYDEBUG = 0;
-#endif
-
//=============================================================================
/*!
* Constructor
test_cpu_freq_mhz = "CPUFreqMHz";
test_nb_of_nodes = "nbOfNodes";
test_nb_of_proc_per_node = "nbOfProcPerNode";
+ test_batch_queue = "batchQueue";
+ test_user_commands = "userCommands";
}
//=============================================================================
void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
{
-// if (MYDEBUG) cout << "Begin parse document" << endl;
-
// Empty private elements
_resources_list.clear();
else
_resource.Alias = "";
- if (xmlHasProp(aCurNode, (const xmlChar*)test_protocol))
+ if (xmlHasProp(aCurNode, (const xmlChar*)test_batch_queue))
+ {
+ xmlChar* batch_queue = xmlGetProp(aCurNode, (const xmlChar*)test_batch_queue);
+ _resource.batchQueue = (const char*)batch_queue;
+ xmlFree(batch_queue);
+ }
+ else
+ _resource.batchQueue = "";
+
+ if (xmlHasProp(aCurNode, (const xmlChar*)test_user_commands))
+ {
+ xmlChar* user_commands= xmlGetProp(aCurNode, (const xmlChar*)test_user_commands);
+ _resource.userCommands = (const char*)user_commands;
+ xmlFree(user_commands);
+ }
+ else
+ _resource.userCommands = "";
+
+ if (xmlHasProp(aCurNode, (const xmlChar*)test_protocol))
{
- xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol);
- switch ( protocol[0])
+ xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol);
+ switch ( protocol[0])
{
case 'r':
_resource.Protocol = rsh;
_resource.Batch = pbs;
else if (aBatch == "lsf")
_resource.Batch = lsf;
+ else if (aBatch == "sge")
+ _resource.Batch = sge;
else
_resource.Batch = none;
}
_resource.mpi = openmpi;
else if (anMpi == "slurm")
_resource.mpi = slurm;
+ else if (anMpi == "prun")
+ _resource.mpi = prun;
else
- _resource.mpi = indif;
+ _resource.mpi = nompi;
}
if (xmlHasProp(aCurNode, (const xmlChar*)test_user_name))
_resource.HostName = nodeName ;
_resources_list[nodeName] = _resource;
}
- }
- else
- _resources_list[_resource.HostName] = _resource;
- }
- else
- _resources_batch_list[_resource.HostName] = _resource;
- }
+ }
+ else
+ {
+ _resources_list[_resource.HostName] = _resource;
+ if(_resource.HostName == "localhost")
+ _resources_list[Kernel_Utils::GetHostname()] = _resource;
+ }
+ }
+ else
+ _resources_batch_list[_resource.HostName] = _resource;
+ }
aCurNode = aCurNode->next;
}
- // For debug only
- if (MYDEBUG)
- {
- for (map<string, ParserResourcesType>::const_iterator iter =
- _resources_list.begin();
- iter != _resources_list.end();
- iter++)
- {
- SCRUTE((*iter).second.HostName);
- SCRUTE((*iter).second.Alias);
- SCRUTE((*iter).second.UserName);
- SCRUTE((*iter).second.AppliPath);
- SCRUTE((*iter).second.OS);
- SCRUTE((*iter).second.Protocol);
- SCRUTE((*iter).second.Mode);
- }
-
-// cout << "This is the end of document" << endl;
-// }
- }
+#ifdef _DEBUG_
+ for (map<string, ParserResourcesType>::const_iterator iter =
+ _resources_list.begin();
+ iter != _resources_list.end();
+ iter++)
+ {
+ std::cerr << (*iter).second.HostName << std::endl;
+ std::cerr << (*iter).second.Alias << std::endl;
+ std::cerr << (*iter).second.UserName << std::endl;
+ std::cerr << (*iter).second.AppliPath << std::endl;
+ std::cerr << (*iter).second.OS << std::endl;
+ std::cerr << (*iter).second.Protocol << std::endl;
+ std::cerr << (*iter).second.Mode << std::endl;
+ }
+#endif
+
}
node = xmlNewChild(root_node, NULL, BAD_CAST test_machine, NULL);
xmlNewProp(node, BAD_CAST test_hostname, BAD_CAST (*iter).second.HostName.c_str());
xmlNewProp(node, BAD_CAST test_alias, BAD_CAST (*iter).second.Alias.c_str());
-
+ xmlNewProp(node, BAD_CAST test_batch_queue, BAD_CAST (*iter).second.batchQueue.c_str());
+ xmlNewProp(node, BAD_CAST test_user_commands, BAD_CAST (*iter).second.userCommands.c_str());
+
switch ((*iter).second.Protocol)
{
case rsh:
case lsf:
xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf");
break;
- case slurm:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "slurm");
+ case sge:
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge");
break;
default:
xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "");
case openmpi:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi");
break;
+ case slurm:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
+ break;
+ case prun:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
+ break;
default:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
}
case lsf:
xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf");
break;
- case slurm:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "slurm");
+ case sge:
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge");
break;
default:
xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "");
case openmpi:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi");
break;
+ case slurm:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
+ break;
+ case prun:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
+ break;
default:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
}
const char *test_cpu_freq_mhz;
const char *test_nb_of_nodes;
const char *test_nb_of_proc_per_node;
+ const char *test_batch_queue;
+ const char *test_user_commands;
};
"UserName : " << UserName << endl <<
"AppliPath : " << AppliPath << endl <<
"OS : " << OS << endl <<
+ "batchQueue : " << batchQueue << endl <<
+ "userCommands : " << userCommands << endl <<
"Modules : " << endl;
for(int i=0;i<ModulesList.size();i++)
Protocol = rsh;
Mode = interactive;
Batch = none;
- mpi = indif;
+ mpi = nompi;
UserName = "";
AppliPath = "";
+ batchQueue = "";
+ userCommands = "";
ModulesList.clear();
OS = "";
}
enum AccessModeType {interactive, batch};
-enum BatchType {none, pbs, lsf};
+enum BatchType {none, pbs, lsf, sge};
-enum MpiImplType {indif, lam, mpich1, mpich2, openmpi, slurm};
+enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm, prun};
class RESOURCESMANAGER_EXPORT ResourceDataToSort
{
std::string AppliPath;
std::vector<std::string> ModulesList;
std::string OS;
+ std::string batchQueue;
+ std::string userCommands;
void Print() const;
void Clear();
p_ptr->cpu_clock = resource.DataForSort._CPUFreqMHz;
p_ptr->nb_proc_per_node = resource.DataForSort._nbOfProcPerNode;
p_ptr->nb_node = resource.DataForSort._nbOfNodes;
- if( resource.mpi == indif )
- p_ptr->mpiImpl = "indif";
- else if( resource.mpi == lam )
+
+ if( resource.mpi == lam )
p_ptr->mpiImpl = "lam";
else if( resource.mpi == mpich1 )
p_ptr->mpiImpl = "mpich1";
p_ptr->mpiImpl = "openmpi";
else if( resource.mpi == slurm )
p_ptr->mpiImpl = "slurm";
+ else if( resource.mpi == prun )
+ p_ptr->mpiImpl = "prun";
+
if( resource.Batch == pbs )
p_ptr->batch = "pbs";
else if( resource.Batch == lsf )
p_ptr->batch = "lsf";
+ else if( resource.Batch == sge )
+ p_ptr->batch = "sge";
+
+ p_ptr->nb_component_nodes=1;
return p_ptr;
}
SALOMEDS_AttributeParameter.cxx \
SALOMEDS_AttributeString.cxx \
SALOMEDS_IParameters.cxx \
+ SALOMEDS_AttLong_i.hxx \
+ SALOMEDS_AttReal_i.hxx \
SALOMEDS_AttributeComment.hxx \
SALOMEDS_AttributeComment_i.hxx \
SALOMEDS_AttributeDrawable.hxx \
SALOMEDS_AttributeTreeNode_i.hxx \
SALOMEDS_AttributeUserID.hxx \
SALOMEDS_AttributeUserID_i.hxx \
+ SALOMEDS_BasicAttributeFactory.hxx \
+ SALOMEDS_BasicAttribute_i.hxx \
SALOMEDS_Callback_i.hxx \
SALOMEDS_ChildIterator.hxx \
SALOMEDS_ChildIterator_i.hxx \
+Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-$Header$
+Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+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
+-----------------------------------------
How to add a new attribute (without WOK):
-----------------------------------------
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttLong_i.cxx
// Author : Estelle Deville
// Module : SALOME
// $Header$
-
+//
#include "SALOMEDS_AttLong_i.hxx"
#include "utilities.h"
#include <stdio.h>
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttLong_i.hxx
// Author : Estelle Deville
// Module : SALOME
// $Header$
-
+//
#ifndef __SALOMEDS_ATTLONG_I_H__
#define __SALOMEDS_ATTLONG_I_H__
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttReal_i.cxx
// Author : Estelle Deville
// Module : SALOME
// $Header$
-
+//
#include "SALOMEDS_AttReal_i.hxx"
#include "utilities.h"
#include <stdio.h>
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_AttReal_i.hxx
// Author : Estelle Deville
// Module : SALOME
// $Header$
-
+//
#ifndef __SALOMEDS_ATTREAL_I_H__
#define __SALOMEDS_ATTREAL_I_H__
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttributeFactory.cxx
// Author : Estelle Deville, CEA
// Module : SALOME
// $Header$
-
+//
#include "SALOMEDS_BasicAttributeFactory.hxx"
#include "utilities.h"
using namespace std;
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttributeFactory.hxx
// Author : Estelle Deville, CEA
// Module : SALOME
// $Header$
-
+//
#ifndef _BASIC_ATTRIBUTEFACTORY_HXX_
#define _BASIC_ATTRIBUTEFACTORY_HXX_
#include "SALOMEDS_BasicAttribute_i.hxx"
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttribute_i.cxx
// Author : Estelle Deville, CEA
// Module : SALOME
// $Header$
-
+//
#include "SALOMEDS_BasicAttribute_i.hxx"
using namespace std;
-// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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
+// 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
//
+// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS_BasicAttribute_i.hxx
// Author : Estelle Deville, CEA
// Module : SALOME
// $Header$
-
+//
#ifndef _BASIC_ATTRIBUTE_I_HXX_
#define _BASIC_ATTRIBUTE_I_HXX_
testDS_SOURCES = testDS.cxx
testDS_CPPFLAGS = $(COMMON_CPPFLAGS)
testDS_LDADD = libSalomeDSImpl.la \
- ../HDFPersist/libSalomeHDFPersist.la \
$(HDF5_LIBS)
aString += myRows[i][j];
aString += '\n';
}
- }
+ }
//Nb columns
sprintf(buffer, "%d\n", myNbColumns);
aString += myTitle[i];
aString +='\n';
}
-
+
//Nb rows
sprintf(buffer, "%d\n", myNbRows);
aString+=buffer;
aString += myRows[i][j];
aString += '\n';
}
- }
+ }
//Nb columns
sprintf(buffer, "%d\n", myNbColumns);
sprintf(buffer, "%d\n%.64e\n", p->first, p->second);
aString += buffer;
}
-
+
delete []buffer;
return aString;
}
aString += myRows[i][j];
aString += '\n';
}
- }
+ }
//Nb columns
sprintf(buffer, "%d\n", myNbColumns);
#include <fstream>
#include <cstdlib>
-#include "utilities.h"
-
using namespace std;
//#define _DEVDEBUG_
traceFile.open(theFileName, ios::out | ios::app);
if (!traceFile)
{
- MESSAGE ( "impossible to open trace file "<< theFileName );
+ cerr << "impossible to open trace file "<< theFileName << endl;
exit (1);
}
traceFile.close();
cout << flush ;
#ifndef WIN32
- MESSAGE ( "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace );
+ cerr << "INTERRUPTION from thread " << myTrace.threadId
+ << " : " << myTrace.trace;
#else
- MESSAGE ( "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace );
+ cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+ << " : " << myTrace.trace;
#endif
cerr << flush ;
exit(1);
#include "BaseTraceCollector.hxx"
#include "LocalTraceCollector.hxx"
#include "FileTraceCollector.hxx"
-#include "BasicsGenericDestructor.hxx"
#include "utilities.h"
using namespace std;
#endif
if ( !TraceCollectorFactory )
{
- MESSAGE ( "Can't resolve symbol: SingletonInstance" );
+ cerr << "Can't resolve symbol: SingletonInstance" <<endl;
#ifndef WIN32
- MESSAGE ( "dlerror: " << dlerror() );
+ cerr << "dlerror: " << dlerror() << endl;
#endif
exit( 1 );
}
}
else
{
- MESSAGE ( "library: " << impl_name << " not found !" );
+ cerr << "library: " << impl_name << " not found !" << endl;
assert(handle); // to give file and line
exit(1); // in case assert is deactivated
}
#include <sstream>
#include <fstream>
#include <cstdlib>
-#include "utilities.h"
using namespace std;
cout << flush ;
#ifndef WIN32
cerr << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
+ << " : " << myTrace.trace;
#else
cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
+ << " : " << myTrace.trace;
#endif
cerr << flush ;
exit(1);
#ifndef WIN32
cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
#else
- cerr << "th. " << (void*)(&myTrace.threadId) << " " << myTrace.trace;
+ cerr << "th. " << (void*)(&myTrace.threadId)
+ << " " << myTrace.trace;
#endif
cerr << flush ;
}
if (_threadId)
{
int ret = pthread_join(*_threadId, NULL);
- if (ret) { MESSAGE ( "error close LocalTraceCollector : " << ret ); }
+ if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl;
else DEVTRACE("LocalTraceCollector destruction OK");
delete _threadId;
_threadId = 0;
#include "SALOME_LocalTrace.hxx"
-#include <string>
#include "LocalTraceBufferPool.hxx"
#include "BaseTraceCollector.hxx"
#include CORBA_CLIENT_HEADER(SALOME_MPIContainer)
#include CORBA_CLIENT_HEADER(SALOME_TestMPIComponent)
+#include "Basics_Utils.hxx"
# include "Utils_ORB_INIT.hxx"
# include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
-#include "Basics_Utils.hxx"
+#include "OpUtil.hxx"
using namespace std;
int main (int argc, char * argv[])
UnitTests_LDADD =\
@CPPUNIT_LIBS@ \
../Basics/libSALOMEBasics.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../SALOMELocalTrace/Test/libSALOMELocalTraceTest.la \
- ../HDFPersist/libSalomeHDFPersist.la
+ ../SALOMELocalTrace/libSALOMELocalTrace.la ../SALOMELocalTrace/Test/libSALOMELocalTraceTest.la
if CORBA_GEN
UnitTests_LDADD +=\
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+// SALOME Utils : general SALOME's definitions and tools
+// File : OpUtil.cxx
+// Module : SALOME
+//
+#include "utilities.h"
+#include "OpUtil.hxx"
+#include <errno.h>
+#include <string.h>
+
+#ifndef WNT
+#include <unistd.h>
+#else
+#include <winsock2.h>
+#endif
+using namespace std;
+//int gethostname(char *name, size_t len);
+
+std::string GetHostname()
+{
+ int ls = 100, r = 1;
+ char *s;
+
+ while (ls < 10000 && r) {
+ ls *= 2;
+ s = new char[ls];
+ r = gethostname(s, ls-1);
+ switch (r)
+ {
+ case 0:
+ break;
+ default:
+#ifdef EINVAL
+ case EINVAL:
+#endif
+#ifdef ENAMETOOLONG
+ case ENAMETOOLONG:
+#endif
+ delete [] s;
+ continue;
+ }
+ }
+
+ if (r != 0) {
+ s = new char[50];
+ strcpy(s, "localhost");
+ }
+
+ // remove all after '.'
+ char *aDot = (strchr(s,'.'));
+ if (aDot) aDot[0] = '\0';
+
+ string p = s;
+ delete [] s;
+ return p;
+}
+