Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libfabric refactor with curiously recurring template pattern #37

Draft
wants to merge 94 commits into
base: master
Choose a base branch
from

Conversation

mattnappo
Copy link
Collaborator

This branch provides a refactor of the original libfabric implementation. The code here branched off of libfabric-sarus.

This PR removes the #ifdef USE_LIBFABRIC flags in almost all places. We use the curiously recurring template pattern (CRTP) to switch between the verbs and libfabric implementations during template instantiation at compile time. See my final report here for more details.

Note that the current state of this branch is broken. The linker is failing:

[ 38%] Linking CXX executable bin/executor
/usr/bin/cmake -E cmake_link_script CMakeFiles/executor.dir/link.txt --verbose=1
/usr/bin/g++  -Wall -Wextra  -pthread -g -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG  CMakeFiles/executor.dir/server/executor/cli.cpp.o CMakeFiles/executor.dir/se
rver/executor/fast_executor.cpp.o CMakeFiles/executor.dir/server/executor/functions.cpp.o -o bin/executor  _deps/spdlog-build/libspdlogd.a librdmalib.a librfaa
slib.a -ldl librdmalib.a _deps/spdlog-build/libspdlogd.a /usr/lib/x86_64-linux-gnu/libfabric.so /usr/lib/x86_64-linux-gnu/librdmacm.so /usr/lib/x86_64-linux-gn
u/libibverbs.so
/usr/bin/ld: CMakeFiles/executor.dir/server/executor/fast_executor.cpp.o: in function `server::LibfabricThread::thread_work(int)':
/home/ubuntu/rfaas-refactor/server/executor/fast_executor.cpp:360: undefined reference to `rdmalib::LibfabricScatterGatherElement::LibfabricScatterGatherElemen
t()'
/usr/bin/ld: /home/ubuntu/rfaas-refactor/server/executor/fast_executor.cpp:384: undefined reference to `rdmalib::LibfabricScatterGatherElement::LibfabricScatte
rGatherElement()'
/usr/bin/ld: CMakeFiles/executor.dir/server/executor/fast_executor.cpp.o: in function `server::VerbsThread::thread_work(int)':
/home/ubuntu/rfaas-refactor/server/executor/fast_executor.cpp:438: undefined reference to `rdmalib::VerbsScatterGatherElement::VerbsScatterGatherElement()'
/usr/bin/ld: /home/ubuntu/rfaas-refactor/server/executor/fast_executor.cpp:469: undefined reference to `rdmalib::VerbsScatterGatherElement::VerbsScatterGatherE
lement()'
/usr/bin/ld: CMakeFiles/executor.dir/server/executor/fast_executor.cpp.o: in function `rdmalib::impl::Buffer<rdmalib::Buffer<char, ibverbs>, ibverbs>::sge(unsi
gned int, unsigned int) const':
/home/ubuntu/rfaas-refactor/rdmalib/include/rdmalib/buffer.hpp:77: undefined reference to `rdmalib::VerbsScatterGatherElement::VerbsScatterGatherElement(unsign
ed long, unsigned int, unsigned int)'

these messages continue ...

We might need to link both ibverbs and libfabric in order to build the binary, which is not desirable. There might be a way around this, though.

rfaaslib and rdmalib do successfully link and compile. However, since the executor does not currently link, I was unable to execute or run end-to-end tests of rFaaS on the CSCS machines, which is why I am opening this PR as a draft.

While refactoring, I did not change any program semantics. There are no architecture changes or optimizations. This was merely a source code transformation, and does not change how rFaaS actually works. I just swapped the conditional compilation pattern from using #ifdefs to using CRTP, which is much more sustainable in the long term.

See #36 for some initial code review and requested changes. Hopefully we'll get this code up and running soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants