MachineBroker.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/08/29 07:16:40 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/machineBroker/MachineBroker.h,v $
00024                                                                         
00025                                                                         
00026 // Written: fmk
00027 // Revision: A
00028 //
00029 // Purpose: This file contains the class definition for MachineBroker.
00030 // MachineBroker is an abstract base class, a subclass of which must
00031 // be written for each parallel machine. A MachineBroker is responsible
00032 // for getting an actor process running on the parallel machine.
00033 //
00034 // What: "@(#) MachineBroker.h, revA"
00035 
00036 #ifndef MachineBroker_h
00037 #define MachineBroker_h
00038 
00039 class Channel;
00040 class FEM_ObjectBroker;
00041 class ID;
00042 
00043 class MachineBroker
00044 {
00045   public:
00046     MachineBroker(FEM_ObjectBroker *theObjectBroker);
00047     virtual ~MachineBroker();
00048 
00049     // methods to return info about local process id and num processes
00050     virtual int getPID(void) = 0;
00051     virtual int getNP(void)  = 0;
00052 
00053     // methods to get and free Actors
00054     virtual int shutdown(void);    
00055     virtual int runActors(void);
00056     virtual Channel *startActor(int actorType, int compDemand = 0);
00057     virtual int finishedWithActor(Channel *);
00058 
00059     // methods to get and free Channels (processes)
00060     virtual Channel *getMyChannel(void)        =0;
00061     virtual Channel *getRemoteProcess(void)    =0;
00062     virtual int freeProcess(Channel *)         =0;
00063 
00064     /* ************ THE OLD INTERFACE ***************
00065     virtual int startActor(char *actorProgram, 
00066                            Channel &theChannel,
00067                            int compDemand =0) =0;
00068     ********************************************** */
00069 
00070   protected:
00071     
00072   private:
00073     FEM_ObjectBroker *theObjectBroker;
00074 
00075     Channel **actorChannels; // channels owned with running actor processes
00076     int numActorChannels;
00077     int numActiveChannels;
00078     ID *activeChannels;
00079 };
00080 
00081 #endif

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