MPI_Channel.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.2 $
00022 // $Date: 2003/10/15 00:26:32 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/channel/MPI_Channel.h,v $
00024                                                                         
00025                                                                         
00026 // Written: fmk 11/95
00027 // Revised:
00028 //
00029 // Purpose: This file contains the class definition for MPI_Channel.
00030 // MPI_Channel is a sub-class of channel. It is implemented with Berkeley
00031 // stream sockets using the TCP protocol. Messages delivery is garaunteed. 
00032 // Communication is full-duplex between a pair of connected sockets.
00033 
00034 #ifndef MPI_Channel_h
00035 #define MPI_Channel_h
00036 
00037 #include <Channel.h>
00038 #include <mpi.h>
00039 
00040 class MPI_Channel : public Channel
00041 {
00042   public:
00043     MPI_Channel(int otherProcess);        
00044     ~MPI_Channel();
00045 
00046     char *addToProgram(void);
00047     
00048     virtual int setUpConnection(void);
00049 
00050     int setNextAddress(const ChannelAddress &otherChannelAddress);
00051     virtual ChannelAddress *getLastSendersAddress(void);
00052 
00053     int sendObj(int commitTag,
00054                 MovableObject &theObject, 
00055                 ChannelAddress *theAddress =0);
00056     
00057     int recvObj(int commitTag,
00058                 MovableObject &theObject, 
00059                 FEM_ObjectBroker &theBroker,
00060                 ChannelAddress *theAddress =0);
00061 
00062     int recvMsg(int dbTag, int commitTag, Message &, ChannelAddress *theAddress =0);       
00063     int sendMsg(int dbTag, int commitTag, const Message &, ChannelAddress *theAddress =0);    
00064 
00065     int sendMatrix(int dbTag, int commitTag, const Matrix &theMatrix, ChannelAddress *theAddress =0);
00066     int recvMatrix(int dbTag, int commitTag, Matrix &theMatrix, ChannelAddress *theAddress =0);
00067     
00068     int sendVector(int dbTag, int commitTag, const Vector &theVector, ChannelAddress *theAddress =0);
00069     int recvVector(int dbTag, int commitTag, Vector &theVector, ChannelAddress *theAddress =0);
00070     
00071     int sendID(int dbTag, int commitTag, const ID &theID, ChannelAddress *theAddress =0);
00072     int recvID(int dbTag, int commitTag, ID &theID, ChannelAddress *theAddress =0);    
00073     
00074     
00075   protected:
00076         
00077   private:
00078     int otherTag;
00079     MPI_Comm otherComm;    
00080 };
00081 
00082 
00083 #endif 
00084 
00085 
00086 
00087 
00088 
00089 
00090  
00091 

Generated on Mon Oct 23 15:04:56 2006 for OpenSees by doxygen 1.5.0