ACLOCAL_AMFLAGS = -I salome_adm/unix/config_files
-SUBDIRS = $(IDLDIR) salome_adm src doc bin resources
+SUBDIRS = salome_adm $(IDLDIR) src doc bin resources
-DIST_SUBDIRS= idl salome_adm src doc bin resources
+DIST_SUBDIRS= salome_adm idl src doc bin resources
DISTCLEANFILES = a.out
dirpidict = os.path.dirname(fpidict)
fpidict = os.path.basename(fpidict)
fnamere = re.compile("^%s$" % fpidict)
- for f in os.listdir(dirpidict):
- mo = fnamere.match(f)
- try:
- killMyPort(mo.group(1))
- except:
- pass
+ try:
+ for f in os.listdir(dirpidict):
+ mo = fnamere.match(f)
+ try:
+ killMyPort(mo.group(1))
+ except:
+ pass
+ pass
+ pass
+ except:
pass
# provide compatibility with old-style pidict file (not dot-prefixed)
fpidict = getPiDict('(\d*)',hidden=False)
dirpidict = os.path.dirname(fpidict)
fpidict = os.path.basename(fpidict)
fnamere = re.compile("^%s$" % fpidict)
- for f in os.listdir(dirpidict):
- mo = fnamere.match(f)
- try:
- killMyPort(mo.group(1))
- except:
- pass
- pass
+ try:
+ for f in os.listdir(dirpidict):
+ mo = fnamere.match(f)
+ try:
+ killMyPort(mo.group(1))
+ except:
+ pass
+ pass
+ pass
+ except:
+ pass
# kill other processes
if sys.platform != 'win32':
import commands
import shutil
shutil.copyfile(omniorb_config, last_running_config)
else:
- os.remove(last_running_config)
+ try:
+ os.remove(last_running_config)
+ except OSError:
+ pass
os.symlink(omniorb_config, last_running_config)
pass
pass
salome_subdir,
"shared_modules"),
"PYTHONPATH")
- pass
- pass
+ # set environment for SMESH plugins
+ if module == "SMESH" :
+ os.environ["SMESH_MeshersList"]="StdMeshers"
+ if not os.environ.has_key("SALOME_StdMeshersResources"):
+ os.environ["SALOME_StdMeshersResources"] \
+ = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh"
+ pass
+ if args.has_key("SMESH_plugins"):
+ for plugin in args["SMESH_plugins"]:
+ plugin_root = ""
+ if os.environ.has_key(plugin+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin+"_ROOT_DIR"]
+ else:
+ # workaround to avoid modifications of existing environment
+ if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
+ pass
+ pass
+ if plugin_root != "":
+ os.environ["SMESH_MeshersList"] \
+ = os.environ["SMESH_MeshersList"]+":"+plugin
+ if not os.environ.has_key("SALOME_"+plugin+"Resources"):
+ os.environ["SALOME_"+plugin+"Resources"] \
+ = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
+ add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH")
+ add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH")
+
+ if sys.platform == "win32":
+ add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
+ else:
+ add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
+ add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
+ add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH")
+ pass
+ pass
+ pass
+ pass
+ pass
+
if sys.platform == 'win32':
os.environ["SALOMEPATH"]=";".join(modules_root_dir_list)
else:
if args['logger']:
os.environ["SALOME_trace"]="with_logger"
- # set environment for SMESH plugins
-
- if "SMESH" in modules_list:
- os.environ["SMESH_MeshersList"]="StdMeshers"
- if not os.environ.has_key("SALOME_StdMeshersResources"):
- os.environ["SALOME_StdMeshersResources"] \
- = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh"
- pass
- if args.has_key("SMESH_plugins"):
- for plugin in args["SMESH_plugins"]:
- plugin_root = ""
- if os.environ.has_key(plugin+"_ROOT_DIR"):
- plugin_root = os.environ[plugin+"_ROOT_DIR"]
- else:
- # workaround to avoid modifications of existing environment
- if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
- plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
- pass
- pass
- if plugin_root != "":
- os.environ["SMESH_MeshersList"] \
- = os.environ["SMESH_MeshersList"]+":"+plugin
- if not os.environ.has_key("SALOME_"+plugin+"Resources"):
- os.environ["SALOME_"+plugin+"Resources"] \
- = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
- add_path(os.path.join(plugin_root,get_lib_dir(),python_version,
- "site-packages",salome_subdir),
- "PYTHONPATH")
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
- "PYTHONPATH")
-
-
- if sys.platform == "win32":
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
- "PATH")
- else:
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir),
- "LD_LIBRARY_PATH")
- add_path(os.path.join(plugin_root,"bin",salome_subdir),
- "PYTHONPATH")
- add_path(os.path.join(plugin_root,"bin",salome_subdir),
- "PATH")
- pass
- pass
-
# set environment for SUPERV module
os.environ["ENABLE_MACRO_NODE"]="1"
# set resources variables if not yet set
lib_LTLIBRARIES = libSalomeIDLKernel.la $(PAR_LIB)
nodist_libSalomeIDLKernel_la_SOURCES = $(IDL_SOURCES) $(DYNIDL_SRCS)
-libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix \
+libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
libSalomeIDLKernel_la_LIBADD = @CORBA_LIBS@
nodist_libSalomeParallelIDLKernel_la_SOURCES = $(PAR) $(GEN_PACO)
-libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \
+libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \
+ -I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
@PACO_INCLUDES@
libSalomeParallelIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
#undef PACKAGE_VERSION
#endif
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
#endif
AC_CACHE_VAL(salome_cv_lib_occ,[
AC_TRY_LINK(
#include <TCollection_AsciiString.hxx>
-, size_t size;
- TCollection_AsciiString aStr ("toto");
+, TCollection_AsciiString aStr ("toto");
aStr.Capitalize();,
eval "salome_cv_lib_occ=yes",eval "salome_cv_lib_occ=no")
])
_sec = p_tm->tm_sec;
} else {
- char c;
+// char c;
// istringstream ist(s);
// ist >> _day >> c
// >> _month >> c
ostream & operator << (ostream & os, const Versatile & V)
{
Versatile::const_iterator it;
- char * sep = "";
+ const char * sep = "";
for(it=V.begin(); it!=V.end(); it++, sep=" ") {
string s = (*it)->affiche();
// Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
- PyObject* iorSupport = PyObject_CallMethod(orb, "object_to_string", "O", $input);
+ PyObject* iorSupport = PyObject_CallMethod(orb, (char*)"object_to_string", (char*)"O", $input);
if (iorSupport == Py_None)
return NULL;
// Ask omniORB to convert IOR string to SALOME::SenderDouble_ptr
int argc = 0;
- char *xargv = "";
+ char *xargv = (char*)"";
char **argv = &xargv;
CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
CORBA::Object_var O = ORB->string_to_object(s);
// Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
- PyObject* iorSupport = PyObject_CallMethod(orb, "object_to_string", "O", $input);
+ PyObject* iorSupport = PyObject_CallMethod(orb, (char*)"object_to_string", (char*)"O", $input);
if (iorSupport == Py_None)
return NULL;
// Ask omniORB to convert IOR string to SALOME::SenderInt_ptr
int argc = 0;
- char *xargv = "";
+ char *xargv = (char*)"";
char **argv = &xargv;
CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
CORBA::Object_var O = ORB->string_to_object(s);
PyObject* orb = PyDict_GetItemString(pdict, "o");
// Get the orb Corba C++
int argc = 0;
- char *xargv = "";
+ char *xargv = (char*)"";
char **argv = &xargv;
CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
std::string s = ORB->object_to_string($1);
PyObject * tmp = PyString_FromString(s.c_str());
- $result = PyObject_CallMethod(orb, "string_to_object", "O", tmp);
+ $result = PyObject_CallMethod(orb, (char*)"string_to_object", (char*)"O", tmp);
}
%typemap(python,out) SALOME::SenderInt_ptr
PyObject* orb = PyDict_GetItemString(pdict, "o");
// Get the orb Corba C++
int argc = 0;
- char *xargv = "";
+ char *xargv = (char*)"";
char **argv = &xargv;
CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
std::string s = ORB->object_to_string($1);
PyObject * tmp = PyString_FromString(s.c_str());
- $result = PyObject_CallMethod(orb, "string_to_object", "O", tmp);
+ $result = PyObject_CallMethod(orb, (char*)"string_to_object", (char*)"O", tmp);
}
PyObject * getValueForSenderDouble(SALOME::SenderDouble_ptr senderDouble);
int err = PyList_SetItem(py_list, i, Py_BuildValue("d", (double) ret[i]));
if(err)
{
- char * message = "Error in SUPPORT::getTypes";
+ const char * message = "Error in SUPPORT::getTypes";
PyErr_SetString(PyExc_RuntimeError, message);
return NULL;
}
int err = PyList_SetItem(py_list, i, Py_BuildValue("i", (int) ret[i]));
if(err)
{
- char * message = "Error in SUPPORT::getTypes";
+ const char * message = "Error in SUPPORT::getTypes";
PyErr_SetString(PyExc_RuntimeError, message);
return NULL;
}
int err = PyList_SetItem(tmpRow, j, Py_BuildValue("d", (double) ret[i*column+j]));
if(err)
{
- char * message = "PyList_SetItem matrix sent may be invalid";
+ const char * message = "PyList_SetItem matrix sent may be invalid";
PyErr_SetString(PyExc_RuntimeError, message);
return NULL;
}
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- "import_component",
- "s",componentName);
+ (char*)"import_component",
+ (char*)"s",componentName);
int ret= PyInt_AsLong(result);
Py_XDECREF(result);
SCRUTE(ret);
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- "create_component_instance",
- "ssl",
+ (char*)"create_component_instance",
+ (char*)"ssl",
aCompName.c_str(),
instanceName.c_str(),
studyId);
SCRUTE(aGenRegisterName);
SCRUTE(_cntInstances_map[aGenRegisterName]);
//SCRUTE(servant->pd_refCount);
+#if defined(_DEBUG_) || defined(_DEBUG)
bool ret_studyId = servant->setStudyId(studyId);
ASSERT(ret_studyId);
+#else
+ servant->setStudyId(studyId);
+#endif
// --- register the engine under the name
// containerName(.dir)/instanceName(.object)
#define _CONTAINER_INIT_PYTHON_HXX_
#include <SALOME_Container.hxx>
+#include <SALOMEconfig.h>
#include <pthread.h> // must be before Python.h !
#include <Python.h>
#define Py_ACQUIRE_NEW_THREAD \
PyEval_AcquireLock(); \
PyThreadState *myTstate = PyThreadState_New(KERNEL_PYTHON::_interp); \
- PyThreadState *myoldTstate = PyThreadState_Swap(myTstate);
+ PyThreadState_Swap(myTstate);
#define Py_RELEASE_NEW_THREAD \
PyEval_ReleaseThread(myTstate); \
if (!isSupervContainer)
{
- int _argc = 1;
- char* _argv[] = {""};
+ // int _argc = 1;
+ // char* _argv[] = {""};
KERNEL_PYTHON::init_python(argc,argv);
}
else
PySys_SetArgv( argc , argv ) ;
}
- char *containerName = "";
+ char *containerName = (char *)"";
if(argc > 1)
{
containerName = argv[1] ;
system(aCommand.str().c_str());
#endif
- Engines_Container_i * myContainer
- = new Engines_Container_i(orb, root_poa, containerName , argc , argv );
+ new Engines_Container_i(orb, root_poa, containerName , argc , argv );
pman->activate();
if (!isSupervContainer)
{
- PyGILState_STATE gstate = PyGILState_Ensure();
+ PyGILState_Ensure();
//Delete python container that destroy orb from python (pyCont._orb.destroy())
Py_Finalize();
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#include <SALOMEconfig.h>
#include <stdexcept>
#include <omniORB4/CORBA.h>
+
#include "utilities.h"
// CCRT porting
_container = Engines::Container::_duplicate(container);
_origFileName = origFileName;
_machine = GetHostname();
+#if defined(_DEBUG_) || defined(_DEBUG)
int OK = addRef(_machine.c_str(), _origFileName.c_str());
SCRUTE(OK);
+#else
+ addRef(_machine.c_str(), _origFileName.c_str());
+#endif
}
aBlock = _fileDistributedSource[file_name]->getBlock(fileId);
toFollow = aBlock->length();
CORBA::Octet *buf = aBlock->get_buffer();
+#if defined(_DEBUG_) || defined(_DEBUG)
int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
ASSERT(nbWri == toFollow);
+#else
+ fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
+#endif
delete aBlock;
}
fclose(fp);
cout << "Test started " << endl;
DF_Application* appli = new DF_Application;
+ /*
DF_Document* doc1 = appli->NewDocument("doc_1");
- /*
DF_Label root1 = doc1->Main();
DF_Label child = root1.FindChild(3, true); //0:1:3
#ifdef WITH_NUMPY
/* With Numpy */
+#ifdef HAVE_ISINF
+#undef HAVE_ISINF
+#endif
#include <numpy/arrayobject.h>
typedef PyArrayObject ArrayObject;
/* Given a PyObject, return a string describing its type.
*/
-char* pytype_string(PyObject* py_obj) {
+const char* pytype_string(PyObject* py_obj) {
if (py_obj == NULL ) return "C NULL value";
if (PyCallable_Check(py_obj)) return "callable" ;
if (PyString_Check( py_obj)) return "string" ;
/* Given a Numeric typecode, return a string describing the type.
*/
-char* typecode_string(int typecode) {
- char* type_names[] = {"bool","byte","unsigned byte","short",
+const char* typecode_string(int typecode) {
+ const char* type_names[] = {"bool","byte","unsigned byte","short",
"unsigned short","int","unsigned int","long","unsigned long",
"longlong","unsigned longlong",
"float","double","long double","complex float","complex double","complex long double",
ary = (PyArrayObject*) input;
}
else if is_array(input) {
- char* desired_type = typecode_string(typecode);
- char* actual_type = typecode_string(array_type(input));
+ const char* desired_type = typecode_string(typecode);
+ const char* actual_type = typecode_string(array_type(input));
PyErr_Format(PyExc_TypeError,
"Array of type '%s' required. Array of type '%s' given",
desired_type, actual_type);
ary = NULL;
}
else {
- char * desired_type = typecode_string(typecode);
- char * actual_type = pytype_string(input);
+ const char * desired_type = typecode_string(typecode);
+ const char * actual_type = pytype_string(input);
PyErr_Format(PyExc_TypeError,
"Array of type '%s' required. A %s was given",
desired_type, actual_type);
%define TYPEMAP_IN3(type,typecode)
%typemap(in) type* IN_ARRAY3
(ArrayObject* array=NULL, int is_new_object) {
- int size[1] = {-1};
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
{
%#ifdef WITH_NUMPY
+ int size[1] = {-1};
array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (type*) array->data;
/* Specific typemap for complex */
%typemap(in) float* ecpval
(ArrayObject* array=NULL, int is_new_object) {
- int size[1] = {-1};
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
{
%#ifdef WITH_NUMPY
+ int size[1] = {-1};
array = obj_to_array_contiguous_allow_conversion($input, PyArray_CFLOAT, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (float*) array->data;
/* array of strings on input */
%typemap(in) char** eval
(ArrayObject* array=NULL, int is_new_object) {
- int size[1] = {-1};
stringArray* sarray;
if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *),0)) == -1)
{
%#ifdef WITH_NUMPY
+ int size[1] = {-1};
array = obj_to_array_contiguous_allow_conversion($input, PyArray_STRING, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (char**) malloc(array_size(array,0)*sizeof(char*));
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (type*) temp->data;
%#else
+ temp = NULL;
SWIG_exception(SWIG_TypeError, "type* expected");
%#endif
}
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (float*) temp->data;
%#else
+ temp = NULL;
SWIG_exception(SWIG_TypeError, "complex array expected");
%#endif
}
for(int i=0;i<array_size(temp,0);i++)
$1[i]=(char*) temp->data+i*temp->strides[0];
%#else
+ temp = NULL;
SWIG_exception(SWIG_TypeError, "string array expected");
%#endif
}
/********************* INTERFACE DE DECONNEXION *****************/
- static void
+ static inline void
ecp_cd (Superv_Component_i & component, std::string & instanceName)
{
/* TODO : Trouver le nom de l'instance SALOME*/
-I$(top_srcdir)/src/Utils \
-I$(top_srcdir)/src/Container \
-I$(top_srcdir)/src/Notification \
- -I$(top_builddir)/salome_adm/unix \
+ -I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@
std::cout << "------------ TEST1 --------------" << std::endl;
- int ret=0;
+ // int ret=0;
CORBA::Long time=1,tag=1;
typedef PalmCouplingPolicy::DataIdContainer DataIdContainer;
std::cout << "------------ TEST2 --------------" << std::endl;
- int ret=0;
+ // int ret=0;
CORBA::Long time=1,tag=1;
typedef PalmCouplingPolicy::DataIdContainer DataIdContainer;
// Author : Eric Fayolle (EDF)
// Module : KERNEL
void fake_method(void) {
-int fake_int;
+ // int fake_int;
};
throw HDFexception("Can't identify an internal object");
}
-int HDFfile::ExistInternalObject(char *object_name)
+int HDFfile::ExistInternalObject(const char *object_name)
{
int n,i;
int ret = 0;
int nInternalObjects();
void InternalObjectIndentify(int rank, char *object_name);
- int ExistInternalObject(char *object_name);
+ int ExistInternalObject(const char *object_name);
hdf_object_type InternalObjectType(char *object_name);
int nAttributes();
throw HDFexception("Can't identify an internal object");
}
-int HDFgroup::ExistInternalObject(char *object_name)
+int HDFgroup::ExistInternalObject(const char *object_name)
{
int n,i;
int ret = 0;
int nInternalObjects();
void InternalObjectIndentify(int rank, char *object_name);
- int ExistInternalObject(char *object_name);
+ int ExistInternalObject(const char *object_name);
hdf_object_type InternalObjectType(char *object_name);
int nAttributes();
hdf_err Num(hdf_idt id,const char *name, void *data);
hdf_err
-HDFnObjects(hdf_idt fid,char *path,int *n)
+HDFnObjects(hdf_idt fid,const char *path,int *n)
{
int idx;
int m = 0;
hdf_err RankInfo(hdf_idt id, const char *name, void *data);
-hdf_err HDFobjectIdentify(hdf_idt fid,char *path,int i,char *name)
+hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name)
{
int idx;
extern
hdf_err
-HDFnObjects(hdf_idt fid,char *path,int *n);
+HDFnObjects(hdf_idt fid,const char *path,int *n);
extern
-hdf_err HDFobjectIdentify(hdf_idt fid,char *path,int i,char *name);
+hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name);
extern
hdf_err HDFobjectType(hdf_idt id, char *name, hdf_object_type *type);
#include "Batch_FactBatchManager_eLSF.hxx"
#include "Batch_FactBatchManager_ePBS.hxx"
#include "Launcher.hxx"
+#include "utilities.h"
#include <iostream>
#include <sstream>
#include <sys/stat.h>
Launcher_cpp::Launcher_cpp()
{
- cerr << "Launcher_cpp constructor" << endl;
+ MESSAGE ( "Launcher_cpp constructor" );
}
//=============================================================================
Launcher_cpp::~Launcher_cpp()
{
- cerr << "Launcher_cpp destructor" << endl;
+ MESSAGE ( "Launcher_cpp destructor" );
std::map < string, Batch::BatchManager_eClient * >::const_iterator it1;
for(it1=_batchmap.begin();it1!=_batchmap.end();it1++)
delete it1->second;
const batchParams& batch_params,
const machineParams& params) throw(LauncherException)
{
- cerr << "BEGIN OF Launcher_cpp::submitSalomeJob" << endl;
+ MESSAGE ( "BEGIN OF Launcher_cpp::submitSalomeJob" );
long jobId;
vector<string> aMachineList;
ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]);
string clustername(p.Alias);
- cerr << "Choose cluster: " << clustername << endl;
+ MESSAGE ( "Choose cluster: " << clustername );
// search batch manager for that cluster in map or instanciate one
map < string, Batch::BatchManager_eClient * >::const_iterator it = _batchmap.find(clustername);
mpi = "indif";
break;
}
- cerr << "Instanciation of batch manager" << endl;
+ MESSAGE ( "Instanciation of batch manager" );
switch( params.Batch ){
case pbs:
- cerr << "Instantiation of PBS batch manager" << endl;
+ MESSAGE ( "Instantiation of PBS batch manager" );
fact = new Batch::FactBatchManager_ePBS;
break;
case lsf:
- cerr << "Instantiation of LSF batch manager" << endl;
+ MESSAGE ( "Instantiation of LSF batch manager" );
fact = new Batch::FactBatchManager_eLSF;
break;
default:
- cerr << "BATCH = " << params.Batch << endl;
+ MESSAGE ( "BATCH = " << params.Batch );
throw LauncherException("no batchmanager for that cluster");
}
return (*fact)(hostname.c_str(),protocol.c_str(),mpi.c_str());
tempOutputFile.flush();
tempOutputFile.close();
chmod(TmpFileName.c_str(), 0x1ED);
- cerr << TmpFileName.c_str() << endl;
+ MESSAGE ( TmpFileName.c_str() );
delete mpiImpl;
bool Launcher_cpp::check(const batchParams& batch_params)
{
bool rtn = true;
- cerr << "Job parameters are :" << endl;
- cerr << "Directory : $HOME/Batch/$date" << endl;
+ MESSAGE ( "Job parameters are :" );
+ MESSAGE ( "Directory : $HOME/Batch/$date" );
// check expected_during_time (check the format)
std::string edt_info = batch_params.expected_during_time;
else {
edt_info = "No value given";
}
- cerr << "Expected during time : " << edt_info << endl;;
+ MESSAGE ( "Expected during time : " << edt_info );
// check memory (check the format)
std::string mem_info;
else {
mem_info = "No value given";
}
- cerr << "Memory : " << mem_info << endl;
+ MESSAGE ( "Memory : " << mem_info );
// check nb_proc
std::string nb_proc_info;
else {
nb_proc_info = nb_proc_value.str();
}
- cerr << "Nb of processors : " << nb_proc_info << endl;
+ MESSAGE ( "Nb of processors : " << nb_proc_info );
return rtn;
}
command += p.Alias;
command += " 'echo $HOME' > ";
command += filelogtemp;
- std::cerr << command.c_str() << std::endl;
+ MESSAGE ( command.c_str() );
int status = system(command.c_str());
if(status)
throw LauncherException("Error of launching home command on remote host");
Launcher.cxx
libLauncher_la_CPPFLAGS =\
- -I$(srcdir)/../Batch \
+ $(COMMON_CPPFLAGS) \
-I$(srcdir)/../ResourcesManager \
@MPI_INCLUDES@ \
@LIBXML_INCLUDES@
toFollow = aBlock->length();
SCRUTE(toFollow);
CORBA::Octet *buf = aBlock->get_buffer();
+#if defined(_DEBUG_) || defined(_DEBUG)
int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
- delete aBlock;
ASSERT(nbWri == toFollow);
+#else
+ fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
+#endif
+ delete aBlock;
}
fclose(fp);
MESSAGE("end of transfer");
// be sure to have an instance of traceCollector, when used via SWIG
// in a Python module
int argc = 0;
- char *xargv = "";
+ char *xargv = (char*)"";
char **argv = &xargv;
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
// LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
bp1->deleteInstance(bp1);
// --- trace on file
- char *theFileName = TRACEFILE;
+ const char *theFileName = TRACEFILE;
string s = "file:";
s += theFileName;
// --- Get or initialize the orb
int _argc = 1;
- char* _argv[] = {""};
+ char* _argv[] = {(char*)""};
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
_orb = init(_argc , _argv ) ;
#define AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_
#include <strstream>
+#include <SALOMEconfig.h>
#include "Logger.hh"
//these declarations for files don't using OCC includes (for example HDF)
if (aDoc != NULL)
handler->ProcessXmlDocument(aDoc);
else
- INFOS("ModuleCatalog: could not parse file "<<file);
+ MESSAGE("ModuleCatalog: could not parse file "<<file);
xmlFreeDoc(aDoc);
xmlCleanupParser();
fclose(aFile);
}
else
- INFOS("ModuleCatalog: file "<<file<<" is not readable.");
+ MESSAGE("ModuleCatalog: file "<<file<<" is not readable.");
delete handler;
CosNaming::Name context_name;
vector<string> splitPath;
- int dimension_resultat = _createContextNameDir(Path,
+ _createContextNameDir(Path,
context_name,
splitPath,
false);
// SCRUTE(path);
CosNaming::Name context_name;
vector<string> splitPath;
- int dimension_resultat = _createContextNameDir(path.c_str(),
+ _createContextNameDir(path.c_str(),
context_name,
splitPath,
true);
bp1->deleteInstance(bp1);
// --- trace on file
- char *theFileName = TRACEFILE;
+ const char *theFileName = TRACEFILE;
string s = "file:";
s += theFileName;
// --- Get or initialize the orb
int _argc = 1;
- char* _argv[] = {""};
+ char* _argv[] = {(char*)""};
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
_orb = init(_argc , _argv ) ;
map<int,client_infos *>::iterator im;
for (im=_reg.begin();im!=_reg.end(); im++)
{
+#if defined(_DEBUG_) || defined(_DEBUG)
const client_infos &lesInfos = *(*im).second ;
MESSAGE("Deletion") ; SCRUTE( lesInfos._name ) ;
+#endif
_reg.erase ( im ) ;
}
ASSERT(_reg.size()==0) ;
for (im=_fin.begin();im!=_fin.end(); im++)
{
+#if defined(_DEBUG_) || defined(_DEBUG)
const client_infos &lesInfos = *(*im).second ;
MESSAGE("Deletion") ; SCRUTE( lesInfos._name ) ;
+#endif
_fin.erase ( im ) ;
}
ASSERT(_fin.size()==0) ;
ParseXmlFile();
const char *hostname = params.hostname.c_str();
- INFOS ( "GetFittingResources " << hostname << " " << GetHostname().c_str() );
+ MESSAGE ( "GetFittingResources " << hostname << " " << GetHostname().c_str() );
if (hostname[0] != '\0'){
// cerr << "ResourcesManager_cpp::GetFittingResources : hostname specified" << endl;
PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
//give ownership to the poa : the object will be deleted by the poa
aStudyManager_i->_remove_ref();
- aStudyManager_i->register_name("/myStudyManager");
+ aStudyManager_i->register_name((char*)"/myStudyManager");
}
return new SALOMEDS_StudyManager();
}
std::string aValue;
if (_isLocal) {
SALOMEDS::Locker lock;
- char guid[40];
+ // char guid[40];
aValue = dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_local_impl)->Value();
}
else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value();
CORBA::LongLong addr = theGA->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
- _local_impl = ((SALOMEDSImpl_GenericAttribute*)(addr));
+ _local_impl = reinterpret_cast<SALOMEDSImpl_GenericAttribute*>(addr);
_corba_impl = SALOMEDS::GenericAttribute::_nil();
}
else {
return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl));
}
- return "";
+ return (char*)"";
}
char* SALOMEDS_GenericAttribute_i::GetClassType()
return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl));
}
- return "";
+ return (char*)"";
}
long pid = (long)getpid();
#endif
isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return ((CORBA::LongLong)_impl);
+ return reinterpret_cast<CORBA::LongLong>(_impl);
}
theSObject->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
- _local_impl = ((SALOMEDSImpl_SObject*)(addr));
+ _local_impl = reinterpret_cast<SALOMEDSImpl_SObject*>(addr);
_corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
}
else {
long pid = (long)getpid();
#endif
isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return ((CORBA::LongLong)(void*)_impl);
+ return reinterpret_cast<CORBA::LongLong>(_impl);
}
long addr = theStudy->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
- _local_impl = ((SALOMEDSImpl_Study*)(addr));
+ _local_impl = reinterpret_cast<SALOMEDSImpl_Study*>(addr);
_corba_impl = SALOMEDS::Study::_duplicate(theStudy);
}
else {
CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
- _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
+ _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
_corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
}
else {
CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
- _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
+ _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
_corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
}
else {
* context name
*/
//============================================================================
-void SALOMEDS_StudyManager_i::register_name(char * name)
+void SALOMEDS_StudyManager_i::register_name(const char * name)
{
SALOMEDS::StudyManager_var aManager(_this());
_name_service->Register(aManager.in(), name);
long pid = (long)getpid();
#endif
isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return ((CORBA::LongLong)(void*)_impl);
+ return reinterpret_cast<CORBA::LongLong>(_impl);
}
//===========================================================================
/*!
\param char* arguments, the context to register the study manager in the NS
*/
- void register_name(char * name);
+ void register_name(const char * name);
//! method to Create a New Study of name study_name
/*!
long pid = (long)getpid();
#endif
isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
- return ((CORBA::LongLong)_impl);
+ return reinterpret_cast<CORBA::LongLong>(_impl);
}
void SALOMEDSTest::setUp()
{
int argc = 1;
- char* argv[] = {""};
+ char* argv[] = {(char*)""};
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
void SALOMEDSTest_Embedded::setUp()
{
int argc = 1;
- char* argv[] = {""};
+ char* argv[] = {(char*)""};
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
{
CheckLocked();
- SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(Label());
+ SALOMEDSImpl_Study::GetStudy(Label());
Backup();
myString = theValue;
if(aStr[0] == '0') //If the first character of the key is 0, then empty value
aValue = "";
else {
- long aSize = strtol(v[pos++].c_str(), NULL, 10);
+ strtol(v[pos++].c_str(), NULL, 10);
aValue = v[pos++];
}
myTable[aKey] = aValue;
sem_init(&_sem,0,0); // to wait until run thread is initialized
pthread_t traceThread;
int bid = 0;
- int re2 = pthread_create(&traceThread, NULL,
+ pthread_create(&traceThread, NULL,
FileTraceCollector::run, (void *)bid);
sem_wait(&_sem);
_singleton = myInstance; // _singleton known only when init done
//break;
}
- int fullBuf = myTraceBuffer->retrieve(myTrace);
+ myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
{
#ifndef WNT
DEVTRACE("New buffer pool");
LocalTraceBufferPool* myInstance = new LocalTraceBufferPool();
- DESTRUCTOR_OF<LocalTraceBufferPool> *ptrDestroy =
- new DESTRUCTOR_OF<LocalTraceBufferPool> (*myInstance);
+ new DESTRUCTOR_OF<LocalTraceBufferPool> (*myInstance);
_singleton = myInstance;
// --- start a trace Collector
}
else if (strncmp(traceKind,"file",strlen("file"))==0)
{
- char *fileName;
+ const char *fileName;
if (strlen(traceKind) > strlen("file"))
fileName = &traceKind[strlen("file")+1];
else
while (ret)
{
ret = sem_wait(&_fullBufferSemaphore);
- if (ret) perror(" LocalTraceBufferPool::retrieve, sem_wait");
+ if (ret) MESSAGE (" LocalTraceBufferPool::retrieve, sem_wait");
}
// get the next buffer to print
sem_init(&_sem,0,0); // to wait until run thread is initialized
pthread_t traceThread;
- int re2 = pthread_create(&traceThread, NULL,
+ pthread_create(&traceThread, NULL,
LocalTraceCollector::run, NULL);
sem_wait(&_sem);
_singleton = myInstance; // _singleton known only when init done
//break;
}
- int fullBuf = myTraceBuffer->retrieve(myTrace);
+ myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
{
cout << flush ;
SALOMELocalTraceTest::testSingletonBufferPool()
{
// --- trace on file
- char *theFileName = TRACEFILE;
+ const char *theFileName = TRACEFILE;
string s = "file:";
s += theFileName;
for(t=0;t<numThread;t++)
{
- int ret = pthread_join(threads[t], NULL);
+ pthread_join(threads[t], NULL);
MESSAGE("--------------------- end of PrintHello thread " << t);
}
MESSAGE(" ---- end of PrintHello threads ---- ");
void
SALOMELocalTraceTest::testLoadBufferPoolFile()
{
- char *theFileName = TRACEFILE;
+ const char *theFileName = TRACEFILE;
string s = "file:";
s += theFileName;
for(t=0;t<NUM_THREADS;t++)
{
- int ret = pthread_join(threads[t], NULL);
+ pthread_join(threads[t], NULL);
MESSAGE("--------------------- end of PrintHello thread " << t);
}
MESSAGE(" ---- end of PrintHello threads ---- ");
void *PrintHello(void *threadid)
{
+#if defined(_DEBUG_) || defined(_DEBUG)
long id_thread = (long)threadid;
for (int i=0; i<NUM_MESSAGES;i++)
MESSAGE("Hello World! This is a trace test : " << id_thread
<< " - iter " << i);
+#endif
pthread_exit(NULL);
}
sem_init(&_sem,0,0); // to wait until run thread is initialized
pthread_t traceThread;
int bid = 0;
- int re2 = pthread_create(&traceThread, NULL,
+ pthread_create(&traceThread, NULL,
SALOMETraceCollector::run, (void *)bid);
sem_wait(&_sem);
_singleton = myInstance; // _singleton known only when init done
//break;
}
- int fullBuf = myTraceBuffer->retrieve(myTrace);
+ myTraceBuffer->retrieve(myTrace);
if (!CORBA::is_nil(_orb))
{
if (myTrace.traceType == ABORT_MESS)
for(t=0;t<NUM_THREADS;t++)
{
- int ret = pthread_join(threads[t], NULL);
+ pthread_join(threads[t], NULL);
MESSAGE("--------------------- end of PrintHello thread " << t);
}
MESSAGE(" ---- end of PrintHello threads ---- ");
void *PrintHello(void *threadid)
{
+#if defined(_DEBUG_) || defined(_DEBUG)
long id_thread = (long)threadid;
for (int i=0; i<NUM_MESSAGES;i++)
MESSAGE("Hello World! This is a trace test : " << id_thread
<< " - iter " << i);
+#endif
pthread_exit(NULL);
}
}
}
#ifndef WNT
- int a = nanosleep(&ts_req,&ts_rem);
+ nanosleep(&ts_req,&ts_rem);
#else
Sleep(TIMESleep / 1000000);
#endif
#ifndef _TRACECOLLECTOR_WAITFORSERVERREADINESS_HXX_
#define _TRACECOLLECTOR_WAITFORSERVERREADINESS_HXX_
+#include <SALOMEconfig.h>
#include <omniORB4/CORBA.h>
#include <string>
void Engines_TestComponent_i::Setenv()
{
- bool overwrite = true;
+ // bool overwrite = true;
map<std::string,CORBA::Any>::iterator it;
MESSAGE("set environment associated with keys in map _fieldsDict");
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
s+='=';
s+=value;
//char* cast because 1st arg of linux putenv function is not a const char* !!!
- int ret=putenv((char *)s.c_str());
+ putenv((char *)s.c_str());
//End of CCRT porting
//int ret = setenv(cle.c_str(), value, overwrite);
MESSAGE("--- setenv: "<<cle<<" = "<< value);
Engines::TestComponent_ptr create_instance(Engines::Container_ptr iGenFact,
string componenttName)
{
+#if defined(_DEBUG_) || defined(_DEBUG)
bool isLib =
iGenFact->load_component_Library(componenttName.c_str());
// iGenFact->load_component_Library("SalomeTestComponent");
ASSERT(isLib);
+#else
+ iGenFact->load_component_Library(componenttName.c_str());
+#endif
CORBA::Object_var obj =
// iGenFact->create_component_instance("SalomeTestComponent",
iGenFact->create_component_instance(componenttName.c_str(),
bp1->deleteInstance(bp1);
// --- trace on file
- char *theFileName = TRACEFILE;
+ const char *theFileName = TRACEFILE;
string s = "file:";
s += theFileName;
void Nettoyage();
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+// static int MYDEBUG = 0;
#else
-static int MYDEBUG = 0;
+// static int MYDEBUG = 0;
#endif
using namespace std;
const struct utsname get_uname( void )
{
struct utsname hostid;
+#if defined(_DEBUG_) || defined(_DEBUG)
const int retour=uname(&hostid);
ASSERT(retour>=0);
+#else
+ uname(&hostid);
+#endif
return hostid ;
}
const char* get_adip( void )
{
struct utsname hostid;
+#if defined(_DEBUG_) || defined(_DEBUG)
const int retour=uname(&hostid);
ASSERT(retour>=0);
+#else
+ uname(&hostid);
+#endif
const hostent* pour_adip=gethostbyname(hostid.nodename);
ASSERT(pour_adip!=NULL);
# include <exception>
# include <iostream>
+#ifdef LOCALIZED
+#undef LOCALIZED
+#endif
#ifdef _DEBUG_
# define LOCALIZED(message) #message , __FILE__ , __LINE__
#else
}
void Utils_Timer::ShowAbsolute(){
+#if defined(_DEBUG_) || defined(_DEBUG)
#ifndef WNT
unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ;
#else
unsigned long Absolute_user = *RefToCurrentTimeB;
#endif
MESSAGE("Absolute time: " << Absolute_user << " seconds ");
+#endif
}