TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
c10d.h
1 #ifndef C10D_H
2 #define C10D_H
3 
4 #ifdef HAVE_C10D
5 #include <c10d/ProcessGroup.hpp>
6 #include <c10d/Store.hpp>
7 #include <c10d/Types.hpp>
8 #else
9 // Basic c10d stub to get at least autocompletion working
10 #include <chrono>
11 #include <string>
12 #include <vector>
13 
14 namespace c10d {
15 struct Store {
16  virtual ~Store() = default;
17  virtual void set(
18  const std::string& key,
19  const std::vector<uint8_t>& value) = 0;
20  virtual std::vector<uint8_t> get(const std::string& key) = 0;
21  virtual int64_t add(const std::string& key, int64_t value) = 0;
22  virtual bool check(const std::vector<std::string>& keys) = 0;
23  virtual void wait(const std::vector<std::string>& keys) = 0;
24  virtual void wait(
25  const std::vector<std::string>& keys,
26  const std::chrono::milliseconds& timeout) = 0;
27  void setTimeout(const std::chrono::seconds&) {}
28 };
29 struct ProcessGroup {
30  struct Work;
31 };
32 enum ReduceOp {
33  SUM,
34  MIN,
35  MAX,
36 };
37 }; // namespace c10d
38 #endif
39 
40 #endif // C10D_H
virtual bool check(const std::vector< std::string > &keys)=0
Definition: c10d.h:34
Definition: c10d.h:29
Definition: c10d.h:33
void setTimeout(const std::chrono::seconds &)
Definition: c10d.h:27
Definition: c10d.h:14
virtual void wait(const std::vector< std::string > &keys)=0
virtual int64_t add(const std::string &key, int64_t value)=0
Definition: c10d.h:35
Definition: c10d.h:15
virtual ~Store()=default
ReduceOp
Definition: c10d.h:32