//*********************************************************************** // Virtual World Data Server Client for Scientific Data // Header file for the vwcMasterSlave class for MPI // // UCLA - OAC // Joan Slottow February 1998 // //*********************************************************************** #ifndef vwc_masterslave #define vwc_masterslave #include #include //*********************************************************************** // constants //*********************************************************************** //************************************************************************ // Class: vwcMasterSlave //************************************************************************ class vwcMasterSlave { protected: int oMSNOfNodes; // number of nodes int oMSNOfSlaveNodes; // number of slave nodes int oMSMyNodeId; // node id of this process public: //***************************************************************** // constructor //***************************************************************** vwcMasterSlave( ); //***************************************************************** // destructor //***************************************************************** ~vwcMasterSlave( ); public: //***************************************************************** // each class should have a print for debugging purposes //***************************************************************** void print( ) const; //***************************************************************** // useful methods //***************************************************************** virtual void initialize( int argc, char *argv[ ] ); void send( const char* msg, const int& to ) const; void receive( char* msg, int& from ) const; void runMasterSlave( ); protected: virtual void runMaster( ) = 0; virtual void runSlave( ) = 0; virtual bool initDataMaster( ) = 0; virtual bool initDataSlave( ) = 0; }; #endif