mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
feat(ofi): Require asiofi 0.5
* Modernize some ofi transport code along the way * Replace Boost.Container with `<memory_resource>` * Introduce namespaced headers * `<fairmq/Channel.h>` * `<fairmq/Message.h>` * `<fairmq/Poller.h>` * `<fairmq/Socket.h>` * `<fairmq/TransportFactory.h>` * `<fairmq/UnmanagedRegion.h>` * Compile-firewall Boost.Process in `shmem::Manager` because it conflicts with standalone asio
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* Copyright (C) 2014-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||
#include <boost/interprocess/sync/named_condition.hpp>
|
||||
#include <boost/interprocess/sync/named_mutex.hpp>
|
||||
#include <boost/process.hpp>
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#include <condition_variable>
|
||||
@@ -220,6 +219,10 @@ class Manager
|
||||
Manager(const Manager&) = delete;
|
||||
Manager operator=(const Manager&) = delete;
|
||||
|
||||
private:
|
||||
static bool SpawnShmMonitor(const std::string& id);
|
||||
|
||||
public:
|
||||
static void StartMonitor(const std::string& id)
|
||||
{
|
||||
using namespace boost::interprocess;
|
||||
@@ -228,25 +231,8 @@ class Manager
|
||||
LOG(debug) << "Found fairmq-shmmonitor for shared memory id " << id;
|
||||
} catch (interprocess_exception&) {
|
||||
LOG(debug) << "no fairmq-shmmonitor found for shared memory id " << id << ", starting...";
|
||||
auto env = boost::this_process::environment();
|
||||
|
||||
std::vector<boost::filesystem::path> ownPath = boost::this_process::path();
|
||||
|
||||
if (const char* fmqp = getenv("FAIRMQ_PATH")) {
|
||||
ownPath.insert(ownPath.begin(), boost::filesystem::path(fmqp));
|
||||
}
|
||||
|
||||
boost::filesystem::path p = boost::process::search_path("fairmq-shmmonitor", ownPath);
|
||||
|
||||
bool verbose = false;
|
||||
if (const char* verboseEnv = getenv("FAIRMQ_SHMMONITOR_VERBOSE")) {
|
||||
if (std::string(verboseEnv) == "true") {
|
||||
verbose = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!p.empty()) {
|
||||
boost::process::spawn(p, "-x", "-m", "--shmid", id, "-d", "-t", "2000", (verbose ? "--verbose" : ""), env);
|
||||
if (SpawnShmMonitor(id)) {
|
||||
int numTries = 0;
|
||||
do {
|
||||
try {
|
||||
@@ -261,8 +247,6 @@ class Manager
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
} else {
|
||||
LOG(warn) << "could not find fairmq-shmmonitor in the path";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user