00001 #include "OMKPvmUnicastMessage.h" 00002 00003 #include <cassert> 00004 #include <pvm3.h> 00005 #ifdef _DEBUGPVMMESS 00006 #include <iostream> 00007 #endif 00008 using namespace OMK ; 00009 00010 PvmUnicastMessage::PvmUnicastMessage (int distantSiteId) : 00011 _distantSiteId ( distantSiteId ) 00012 { 00013 } 00014 00015 PvmUnicastMessage::~PvmUnicastMessage () 00016 { 00017 } 00018 00019 void PvmUnicastMessage::setDistantSiteId (int distantSiteId ) 00020 { 00021 _distantSiteId = distantSiteId ; 00022 } 00023 00024 void PvmUnicastMessage::send(PvmMessage::MessageTag tag) 00025 { 00026 assert ( _timeStamped ) ; 00027 00028 assert ( _currentBuffer != 0 ) ; 00029 00030 assert ( _distantSiteId != 0 ) ; 00031 00032 #ifdef _DEBUGPVMMESS 00033 std::cerr<<"PvmUnicastMessage:"<<this<<":send ("<<tag<<") to "<< _distantSiteId << " buffer "<<_currentBuffer<<std::endl; 00034 #endif 00035 00036 int oldbuf = pvm_setsbuf ( _currentBuffer ) ; 00037 00038 checkForChangedBuffer ( oldbuf, __LINE__, __FILE__ ) ; 00039 00040 int info = pvm_send ( _distantSiteId, tag ) ; 00041 00042 checkForSendErrors ( info ) ; 00043 00044 reinitAndRevertPvmContext ( oldbuf ) ; 00045 }
Documentation generated on Mon Jun 9 11:45:57 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |