Skip to content

Commit b5e11a3

Browse files
changlaneric-haibin-lin
authored andcommittedAug 18, 2019
ibverbs_van: rename
1 parent 3c794cd commit b5e11a3

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed
 

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ INCPATH = -I./src -I./include -I$(DEPS_PATH)/include
2121
CFLAGS = -std=c++11 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
2222
LIBS = -pthread
2323

24-
ifdef USE_RDMA
24+
ifdef USE_IBVERBS
2525
LIBS += -lrdmacm -libverbs
26-
CFLAGS += -DDMLC_USE_RDMA
26+
CFLAGS += -DDMLC_USE_IBVERBS
2727
endif
2828

2929
ifdef ASAN

‎src/rdma_van.h ‎src/ibverbs_van.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* jiangyimin@bytedance.com (Yimin Jiang)
55
* chenjingrong@bytedance.com (Jingrong Chen)
66
*/
7-
#ifndef PS_RDMA_VAN_H_
8-
#define PS_RDMA_VAN_H_
7+
#ifndef PS_IBVERBS_VAN_H_
8+
#define PS_IBVERBS_VAN_H_
99

10-
#ifdef DMLC_USE_RDMA
10+
#ifdef DMLC_USE_IBVERBS
1111

1212
#include <errno.h>
1313
#include <fcntl.h>
@@ -478,10 +478,10 @@ struct Endpoint {
478478
}
479479
};
480480

481-
class RDMAVan : public Van {
481+
class IBVerbsVan : public Van {
482482
public:
483-
RDMAVan() {}
484-
~RDMAVan() {}
483+
IBVerbsVan() {}
484+
~IBVerbsVan() {}
485485

486486
protected:
487487
void Start(int customer_id) override {
@@ -493,7 +493,7 @@ class RDMAVan : public Van {
493493
CHECK(event_channel_) << "Create RDMA event channel failed";
494494

495495
cm_event_polling_thread_.reset(
496-
new std::thread(&RDMAVan::PollEvents, this));
496+
new std::thread(&IBVerbsVan::PollEvents, this));
497497
}
498498

499499
start_mu_.unlock();
@@ -1114,7 +1114,7 @@ class RDMAVan : public Van {
11141114
CHECK(endpoint) << "Endpoint not found.";
11151115

11161116
if (cq_polling_thread_ == nullptr) {
1117-
cq_polling_thread_.reset(new std::thread(&RDMAVan::PollCQ, this));
1117+
cq_polling_thread_.reset(new std::thread(&IBVerbsVan::PollCQ, this));
11181118
}
11191119

11201120
CHECK_EQ(endpoint->cm_id, id);
@@ -1165,5 +1165,5 @@ class RDMAVan : public Van {
11651165
}; // namespace ps
11661166
}; // namespace ps
11671167

1168-
#endif // DMLC_USE_RDMA
1169-
#endif // PS_RDMA_VAN_H_
1168+
#endif // DMLC_USE_IBVERBS
1169+
#endif // PS_IBVERBS_VAN_H_

‎src/postoffice.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Postoffice::Postoffice() {
1515

1616
void Postoffice::InitEnvironment() {
1717
const char* val = NULL;
18-
int enable_rdma = GetEnv("DMLC_ENABLE_RDMA", 0);
19-
if (enable_rdma) {
20-
LOG(INFO) << "enable RDMA for networking";
21-
van_ = Van::Create("rdma");
18+
int enable_ibverbs = GetEnv("DMLC_ENABLE_IBVERBS", 0);
19+
if (enable_ibverbs) {
20+
LOG(INFO) << "ibverbs enabled.";
21+
van_ = Van::Create("ibverbs");
2222
} else {
2323
van_ = Van::Create("zmq");
2424
}

‎src/van.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "./meta.pb.h"
1515
#include "./network_utils.h"
16-
#include "./rdma_van.h"
16+
#include "./ibverbs_van.h"
1717
#include "./resender.h"
1818
#include "./zmq_van.h"
1919

@@ -28,9 +28,9 @@ static const int kDefaultHeartbeatInterval = 0;
2828
Van* Van::Create(const std::string& type) {
2929
if (type == "zmq") {
3030
return new ZMQVan();
31-
#ifdef DMLC_USE_RDMA
32-
} else if (type == "rdma") {
33-
return new RDMAVan();
31+
#ifdef DMLC_USE_IBVERBS
32+
} else if (type == "ibverbs") {
33+
return new IBVerbsVan();
3434
#endif
3535
} else {
3636
LOG(FATAL) << "unsupported van type: " << type;

0 commit comments

Comments
 (0)
Please sign in to comment.