00001 #ifndef BARRIER_H
00002 #define BARRIER_H
00003 #include <string>
00004 #include <vector>
00005
00006 class Barrier
00007 {
00008 private:
00009 std::string name;
00010 std::vector<bool> nodes;
00011
00012 public:
00013 static std::string currentBarrier;
00014
00015 public:
00016 Barrier(const char *bname, int node_num);
00017
00018 bool CheckBarrierReached(int delay = 100);
00019
00020
00021
00022 static void SendAck(void);
00023
00024 static bool WaitGoAhead(int delay = 100);
00025
00026 static bool WaitForBarrier(std::string bname, int delay = 100);
00027
00028 private:
00029
00030 void sendGoAhead(void);
00031
00032 };
00033
00034 #endif