Skip to content

Commit

Permalink
Rename compile definitions to avoid conflicts with source code.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuveland committed Jan 26, 2017
1 parent 7305bb7 commit 62b68f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions app/flesnet/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Application::Application(Parameters const& par,
signal_status_));
timeslice_builders_zeromq_.push_back(std::move(builder));
} else if (par_.transport() == Transport::LibFabric) {
#ifdef LIBFABRIC
#ifdef HAVE_LIBFABRIC
std::unique_ptr<tl_libfabric::TimesliceBuilder> builder(
new tl_libfabric::TimesliceBuilder(
i, *tsb, par_.base_port() + i, input_nodes_size,
Expand All @@ -90,7 +90,7 @@ Application::Application(Parameters const& par,
L_(fatal) << "flesnet built without LIBFABRIC support";
#endif
} else {
#ifdef RDMA
#ifdef HAVE_RDMA
std::unique_ptr<TimesliceBuilder> builder(new TimesliceBuilder(
i, *tsb, par_.base_port() + i, input_nodes_size,
par_.timeslice_size(), signal_status_, false));
Expand Down Expand Up @@ -149,7 +149,7 @@ Application::Application(Parameters const& par,
par.max_timeslice_number(), signal_status_));
component_senders_zeromq_.push_back(std::move(sender));
} else if (par_.transport() == Transport::LibFabric) {
#ifdef LIBFABRIC
#ifdef HAVE_LIBFABRIC
std::unique_ptr<tl_libfabric::InputChannelSender> sender(
new tl_libfabric::InputChannelSender(
index, *(data_sources_.at(c).get()), par.compute_nodes(),
Expand All @@ -160,7 +160,7 @@ Application::Application(Parameters const& par,
L_(fatal) << "flesnet built without LIBFABRIC support";
#endif
} else {
#ifdef RDMA
#ifdef HAVE_RDMA
std::unique_ptr<InputChannelSender> sender(new InputChannelSender(
index, *(data_sources_.at(c).get()), par.compute_nodes(),
compute_services, par.timeslice_size(), par.overlap_size(),
Expand All @@ -179,7 +179,7 @@ void Application::run()
{
// Do not spawn additional thread if only one is needed, simplifies
// debugging
#if defined(RDMA) || defined(LIBFABRIC)
#if defined(HAVE_RDMA) || defined(HAVE_LIBFABRIC)
if (timeslice_builders_.size() == 1 && input_channel_senders_.empty()) {
L_(debug) << "using existing thread for single timeslice builder";
(*timeslice_builders_[0])();
Expand All @@ -197,7 +197,7 @@ void Application::run()
std::vector<boost::unique_future<void>> futures;
bool stop = false;

#if defined(RDMA) || defined(LIBFABRIC)
#if defined(HAVE_RDMA) || defined(HAVE_LIBFABRIC)
for (auto& buffer : timeslice_builders_) {
boost::packaged_task<void> task(std::ref(*buffer));
futures.push_back(task.get_future());
Expand Down
6 changes: 3 additions & 3 deletions app/flesnet/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "TimesliceBuffer.hpp"
#include "TimesliceBuilderZeromq.hpp"
#include "shm_device_client.hpp"
#if defined(RDMA)
#if defined(HAVE_RDMA)
#include "fles_rdma/InputChannelSender.hpp"
#include "fles_rdma/TimesliceBuilder.hpp"
#endif
#if defined(LIBFABRIC)
#if defined(HAVE_LIBFABRIC)
#include "fles_libfabric/InputChannelSender.hpp"
#include "fles_libfabric/TimesliceBuilder.hpp"
#endif
Expand Down Expand Up @@ -52,7 +52,7 @@ class Application : public ThreadContainer
std::vector<std::unique_ptr<InputBufferReadInterface>> data_sources_;
std::vector<std::unique_ptr<TimesliceBuffer>> timeslice_buffers_;

#if defined(RDMA) || defined(LIBFABRIC)
#if defined(HAVE_RDMA) || defined(HAVE_LIBFABRIC)
/// The application's RDMA or libfabric transport objects
std::vector<std::unique_ptr<ConnectionGroupWorker>> timeslice_builders_;
std::vector<std::unique_ptr<ConnectionGroupWorker>> input_channel_senders_;
Expand Down
4 changes: 2 additions & 2 deletions app/flesnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ target_link_libraries(flesnet
)

if (USE_RDMA AND RDMA_FOUND)
target_compile_definitions(flesnet PUBLIC RDMA)
target_compile_definitions(flesnet PUBLIC HAVE_RDMA)
target_link_libraries(flesnet fles_rdma)
endif()

if (USE_LIBFABRIC AND LIBFABRIC_FOUND)
target_compile_definitions(flesnet PUBLIC LIBFABRIC)
target_compile_definitions(flesnet PUBLIC HAVE_LIBFABRIC)
target_link_libraries(flesnet fles_libfabric)
endif()

Expand Down
4 changes: 2 additions & 2 deletions app/flesnet/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@ void Parameters::parse_options(int argc, char* argv[])
throw ParametersException("timeslice size cannot be zero");
}

#ifndef RDMA
#ifndef HAVE_RDMA
if (transport_ == Transport::RDMA) {
throw ParametersException("flesnet built without RDMA support");
}
#endif
#ifndef LIBFABRIC
#ifndef HAVE_LIBFABRIC
if (transport_ == Transport::LibFabric) {
throw ParametersException("flesnet built without LIBFABRIC support");
}
Expand Down

0 comments on commit 62b68f8

Please sign in to comment.