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 10 kB

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