ESyS-Particle  4.0.1
mpia2abuf.h
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 #ifndef __MPIA2ABUFFER_H
00014 #define __MPIA2ABUFFER_H
00015 
00016 #include <mpi.h>
00017 
00026 class CMPIA2ABuffer
00027 {
00028  private:
00029   MPI_Comm m_comm;
00030   int m_rank; 
00031   int m_size; 
00032   int m_int_increment,m_dbl_increment; 
00033   MPI_Status m_status;
00034   char* m_buffer_s; 
00035   char* m_buffer_r; 
00036   int m_buffersize; 
00037   int *m_position_s; 
00038   int *m_position_r; 
00039 
00040  public:
00041   CMPIA2ABuffer(MPI_Comm,int);
00042   virtual ~CMPIA2ABuffer();
00043 
00044   virtual void clear();
00045   virtual void all2all();
00046   virtual void append(int,int);
00047   virtual void append(double,int);
00048   virtual int pop_int(int);
00049   virtual double pop_double(int);
00050 };
00051 
00052 #endif //__MPIA2ABUFFER_H