then
PACOPATH=$withval
PACO_INCLUDES="-I${PACOPATH}/include"
- PACO_LIBS="-L${PACOPATH}/lib -lPaCO"
+ PACO_LIBS="-L${PACOPATH}/lib -lPaCO -lGaBro -lBasicBC"
dnl a basic test to be sure that PaCO++
dnl is correctly installed.
- AC_CHECK_PROG(PACO_IDL, PaCOIdlTool, yes, no, ${PACOPATH}/bin)
+ AC_CHECK_PROG(PACO_IDL, PaCOIdlTool.sh, yes, no, ${PACOPATH}/bin)
if test "x$PACO_IDL" = "xno";
then
PaCO_ok=no
- AC_MSG_RESULT(PaCO++ binary not in ${PACOPATH})
+ AC_MSG_RESULT(PaCO++ binary not in ${PACOPATH}/bin)
fi
else
PaCO_ok=no
if test "x$PaCO_ok" = "xyes"
then
AC_MSG_RESULT([yes])
- PACO_IDL=${PACOPATH}/bin/PaCOIdlTool
+ PACO_IDL=${PACOPATH}/bin/PaCOIdlTool.sh
AC_SUBST(PACO_IDL)
AC_SUBST(PACOPATH)
AC_SUBST(PACO_INCLUDES)
#include "Batch_Date.hxx"
#ifdef WITH_PACO_PARALLEL
-#include "PaCO++.h"
+#include "PaCO++.hxx"
#endif
#define TIME_OUT_TO_LAUNCH_CONT 61
if (parallelLib == "Dummy")
{
+ command = "";
//command = "gdb --args ";
//command = "valgrind --tool=memcheck --log-file=val_log ";
//command += real_exe_name;
- command = real_exe_name;
+ if (par > 0)
+ {
+ string command_temp = real_exe_name;
+ command_temp += " " + _NS->ContainerName(rtn);
+ command_temp += " " + parallelLib;
+ command_temp += " " + hostname;
+ command_temp += " " + string(buffer);
+ command_temp += " -";
+ AddOmninamesParams(command_temp);
+ command += "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH;"
+ + command_temp
+ + "\"&";
+ }
+ else
+ {
+ for (int i= 0; i < nbproc; i++)
+ {
+ string command_temp = real_exe_name;
- command += " " + _NS->ContainerName(rtn);
- command += " " + parallelLib;
- command += " " + hostname;
- command += " -";
- AddOmninamesParams(command);
+ // A refaire en C++
+ char buffer_temp [33];
+ sprintf(buffer_temp,"%d",i);
+
+ command_temp += " " + _NS->ContainerName(rtn);
+ command_temp += " " + parallelLib;
+ command_temp += " " + hostname;
+ command_temp += " " + string(buffer_temp);
+ command_temp += " -";
+ AddOmninamesParams(command_temp);
+
+// if (command != "")
+// command += ";";
+
+ command += "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH;"
+ + command_temp
+ + "\"&";
+ }
+ }
}
else if (parallelLib == "Mpi")
{
// Nodes case
- command = "mpiexec -np " + string(buffer) + " ";
+ command = "mpirun -np " + string(buffer) + " ";
// command += "gdb --args ";
command += real_exe_name;
command += " " + _NS->ContainerName(rtn);
else
{
// Proxy case
- command = "mpiexec -np 1 ";
+ command = "mpirun -np 1 ";
command += real_exe_name;
command += " " + _NS->ContainerName(rtn);
command += " " + string(buffer);
command += " -";
AddOmninamesParams(command);
}
+ // log choice
+ if (log == "default")
+ {
+ command += " > /tmp/";
+ command += _NS->ContainerName(rtn);
+ command += "_";
+ command += Kernel_Utils::GetHostname();
+ command += "_";
+ command += getenv( "USER" ) ;
+ command += ".log 2>&1 &" ;
+ }
+ if (log == "xterm")
+ {
+ command = "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH; "
+ // + command + " \" &";
+ + command + "; echo $LD_LIBRARY_PATH; cat \" &";
+ }
}
else
{
throw SALOME_Exception(message.c_str());
}
- // log choice
- if (log == "default")
- {
- command += " > /tmp/";
- command += _NS->ContainerName(rtn);
- command += "_";
- command += Kernel_Utils::GetHostname();
- command += "_";
- command += getenv( "USER" ) ;
- command += ".log 2>&1 &" ;
- }
- if (log == "xterm")
- {
- command = "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH; "
- + command + " \" &";
-// + command + "; echo $LD_LIBRARY_PATH; cat \" &";
- }
return command;
/* if (log == "xterm")
if (status == -1)
{
INFOS("lamboot failed : system command status -1");
+ _MpiStarted = true;
}
else if (status == 217)
{
INFOS("lamboot failed : system command status 217");
+ _MpiStarted = true;
}
else
{
# ===============================================================
#
# header files
-salomeinclude_HEADERS = ParallelDSC_i.hxx
+salomeinclude_HEADERS = ParallelDSC_i.hxx param_double_port_provides.hxx \
+ param_double_port_uses.hxx
#
# ===============================================================
-I$(top_srcdir)/src/Registry \
-I$(top_srcdir)/src/Utils \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
- @PACO_INCLUDES@
+ @PACO_INCLUDES@ @MPI_INCLUDES@
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS =
#
lib_LTLIBRARIES = libSalomeParallelDSCContainer.la
-libSalomeParallelDSCContainer_la_SOURCES = ParallelDSC_i.cxx
+libSalomeParallelDSCContainer_la_SOURCES = ParallelDSC_i.cxx param_double_port_provides.cxx \
+ param_double_port_uses.cxx
libSalomeParallelDSCContainer_la_CXXFLAGS = $(COMMON_CPPFLAGS)
bool notif) :
Engines_Parallel_Component_i(orb, ior, rank, poa, contId, instanceName, interfaceName, notif),
Engines::Parallel_DSC_serv(orb, ior, rank),
+ Engines::Parallel_DSC_base_serv(orb, ior, rank),
Engines::DSC_serv(orb, ior, rank),
+ Engines::DSC_base_serv(orb, ior, rank),
Engines::Superv_Component_serv(orb, ior, rank),
+ Engines::Superv_Component_base_serv(orb, ior, rank),
Engines::Component_serv(orb, ior, rank),
+ Engines::Component_base_serv(orb, ior, rank),
Engines::Parallel_Component_serv(orb, ior, rank),
+ Engines::Parallel_Component_base_serv(orb, ior, rank),
InterfaceParallel_impl(orb, ior, rank)
{
}
#include <iostream>
#include <map>
-#include "DSC_EnginesPaCO_Engines_Parallel_DSC_server.h"
#include "DSC_interface.hxx"
#include "SALOME_ParallelComponent_i.hxx"
+#include "DSC_EnginesPaCO_Engines_Parallel_DSC_server.hxx"
+#include "SALOME_PortsPaCO.hxx"
+
class Engines_ParallelDSC_i:
public virtual Engines_Parallel_Component_i,
public virtual Engines::Parallel_DSC_serv,
int rank) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Salome_file_serv(orb,ior,rank),
+ Engines::Salome_file_base_serv(orb,ior,rank),
Engines::fileTransfer_serv(orb,ior,rank),
- Engines::Parallel_Salome_file_serv(orb,ior,rank)
+ Engines::Parallel_Salome_file_serv(orb,ior,rank),
+ Engines::fileTransfer_base_serv(orb,ior,rank),
+ Engines::Parallel_Salome_file_base_serv(orb,ior,rank)
{
CORBA::Object_ptr obj = _orb->string_to_object(ior);
proxy = Engines::Parallel_Salome_file::_narrow(obj);
#include <map>
#include <cstdio>
-#include "SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.h"
+#include "SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.hxx"
#include "Salome_file_i.hxx"
class CONTAINER_EXPORT Parallel_Salome_file_i:
#endif
#include <cstdlib>
#include "utilities.h"
+#include "Basics_Utils.hxx"
#ifndef WIN32
#include <sys/time.h>
Engines_Parallel_Component_i::Engines_Parallel_Component_i(CORBA::ORB_ptr orb, char * ior, int rank) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Component_serv(orb,ior,rank),
- Engines::Parallel_Component_serv(orb,ior,rank)
+ Engines::Component_base_serv(orb,ior,rank),
+ Engines::Parallel_Component_serv(orb,ior,rank),
+ Engines::Parallel_Component_base_serv(orb,ior,rank)
{
//ASSERT(0);
INFOS("Default Constructor...");
bool notif) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Component_serv(orb,ior,rank),
+ Engines::Component_base_serv(orb,ior,rank),
Engines::Parallel_Component_serv(orb,ior,rank),
+ Engines::Parallel_Component_base_serv(orb,ior,rank),
_instanceName(instanceName),
_interfaceName(interfaceName),
_myConnexionToRegistry(0),
#include <map>
#include <SALOMEconfig.h>
-#include "SALOME_ComponentPaCO_Engines_Parallel_Component_server.h"
+#include "SALOME_ComponentPaCO_Engines_Parallel_Component_server.hxx"
#include "NOTIFICATION.hxx"
#include "RegistryConnexion.hxx"
void send_parallel_proxy_object(CORBA::Object_ptr proxy_ref);
+ // Object information
+ virtual bool hasObjectInfo() { return false; }
+ virtual char* getObjectInfo(CORBA::Long studyId, const char* entry) { return ""; }
+
// --- local C++ methods
PortableServer::ObjectId * getId();
#include "SALOME_NamingService.hxx"
#include "utilities.h"
+#include "Basics_Utils.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
if(argc > 3) {
hostname = argv[3];
}
+ int myid = 0;
+ if(argc > 4)
+ sscanf(argv[4],"%d",&myid);
try {
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
string node_name = containerName + "Node";
Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb),
proxy_ior,
- 0,
+ myid,
root_poa,
(char*) node_name.c_str(),
argc, argv);
// In the NamingService
string hostname = Kernel_Utils::GetHostname();
- int myid = 0;
char buffer [5];
snprintf(buffer, 5, "%d", myid);
node_name = node_name + buffer;
#include "SALOME_NamingService.hxx"
#include "utilities.h"
+#include "Basics_Utils.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
std::cerr << "Unexpected: unexpected exception !" << std::endl;
setsig(SIGSEGV,&Handler);
set_terminate(&terminateHandler);
+ //set_terminate(__gnu_cxx::__verbose_terminate_handler);
set_unexpected(&unexpectedHandler);
}
cerr << "Level MPI_THREAD_SINGLE : " << MPI_THREAD_SINGLE << endl;
paco_fabrique_manager * pfm = paco_getFabriqueManager();
pfm->register_com("mpi", new paco_mpi_fabrique());
pfm->register_thread("omni", new paco_omni_fabrique());
- MPI_Comm group = MPI_COMM_WORLD;
- servant->setLibCom("mpi", &group);
+ MPI_Comm parallel_object_group;
+ MPI_Comm_dup(MPI_COMM_WORLD, ¶llel_object_group);
+ servant->setLibCom("mpi", ¶llel_object_group);
servant->setLibThread("omni");
// Activation
#include "SALOME_NamingService.hxx"
#include "utilities.h"
+#include "Basics_Utils.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
containerName = argv[1];
}
+ int nbnodes = 1;
+ if(argc > 4)
+ sscanf(argv[4],"%d",&nbnodes);
try {
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
ASSERT(!CORBA::is_nil(obj));
proxy->setLibThread("omnithread");
// Topo of the parallel object
PaCO::PacoTopology_t serveur_topo;
- serveur_topo.total = 1;
+ serveur_topo.total = nbnodes;
proxy->setTopology(serveur_topo);
PortableServer::ObjectId_var _id = root_poa->activate_object(proxy);
#include "SALOME_NamingService.hxx"
#include "utilities.h"
+#include "Basics_Utils.hxx"
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "SALOMETraceCollector.hxx"
#include "OpUtil.hxx"
using namespace std;
-#ifdef DEBUG_PARALLEL
+#ifdef _DEBUG_
#include <signal.h>
+typedef void (*sighandler_t)(int);
+sighandler_t setsig(int sig, sighandler_t handler)
+{
+ struct sigaction context, ocontext;
+ context.sa_handler = handler;
+ sigemptyset(&context.sa_mask);
+ context.sa_flags = 0;
+ if (sigaction(sig, &context, &ocontext) == -1)
+ return SIG_ERR;
+ return ocontext.sa_handler;
+}
+
+void AttachDebugger()
+{
+ if(getenv ("DEBUGGER"))
+ {
+ std::stringstream exec;
+ exec << "$DEBUGGER SALOME_ParallelContainerProxyMpi " << getpid() << "&";
+ std::cerr << exec.str() << std::endl;
+ system(exec.str().c_str());
+ while(1);
+ }
+}
+
+void Handler(int theSigId)
+{
+ std::cerr << "SIGSEGV: " << std::endl;
+ AttachDebugger();
+ //to exit or not to exit
+ exit(1);
+}
+
+void terminateHandler(void)
+{
+ std::cerr << "Terminate: not managed exception !" << std::endl;
+ AttachDebugger();
+}
+
+void unexpectedHandler(void)
+{
+ std::cerr << "Unexpected: unexpected exception !" << std::endl;
+ AttachDebugger();
+}
+
void handler(int t) {
cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED ,&provided);
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ if(getenv ("DEBUGGER"))
+ {
+ std::cerr << "Unexpected: unexpected exception !" << std::endl;
+ setsig(SIGSEGV,&Handler);
+ //set_terminate(&terminateHandler);
+ set_terminate(__gnu_cxx::__verbose_terminate_handler);
+ set_unexpected(&unexpectedHandler);
+ }
+
std::string containerName("");
containerName = argv[1];
int nb_nodes;
// PaCO++ code
paco_fabrique_manager* pfm = paco_getFabriqueManager();
pfm->register_com("mpi", new paco_mpi_fabrique());
- MPI_Comm group = MPI_COMM_WORLD;
- proxy->setLibCom("mpi", &group);
+ MPI_Comm parallel_object_group;
+ MPI_Comm_dup(MPI_COMM_WORLD, ¶llel_object_group);
+ proxy->setLibCom("mpi", ¶llel_object_group);
pfm->register_thread("omnithread", new paco_omni_fabrique());
proxy->setLibThread("omnithread");
PaCO::PacoTopology_t serveur_topo;
#define _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_
#include "utilities.h"
-#include "SALOME_ComponentPaCO_Engines_Container_server.h"
+#include "SALOME_ComponentPaCO_Engines_Container_server.hxx"
class Container_proxy_impl_final :
public Engines::Container_proxy_impl
#include <paco_omni.h>
#include "utilities.h"
+#include "Basics_Utils.hxx"
using namespace std;
bool _Sleeping = false ;
int rank) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Container_serv(orb,ior,rank),
+ Engines::Container_base_serv(orb,ior,rank),
_numInstance(0)
{
}
) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Container_serv(orb,ior,rank),
+ Engines::Container_base_serv(orb,ior,rank),
_numInstance(0),_isServantAloneInProcess(isServantAloneInProcess)
{
_pid = (long)getpid();
// --- get reference & servant from id
CORBA::Object_var obj = _poa->id_to_reference(*id);
iobject2 = Engines::Component_PaCO::_narrow(obj) ;
-
- // --- register the engine under the name
_NS->Register(iobject2 , component_registerName.c_str()) ;
MESSAGE( component_registerName.c_str() << " bound" ) ;
}
#include <SALOMEconfig.h>
-#include "SALOME_ComponentPaCO_Engines_Container_server.h"
+#include "SALOME_ComponentPaCO_Engines_Container_server.hxx"
#include <iostream>
#include <signal.h>