CCAFFEINE  0.8.8
CmdLineClient.h
00001 #ifndef CmdLineClient_h_seen
00002 #define CmdLineClient_h_seen
00003 
00004 
00005 #define DEFAULTPROCFILEPATH "processors"
00006 
00007 // Colin's Port of choice:
00008 #define DEFAULTPORT 2023 
00009 
00010 
00011 // base names for executables
00012 #define CCAFE_SINGLE "ccafe-single"
00013 #define CCAFE_BATCH "ccafe-batch"
00014 #define CCAFE_CLIENT "ccafe-client"
00015 
00017 enum runtype_ {
00019   CLIENT, 
00021   INTERACTIVE, 
00023   GUI_INTERACTIVE,
00025   HUMANCLIENT,
00028   ONE_PROC_INTERACTIVE,
00031   SERVER,
00034   BATCH
00035 };
00036 
00037 typedef runtype_ runtype;
00038 
00040 class MachWrapper;
00041 class CmdLineBuilderController2;
00042 class ClientServerSocket;
00043 
00047 class CmdLineClient {
00048 private:
00049 
00050   CmdLineBuilderController2* controller;
00051 
00053   char* procFile;
00054 
00056   MachWrapper * mWrap; 
00057 
00059   int myProcIndex;
00060 
00062   char* myProcName;
00063 
00065   runtype runType;
00066 
00068   int rank;
00070   int size;
00071 
00074   int port;
00075 
00077   bool debug;
00078 
00080   bool stp_initialized;
00081 
00082         bool useMPI;
00083 
00089   int64_t fortranMPIComm;
00090   bool hasComm;
00091 
00092 public:
00093 
00094   CmdLineClient();
00095   ~CmdLineClient();
00096   int parse();
00099   void mapIOToFile(const char* outName, const char* errName);
00101   void mapEverythingToTTY();
00105   void mapEverythingToFile(const char* outName, const char* errName);
00107   void remapIO();
00109   void parseArgsX(int argc, char** argv);
00111   void parseArgs(int argc, char** argv);
00112 
00114   void dumpMachines();
00115 #ifdef CCAFE_SOCKETS
00116 
00117   /*CDELETE*/ ClientServerSocket* setupSockets();
00118 #endif // CCAFE_SOCKETS
00119   int main(int argc, char** argv, StaticFactory *sf = 0);
00121   void setName(char *name);
00123   void setRank(int rank);
00125   void setSize(int size);
00127   void setComm(int64_t fComm);
00128 
00129   void setInitRunType(runtype_ runType);
00130         void setUseMPI(bool b);
00131         bool getUseMPI();
00132 };
00133 
00134 
00135 
00136 
00137 #endif //CmdLineClient_h_seen