Back to index

salome-med  6.5.0
Public Member Functions | Private Attributes
ParaMEDMEM::MPIMEDCouplingFieldDoubleServant Class Reference

#include <MPIMEDCouplingFieldDoubleServant.hxx>

Inheritance diagram for ParaMEDMEM::MPIMEDCouplingFieldDoubleServant:
Inheritance graph
[legend]
Collaboration diagram for ParaMEDMEM::MPIMEDCouplingFieldDoubleServant:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MPIMEDCouplingFieldDoubleServant (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, ParaMEDMEMComponent_i *pcompo, MEDCouplingFieldDouble *field)
void getDataByMPI (const char *coupling) throw (SALOME::SALOME_Exception)
char * getRef ()
CORBA::LongLong getImplementation ()
void Register ()
void UnRegister ()

Private Attributes

ParaMEDMEMComponent_i_pcompo
MEDCouplingFieldDouble_field
std::string _ref
 IOR string of the object in which the vector is created.

Detailed Description

Definition at line 34 of file MPIMEDCouplingFieldDoubleServant.hxx.


Constructor & Destructor Documentation

MPIMEDCouplingFieldDoubleServant::MPIMEDCouplingFieldDoubleServant ( CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa,
ParaMEDMEMComponent_i pcompo,
MEDCouplingFieldDouble field 
)

Definition at line 31 of file MPIMEDCouplingFieldDoubleServant.cxx.

                                                                                                                                                                        :ParaMEDCouplingFieldDoubleServant(orb,field)
{
  _pcompo = pcompo;
  _field = field;

  CORBA::Object_var my_ref = poa->servant_to_reference (pcompo);
  SALOME_MED::ParaMEDMEMComponent_var compo = SALOME_MED::ParaMEDMEMComponent::_narrow(my_ref);
  _ref = orb->object_to_string(compo);

  Engines::MPIObject_var pobj = POA_SALOME_MED::MPIMEDCouplingFieldDoubleCorbaInterface::_this();
  BCastIOR(orb,pobj,false);
}

Member Function Documentation

void MPIMEDCouplingFieldDoubleServant::getDataByMPI ( const char *  coupling) throw (SALOME::SALOME_Exception)

Definition at line 44 of file MPIMEDCouplingFieldDoubleServant.cxx.

{
  except_st *est;
  void *ret_th;
  pthread_t *th;

  if(_numproc == 0)
    {
      th = new pthread_t[_nbproc];
      for(int ip=1;ip<_nbproc;ip++)
        {
          thread_st *st = new thread_st;
          st->ip = ip;
          st->tior = _tior;
          st->coupling = coupling;
          pthread_create(&(th[ip]),NULL,th_getdatabympi,(void*)st);
        }
    }

  try
    {
      _pcompo->_getOutputField(coupling,_field);
    }
  catch(const std::exception &ex)
    {
      MESSAGE(ex.what());
      THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR);
    }
    
  if(_numproc == 0)
    {
      for(int ip=1;ip<_nbproc;ip++)
        {
          pthread_join(th[ip],&ret_th);
          est = (except_st*)ret_th;
          if(est->exception)
            {
              ostringstream msg;
              msg << "[" << ip << "] " << est->msg;
              THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(),SALOME::INTERNAL_ERROR);
            }
          delete est;
        }
      delete[] th;
    }
}

Here is the call graph for this function:

Definition at line 42 of file MPIMEDCouplingFieldDoubleServant.hxx.

{return (CORBA::LongLong)_field;}

Definition at line 118 of file MPIMEDCouplingFieldDoubleServant.cxx.

{
  return CORBA::string_dup(_ref.c_str());
}

Definition at line 30 of file ParaMEDCouplingFieldDoubleServant.cxx.

{
  if(_numproc == 0)
    for(int ip=1;ip<_nbproc;ip++)
      {
        SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_var fieldPtr=SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface::_narrow((*_tior)[ip]);
        fieldPtr->Register();
      }
  MEDCouplingFieldDoubleServant::Register();
}

Definition at line 41 of file ParaMEDCouplingFieldDoubleServant.cxx.

{
  if(_numproc == 0)
    for(int ip=1;ip<_nbproc;ip++)
      {
        SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_var fieldPtr=SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface::_narrow((*_tior)[ip]);
        fieldPtr->UnRegister();
      }
  MEDCouplingFieldDoubleServant::UnRegister();
}

Member Data Documentation

Definition at line 45 of file MPIMEDCouplingFieldDoubleServant.hxx.

Definition at line 44 of file MPIMEDCouplingFieldDoubleServant.hxx.

IOR string of the object in which the vector is created.

Definition at line 47 of file MPIMEDCouplingFieldDoubleServant.hxx.


The documentation for this class was generated from the following files: