]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
porting on Mandrake 10.1
authorsecher <secher>
Mon, 16 Jan 2006 14:56:01 +0000 (14:56 +0000)
committersecher <secher>
Mon, 16 Jan 2006 14:56:01 +0000 (14:56 +0000)
salome_adm/unix/config_files/check_lam.m4
salome_adm/unix/config_files/check_pthreads.m4
src/Communication/ReceiverFactory.cxx
src/Communication/Receivers.cxx
src/Communication/Receivers.hxx
src/Communication/SALOME_Comm_i.cxx

index d15fdde312cbb7238625970aabf5c089372420c9..4a9941e2c98fe05d3d15087442300a9d80224609 100644 (file)
@@ -88,8 +88,25 @@ if test "$WITHLAM" = yes; then
       AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
         MPI_LIBS="-lmpi $MPI_LIBS"
+        LIBS="-lmpi $LIBS"
       fi
 
+      AC_LANG_SAVE
+      AC_LANG_CPLUSPLUS
+      LIBS="-llammpi++ $LIBS"
+      AC_MSG_CHECKING(for MPI_Init in -llammpi++)
+      AC_TRY_LINK([
+         #include <mpi.h>
+         ], [MPI::Init();],
+         WITHLAM="yes",WITHLAM="no")
+      if test "$WITHLAM" = "yes";then
+        AC_MSG_RESULT(yes)
+        MPI_LIBS="-llammpi++ $MPI_LIBS"
+      else
+        AC_MSG_RESULT(no)
+      fi
+      AC_LANG_RESTORE
+
       AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
 
     fi
index 80aef2aad184d0e6509be9383e3422b254bf336c..d5033889e9cf46426843454e85dbd833853be25f 100644 (file)
@@ -38,6 +38,8 @@ if test $flag = no; then
   AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
   AC_CHECK_LIB(pthread,pthread_mutex_lock, 
                LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="")
+else
+  LDFLAGS="-pthread $LDFLAGS"
 fi
 
 if test $flag = no && x$LIBS_PTHREADS = x; then
index f404a7ec3dcc4b65b827216ca84b4d23b2f84e98..94743bfae0525b6b1d320eb23657e03c23d7703e 100644 (file)
@@ -115,7 +115,7 @@ double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &s
   else if(!CORBA::is_nil(mpi_ptr))
     {
       CORBA::release(sender);
-      MPIReceiver<double,MPI_DOUBLE,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
+      MPIReceiver<double,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
       return rec.getValue(size);
     }
 #endif
@@ -165,7 +165,7 @@ int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)th
   else if(!CORBA::is_nil(mpi_ptr))
     {
       CORBA::release(sender);
-      MPIReceiver<int,MPI_INT,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
+      MPIReceiver<int,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
       return rec.getValue(size);
     }
 #endif
index f97b4a1a4bf52918dbadcc45ad3bd9b71130e91c..f2ce1fa890eaef15cb38aec178efe11a6114d5eb 100644 (file)
@@ -154,17 +154,17 @@ T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::get
 
 #ifdef HAVE_MPI2
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
   _mySender->release();
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   int i=0;
   int myproc;
   int sproc;
@@ -211,15 +211,15 @@ T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   }
   MPI_Recv( &_n, 1, MPI_LONG, sproc,p->tag1,com,&status);
   _v = new T[_n];
-  MPI_Recv( _v, _n, T2, sproc,p->tag2,com,&status);
+  MPI_Recv( _v, _n, MPITRAITS<T>::MpiType, sproc,p->tag2,com,&status);
   _mySender->close(p);
   MPI_Comm_disconnect( &com );  
   size=_n;
   return _v;
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
   return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
index 203bf64dc12a225a518bfe14596f732c8d099db8..2dd44a854c9db69f4c01fafb2c6edaa6ffa8ee71 100644 (file)
@@ -94,7 +94,19 @@ private:
 /*!
   Receiver for MPI transfert.
  */
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+template<class T>
+struct MPITRAITS
+{
+  static MPI_Datatype MpiType;
+};
+
+template<>
+MPI_Datatype MPITRAITS<double>::MpiType=MPI_DOUBLE;
+
+template<>
+MPI_Datatype MPITRAITS<int>::MpiType=MPI_INT;
+
+template<class T,class CorbaSender,class servForT,class ptrForT>
 class MPIReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
index f886b53878d6fe1934938241fe16402a1e35ead5..632ce7a7375cd2d1474af94cbbf9b6c0b965e9d3 100644 (file)
@@ -272,7 +272,7 @@ SALOME::MPISender::param* SALOME_MPISender_i::getParam()
 void SALOME_MPISender_i::send()
 {
   _type=getTypeOfDataTransmitted();
-  _argsForThr=new (void *)[8];
+  _argsForThr=new void *[8];
   _argsForThr[0]=_portName;
   _argsForThr[1]=&_lgrTabToSend;
   _argsForThr[2]=(void *)_tabToSend;