You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ps_lite.patch001 9.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. diff -Npur ps-lite-master/include/dmlc/base.h ps-lite-master-new/include/dmlc/base.h
  2. --- ps-lite-master/include/dmlc/base.h 2020-02-29 13:59:55.000000000 +0800
  3. +++ ps-lite-master-new/include/dmlc/base.h 2020-07-01 11:56:50.444833389 +0800
  4. @@ -8,7 +8,7 @@
  5. /*! \brief whether use glog for logging */
  6. #ifndef DMLC_USE_GLOG
  7. -#define DMLC_USE_GLOG 0
  8. +#define DMLC_USE_GLOG 1
  9. #endif
  10. /*!
  11. diff -Npur ps-lite-master/include/dmlc/logging.h ps-lite-master-new/include/dmlc/logging.h
  12. --- ps-lite-master/include/dmlc/logging.h 2020-02-29 13:59:55.000000000 +0800
  13. +++ ps-lite-master-new/include/dmlc/logging.h 2020-07-08 21:35:33.334584767 +0800
  14. @@ -52,7 +52,7 @@ struct Error : public std::runtime_error
  15. namespace dmlc {
  16. inline void InitLogging(const char* argv0) {
  17. - google::InitGoogleLogging(argv0);
  18. + //google::InitGoogleLogging(argv0);
  19. }
  20. } // namespace dmlc
  21. diff -Npur ps-lite-master/make/deps.mk ps-lite-master-new/make/deps.mk
  22. --- ps-lite-master/make/deps.mk 2020-02-29 13:59:55.000000000 +0800
  23. +++ ps-lite-master-new/make/deps.mk 2020-06-17 10:35:46.253837426 +0800
  24. @@ -1,69 +1,7 @@
  25. # Install dependencies
  26. -
  27. -URL1=https://raw.githubusercontent.com/mli/deps/master/build
  28. -URL2=https://github.com/google/protobuf/releases/download/v3.5.1
  29. -ifndef WGET
  30. -WGET = wget
  31. -endif
  32. -
  33. -# protobuf
  34. -PROTOBUF = ${DEPS_PATH}/include/google/protobuf/message.h
  35. -${PROTOBUF}:
  36. - $(eval FILE=protobuf-cpp-3.5.1.tar.gz)
  37. - $(eval DIR=protobuf-3.5.1)
  38. - rm -rf $(FILE) $(DIR)
  39. - $(WGET) $(URL2)/$(FILE) && tar --no-same-owner -zxf $(FILE)
  40. - cd $(DIR) && export CFLAGS=-fPIC && export CXXFLAGS=-fPIC && ./configure -prefix=$(DEPS_PATH) && $(MAKE) && $(MAKE) install
  41. - rm -rf $(FILE) $(DIR)
  42. -
  43. # zmq
  44. -ZMQ = ${DEPS_PATH}/include/zmq.h
  45. +ZMQ = $(MS_ZMQ_INSTALL_PATH)/lib/libzmq.a
  46. ${ZMQ}:
  47. - $(eval FILE=zeromq-4.1.4.tar.gz)
  48. - $(eval DIR=zeromq-4.1.4)
  49. - rm -rf $(FILE) $(DIR)
  50. - $(WGET) $(URL1)/$(FILE) && tar --no-same-owner -zxf $(FILE)
  51. - cd $(DIR) && export CFLAGS=-fPIC && export CXXFLAGS=-fPIC && ./configure -prefix=$(DEPS_PATH) --with-libsodium=no --with-libgssapi_krb5=no && $(MAKE) && $(MAKE) install
  52. - rm -rf $(FILE) $(DIR)
  53. -
  54. -# lz4
  55. -LZ4 = ${DEPS_PATH}/include/lz4.h
  56. -${LZ4}:
  57. - $(eval FILE=lz4-r129.tar.gz)
  58. - $(eval DIR=lz4-r129)
  59. - rm -rf $(FILE) $(DIR)
  60. - wget $(URL1)/$(FILE) && tar --no-same-owner -zxf $(FILE)
  61. - cd $(DIR) && $(MAKE) && PREFIX=$(DEPS_PATH) $(MAKE) install
  62. - rm -rf $(FILE) $(DIR)
  63. -
  64. -# cityhash
  65. -CITYHASH = ${DEPS_PATH}/include/city.h
  66. -${CITYHASH}:
  67. - $(eval FILE=cityhash-1.1.1.tar.gz)
  68. - $(eval DIR=cityhash-1.1.1)
  69. - rm -rf $(FILE) $(DIR)
  70. - wget $(URL1)/$(FILE) && tar --no-same-owner -zxf $(FILE)
  71. - cd $(DIR) && ./configure -prefix=$(DEPS_PATH) --enable-sse4.2 && $(MAKE) CXXFLAGS="-g -O3 -msse4.2" && $(MAKE) install
  72. - rm -rf $(FILE) $(DIR)
  73. -
  74. -
  75. -# # gflags
  76. -# ${DEPS_PATH}/include/google/gflags.h:
  77. -# $(eval FILE=gflags-2.0-no-svn-files.tar.gz)
  78. -# $(eval DIR=gflags-2.0)
  79. -# rm -rf $(FILE) $(DIR)
  80. -# wget $(URL)/$(FILE) && tar -zxf $(FILE)
  81. -# cd $(DIR) && ./configure -prefix=$(DEPS_PATH) && $(MAKE) && $(MAKE) install
  82. -# rm -rf $(FILE) $(DIR)
  83. -# gflags: | ${DEPS_PATH}/include/google/gflags.h
  84. + cd $(MS_ZMQ_DIR) && export CFLAGS="-fPIC -D_GLIBCXX_USE_CXX11_ABI=0" && export CXXFLAGS=-fPIC && ./configure -prefix=$(MS_ZMQ_INSTALL_PATH) --with-libsodium=no --with-libgssapi_krb5=no && $(MAKE) && $(MAKE) install
  85. -# # glog
  86. -# ${DEPS_PATH}/include/glog/logging.h: | ${DEPS_PATH}/include/google/gflags.h
  87. -# $(eval FILE=v0.3.4.tar.gz)
  88. -# $(eval DIR=glog-0.3.4)
  89. -# rm -rf $(FILE) $(DIR)
  90. -# wget https://github.com/google/glog/archive/$(FILE) && tar -zxf $(FILE)
  91. -# cd $(DIR) && ./configure -prefix=$(DEPS_PATH) --with-gflags=$(DEPS_PATH) && $(MAKE) && $(MAKE) install
  92. -# rm -rf $(FILE) $(DIR)
  93. -# glog: | ${DEPS_PATH}/include/glog/logging.h
  94. diff -Npur ps-lite-master/make/ps.mk ps-lite-master-new/make/ps.mk
  95. --- ps-lite-master/make/ps.mk 2020-02-29 13:59:55.000000000 +0800
  96. +++ ps-lite-master-new/make/ps.mk 2020-06-05 09:28:35.337740291 +0800
  97. @@ -9,5 +9,5 @@ ifeq ($(USE_KEY32), 1)
  98. ADD_CFLAGS += -DUSE_KEY32=1
  99. endif
  100. -PS_LDFLAGS_SO = -L$(DEPS_PATH)/lib -lprotobuf-lite -lzmq
  101. -PS_LDFLAGS_A = $(addprefix $(DEPS_PATH)/lib/, libprotobuf-lite.a libzmq.a)
  102. +PS_LDFLAGS_SO = -L$(MS_ZMQ_INSTALL_PATH)/lib -lzmq -L$(MS_PROTO_LIB_DIR) -lprotobuf-lite
  103. +PS_LDFLAGS_A = $(addprefix $(MS_ZMQ_INSTALL_PATH)/lib -L$(MS_PROTO_LIB_DIR), libprotobuf-lite.a libzmq.a)
  104. diff -Npur ps-lite-master/Makefile ps-lite-master-new/Makefile
  105. --- ps-lite-master/Makefile 2020-02-29 13:59:55.000000000 +0800
  106. +++ ps-lite-master-new/Makefile 2020-06-17 11:09:20.240322660 +0800
  107. @@ -12,13 +12,24 @@ ifndef DEPS_PATH
  108. DEPS_PATH = $(shell pwd)/deps
  109. endif
  110. +MS_PROTO_DIR = @protobuf_DIRPATH@
  111. +MS_GLOG_DIR = @glog_DIRPATH@
  112. +MS_ZMQ_DIR = @zeromq_DIRPATH@
  113. +
  114. +MS_PROTO_LIB_DIR = @protobuf_LIBPATH@
  115. +MS_GLOG_LIB_DIR = @glog_LIBPATH@
  116. +MS_ZMQ_INSTALL_PATH = $(MS_ZMQ_DIR)/zmq_install
  117. ifndef PROTOC
  118. -PROTOC = ${DEPS_PATH}/bin/protoc
  119. +PROTOC = $(MS_PROTO_DIR)/bin/protoc
  120. endif
  121. -INCPATH = -I./src -I./include -I$(DEPS_PATH)/include
  122. -CFLAGS = -std=c++11 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
  123. +INCPATH = -I./src -I./include -I$(MS_ZMQ_INSTALL_PATH)/include
  124. +INCPATH += -I$(MS_PROTO_DIR)/include
  125. +INCPATH += -I$(MS_GLOG_DIR)/include
  126. +
  127. +CXXFLAGS = -D_GLIBCXX_USE_CXX11_ABI=0
  128. +CFLAGS = -std=c++11 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS) -D_GLIBCXX_USE_CXX11_ABI=0
  129. LIBS = -pthread
  130. ifdef USE_IBVERBS
  131. @@ -30,6 +41,7 @@ ifdef ASAN
  132. CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls
  133. endif
  134. +LIBS += -L$(MS_GLOG_LIB_DIR) -lglog
  135. all: ps test
  136. @@ -51,9 +63,9 @@ build/libps.a: $(OBJS)
  137. build/%.o: src/%.cc ${ZMQ} src/meta.pb.h
  138. @mkdir -p $(@D)
  139. $(CXX) $(INCPATH) -std=c++11 -MM -MT build/$*.o $< >build/$*.d
  140. - $(CXX) $(CFLAGS) $(LIBS) -c $< -o $@
  141. + $(CXX) $(CFLAGS) $(CXXFLAGS) $(LIBS) -c $< -o $@
  142. -src/%.pb.cc src/%.pb.h : src/%.proto ${PROTOBUF}
  143. +src/%.pb.cc src/%.pb.h : src/%.proto
  144. $(PROTOC) --cpp_out=./src --proto_path=./src $<
  145. -include build/*.d
  146. diff -Npur ps-lite-master/src/ibverbs_van.h ps-lite-master-new/src/ibverbs_van.h
  147. --- ps-lite-master/src/ibverbs_van.h 2020-02-29 13:59:55.000000000 +0800
  148. +++ ps-lite-master-new/src/ibverbs_van.h 2020-06-02 20:52:11.076230014 +0800
  149. @@ -145,15 +145,15 @@ class SimpleMempool {
  150. total_allocated_size += new_mem_size;
  151. }
  152. - CHECK_NE(free_list.end(), it) << "Not enough memory";
  153. + //CHECK_NE(free_list.end(), it) << "Not enough memory";
  154. CHECK_GE(it->first, proper_size);
  155. char *addr = it->second;
  156. size_t space_left = it->first - proper_size;
  157. free_list.erase(it);
  158. - CHECK_EQ(used_list.find(addr), used_list.end())
  159. - << "Address is already allocated";
  160. + //CHECK_EQ(used_list.find(addr), used_list.end())
  161. + //<< "Address is already allocated";
  162. used_list.emplace(addr, proper_size);
  163. @@ -173,8 +173,8 @@ class SimpleMempool {
  164. std::lock_guard<std::mutex> lk(mu_);
  165. auto it = used_list.find(addr);
  166. - CHECK_NE(used_list.end(), it)
  167. - << "Cannot find info about address: " << (uintptr_t)addr;
  168. + //CHECK_NE(used_list.end(), it)
  169. + //<< "Cannot find info about address: " << (uintptr_t)addr;
  170. size_t size = it->second;
  171. used_list.erase(it);
  172. @@ -208,7 +208,7 @@ class SimpleMempool {
  173. // Convert the memory address to its associated RDMA memory region
  174. inline struct ibv_mr *Addr2MR(char *addr) {
  175. auto it = mr_list.lower_bound(addr);
  176. - CHECK_NE(it, mr_list.end()) << "cannot find the associated memory region";
  177. + //CHECK_NE(it, mr_list.end()) << "cannot find the associated memory region";
  178. return it->second;
  179. }
  180. };
  181. @@ -330,7 +330,7 @@ class AddressPool {
  182. CHECK(ptr);
  183. uint32_t idx = indices_.front();
  184. indices_.pop();
  185. - CHECK_EQ(table_[idx], nullptr);
  186. + //CHECK_EQ(table_[idx], nullptr);
  187. table_[idx] = ptr;
  188. return idx;
  189. }
  190. @@ -636,7 +636,7 @@ class IBVerbsVan : public Van {
  191. PBMeta meta;
  192. PackMetaPB(msg.meta, &meta);
  193. - CHECK_NE(endpoints_.find(remote_id), endpoints_.end());
  194. + //CHECK_NE(endpoints_.find(remote_id), endpoints_.end());
  195. Endpoint *endpoint = endpoints_[remote_id].get();
  196. MessageBuffer *msg_buf = new MessageBuffer();
  197. diff -Npur ps-lite-master/src/van.cc ps-lite-master-new/src/van.cc
  198. --- ps-lite-master/src/van.cc 2020-02-29 13:59:55.000000000 +0800
  199. +++ ps-lite-master-new/src/van.cc 2020-06-02 20:52:43.330405828 +0800
  200. @@ -448,6 +448,7 @@ void Van::PackMetaPB(const Meta& meta, P
  201. if (meta.timestamp != Meta::kEmpty) pb->set_timestamp(meta.timestamp);
  202. if (meta.body.size()) pb->set_body(meta.body);
  203. pb->set_push(meta.push);
  204. + pb->set_pull(meta.pull);
  205. pb->set_request(meta.request);
  206. pb->set_simple_app(meta.simple_app);
  207. pb->set_priority(meta.priority);
  208. diff -Npur ps-lite-master/tests/test.mk ps-lite-master-new/tests/test.mk
  209. --- ps-lite-master/tests/test.mk 2020-02-29 13:59:55.000000000 +0800
  210. +++ ps-lite-master-new/tests/test.mk 2020-06-16 19:15:06.025087897 +0800
  211. @@ -1,10 +1,10 @@
  212. -TEST_SRC = $(wildcard tests/test_*.cc)
  213. -TEST = $(patsubst tests/test_%.cc, tests/test_%, $(TEST_SRC))
  214. +#TEST_SRC = $(wildcard tests/test_*.cc)
  215. +#TEST = $(patsubst tests/test_%.cc, tests/test_%, $(TEST_SRC))
  216. -# -ltcmalloc_and_profiler
  217. -LDFLAGS = -Wl,-rpath,$(DEPS_PATH)/lib $(PS_LDFLAGS_SO) -pthread
  218. -tests/% : tests/%.cc build/libps.a
  219. - $(CXX) $(CFLAGS) $(LIBS) -MM -MT tests/$* $< >tests/$*.d
  220. - $(CXX) $(CFLAGS) $(LIBS) -o $@ $(filter %.cc %.a, $^) $(LDFLAGS)
  221. -
  222. --include tests/*.d
  223. +## -ltcmalloc_and_profiler
  224. +#LDFLAGS = -Wl,-rpath,$(DEPS_PATH)/lib $(PS_LDFLAGS_SO) -pthread
  225. +#tests/% : tests/%.cc build/libps.a
  226. +# $(CXX) $(CFLAGS) $(LIBS) -MM -MT tests/$* $< >tests/$*.d
  227. +# $(CXX) $(CFLAGS) $(LIBS) -o $@ $(filter %.cc %.a, $^) $(LDFLAGS)
  228. +#
  229. +#-include tests/*.d