00001 // This is really -*- C++ -*- 00002 00003 #ifndef EvaluationRequest_h 00004 #define EvaluationRequest_h 00005 00006 #include <BIEmpi.h> 00007 #include <cc++/thread.h> 00008 #include <stdio.h> // for sprintf 00009 #include <TSLog.h> 00010 #include "ElapsedTime.h" 00011 #include <vector> 00012 using namespace std; 00013 using namespace ost; 00014 00015 namespace BIE { 00016 00018 class EvaluationRequest { 00019 public: 00021 EvaluationRequest() { 00022 sent = false; 00023 received = false; 00024 } 00026 virtual ~EvaluationRequest(){} 00027 00029 virtual void Send(int destination, vector<MPI_Comm>* comms)=0; 00030 00032 virtual void Recv(MPI_Status *status)=0; 00033 00035 virtual void WaitForCompletion() 00036 { finished->wait();} 00037 00038 00040 TSLog log; 00041 00043 void LogIt(const char* buf) { log.LogIt(buf);} 00045 void LogInt(const char* buf, int i) { log.LogInt(buf, i);} 00047 void LogDouble(const char* buf, double d) { log.LogDouble(buf, d);} 00049 void PrintLog() { log.PrintIt();} 00050 00052 00053 00054 ElapsedTime sendMutexWaitTime; 00056 ElapsedTime sendCmdTime; 00058 ElapsedTime sendEvalTime; 00060 00062 bool sent; 00064 bool received; 00066 Semaphore *finished; 00067 00068 protected: 00069 00070 }; 00071 } 00072 #endif // EvaluationRequest_h