Skip to content

Commit

Permalink
rdma: another fix to improve robustness (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymjiang authored Sep 22, 2019
1 parent a6ddd1f commit 21301d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ endif


INCPATH = -I./src -I./include -I$(DEPS_PATH)/include
CFLAGS = -std=c++11 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
CFLAGS = -std=c++14 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
LIBS = -pthread

ifdef USE_RDMA
ifeq ($(USE_RDMA), 1)
LIBS += -lrdmacm -libverbs
CFLAGS += -DDMLC_USE_RDMA
endif
Expand Down Expand Up @@ -51,8 +51,8 @@ build/libps.a: $(OBJS)

build/%.o: src/%.cc ${ZMQ} src/meta.pb.h
@mkdir -p $(@D)
$(CXX) $(INCPATH) -std=c++11 -MM -MT build/$*.o $< >build/$*.d
$(CXX) $(CFLAGS) -c $< -o $@ $(LIBS)
$(CXX) $(INCPATH) -std=c++0x -MM -MT build/$*.o $< >build/$*.d
$(CXX) $(CFLAGS) $(LIBS) -c $< -o $@

src/%.pb.cc src/%.pb.h : src/%.proto ${PROTOBUF}
$(PROTOC) --cpp_out=./src --proto_path=./src $<
Expand Down
8 changes: 4 additions & 4 deletions src/rdma_van.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ class RDMAVan : public Van {
}

Endpoint *endpoint;
endpoints_[node.id] = std::unique_ptr<Endpoint>(new Endpoint());
endpoints_[node.id] = std::make_unique<Endpoint>();
endpoint = endpoints_[node.id].get();

endpoint->SetNodeID(node.id);
Expand Down Expand Up @@ -819,8 +819,8 @@ class RDMAVan : public Van {
std::tuple<Endpoint *, BufferContext *> notification;
recv_buffers_.WaitAndPop(&notification);

Endpoint *endpoint = std::get<0>(notification);
BufferContext *buffer_ctx = std::get<1>(notification);
Endpoint *endpoint = std::get<Endpoint *>(notification);
BufferContext *buffer_ctx = std::get<BufferContext *>(notification);

int total_len = 0;

Expand Down Expand Up @@ -1199,7 +1199,7 @@ class RDMAVan : public Van {
const RequestContext *remote_ctx = reinterpret_cast<const RequestContext *>(
event->param.conn.private_data);

const auto r = incoming_.emplace(std::unique_ptr<Endpoint>(new Endpoint()));
const auto r = incoming_.emplace(std::make_unique<Endpoint>());
Endpoint *endpoint = r.first->get();
endpoint->SetNodeID(remote_ctx->node);
endpoint->cm_id = id;
Expand Down

0 comments on commit 21301d5

Please sign in to comment.