mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4218c185a4 | ||
|
5a49c5b9b1 |
@@ -183,7 +183,6 @@ Region* Manager::GetRegionUnsafe(const uint64_t id)
|
||||
// LOG(debug) << "Located remote region with id '" << id << "', path: '" << path << "', flags: '" << flags << "'";
|
||||
|
||||
auto r = fRegions.emplace(id, tools::make_unique<Region>(*this, id, 0, true, nullptr, path, flags));
|
||||
r.first->second->StartSendingAcks();
|
||||
return r.first->second.get();
|
||||
} catch (bie& e) {
|
||||
LOG(warn) << "Could not get remote region for id: " << id;
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <cerrno>
|
||||
#include <chrono>
|
||||
#include <ios>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -49,7 +50,17 @@ Region::Region(Manager& manager, uint64_t id, uint64_t size, bool remote, Region
|
||||
if (path != "") {
|
||||
fName = string(path + fName);
|
||||
|
||||
fFile = fopen(fName.c_str(), fRemote ? "r+" : "w+");
|
||||
if (!fRemote) {
|
||||
// create a file
|
||||
filebuf fbuf;
|
||||
if (fbuf.open(fName, ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary)) {
|
||||
// set the size
|
||||
fbuf.pubseekoff(size - 1, ios_base::beg);
|
||||
fbuf.sputc(0);
|
||||
}
|
||||
}
|
||||
|
||||
fFile = fopen(fName.c_str(), "r+");
|
||||
|
||||
if (!fFile) {
|
||||
LOG(error) << "Failed to initialize file: " << fName;
|
||||
@@ -70,6 +81,7 @@ Region::Region(Manager& manager, uint64_t id, uint64_t size, bool remote, Region
|
||||
}
|
||||
|
||||
InitializeQueues();
|
||||
StartSendingAcks();
|
||||
LOG(debug) << "shmem: initialized region: " << fName;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user