Skip to content

Commit

Permalink
Benchmark Test passed, with low performance
Browse files Browse the repository at this point in the history
  • Loading branch information
jcf94 committed Mar 29, 2019
1 parent f4b748e commit 669a51c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ LD = g++
LDFLAGS += -std=c++14

#NAME = $(wildcard *.cpp)
#NAME = benchmark.cpp
NAME = main.cpp
NAME = benchmark.cpp
#NAME = main.cpp
NAME-OBJS = $(patsubst %.cpp, %.o, $(NAME))
TARGET = $(patsubst %.cpp, %, $(NAME))

Expand Down
2 changes: 1 addition & 1 deletion benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char* argv[])

// Prepare data
int total_data = 256 * MB;
int block_data = 512 * KB;
int block_data = 4 * KB;

if (strcmp(argv[1], "s") == 0)
{
Expand Down
6 changes: 3 additions & 3 deletions src/rdma_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ RDMA_Buffer::RDMA_Buffer(RDMA_Channel* channel, ibv_pd* pd, int size, void* addr
}
} else
{
log_info("ddddddddddddddddddddd");
//log_info("ddddddddddddddddddddd");
//buffer_ = malloc(size);
memblock_ = (RDMA_MemBlock*)channel_->endpoint()->session()->mempool()->blockalloc(size);
buffer_ = memblock_->dataaddr();
mr_ = memblock_->mr();
buffer_owned_ = true;
channel_->endpoint()->session()->mempool()->travel();
//channel_->endpoint()->session()->mempool()->travel();
}

log_info("RDMA_Buffer Created");
Expand All @@ -45,7 +45,7 @@ RDMA_Buffer::~RDMA_Buffer()
{
//free(buffer_);
memblock_->free();
channel_->endpoint()->session()->mempool()->travel();
//channel_->endpoint()->session()->mempool()->travel();
} else
{
if (ibv_dereg_mr(mr_))
Expand Down
6 changes: 6 additions & 0 deletions src/rdma_memorypool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ RDMA_MemBlock::~RDMA_MemBlock()
{
log_error("ibv_dereg_mr failed");
}

if (size_ > 0) ::free(blockaddr_);
log_info("RDMA_MemBlock Deleted");
}

Expand Down Expand Up @@ -55,5 +57,9 @@ RDMA_MemoryPool::RDMA_MemoryPool(ibv_pd* pd)

RDMA_MemoryPool::~RDMA_MemoryPool()
{
for (auto i:bllist_)
{

}
log_info("RDMA_MemoryPool Deleted");
}
2 changes: 1 addition & 1 deletion utils/MemoryPool

0 comments on commit 669a51c

Please sign in to comment.