00001 #include "OMKPvmMulticastMessage.h" 00002 00003 #include <cassert> 00004 #include <pvm3.h> 00005 00006 #ifdef _DEBUGPVMMESS 00007 #include <iostream> 00008 #endif 00009 using namespace OMK ; 00010 00011 PvmMulticastMessage::PvmMulticastMessage (const std::vector<int> & recepients ) : 00012 _numberOfRecepients ( recepients.size () ), 00013 _recepients ( 0 ) 00014 { 00015 _recepients = new int [ _numberOfRecepients ] ; 00016 for ( int i = 0 ; i < _numberOfRecepients ; ++i ) 00017 { 00018 _recepients [i] = recepients [i] ; 00019 } 00020 } 00021 00022 PvmMulticastMessage::~PvmMulticastMessage () 00023 { 00024 assert (_recepients != NULL ) ; 00025 delete [] _recepients ; 00026 } 00027 00028 void PvmMulticastMessage::send(PvmMessage::MessageTag tag) 00029 { 00030 #ifdef _DEBUGPVMMESS 00031 std::cerr<<"PvmMulticastMessage:"<<(void *)this<<": send("<<tag<<") to "<<_numberOfRecepients<<" recipients"<<std::endl; 00032 #endif 00033 int oldbuf = pvm_setsbuf ( _currentBuffer ) ; 00034 00035 int info = pvm_mcast ( _recepients, _numberOfRecepients, tag ) ; 00036 00037 checkForSendErrors ( info ) ; 00038 00039 reinitAndRevertPvmContext ( oldbuf ) ; 00040 }
Documentation generated on Mon Jun 9 11:45:57 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |