ESyS-Particle  4.0.1
InteractionFieldSlave.hpp
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #include "field_const.h"
00014 
00015 
00016 template <typename T>
00017 InteractionFieldSlave<T>::InteractionFieldSlave(TML_Comm* comm,TParallelInteractionStorage<T>* pis):AFieldSlave(comm)
00018 {
00019   m_pis=pis;
00020 }
00021 
00022 
00027 template <typename T>
00028 void InteractionFieldSlave<T>::sendData()
00029 {
00030   // debug output 
00031   console.XDebug() << "InteractionFieldSlave<T>::sendData()\n";
00032 
00033   int coll_type;
00034   m_comm->recv_broadcast(coll_type,0);
00035 
00036   // debug output 
00037   console.XDebug() << "received coll_type=" << coll_type << "\n"; 
00038 
00039   switch(coll_type){
00040   case COLL_TYPE_FULL : SendDataFull();break;
00041   case COLL_TYPE_SUM : SendDataSum();break;
00042   case COLL_TYPE_MAX : SendDataMax();break;
00043   case COLL_TYPE_FULL2 : SendDataFull2();break; 
00044   case COLL_TYPE_FULL_WITH_ID : SendDataWithID();break; 
00045   case COLL_TYPE_FULL_WITH_POS_ID : SendDataWithPosID();break;  
00046 
00047   default: std::cerr << "unknown collection type" << std::endl;
00048   }
00049 }