Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Oct 27, 2021
1 parent 59f969b commit b4e83f4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/scheduler/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <faabric/util/macros.h>
#include <faabric/util/memory.h>
#include <faabric/util/queue.h>
#include <faabric/util/tracing.h>
#include <faabric/util/timing.h>
#include <faabric/util/tracing.h>

#define POOL_SHUTDOWN -1

Expand Down
6 changes: 4 additions & 2 deletions src/scheduler/MpiWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,10 @@ void MpiWorld::send(int sendRank,
}

// In non-release builds, track that we have sent this message
faabric::util::tracing::getCallRecords().addRecord(thisMsgId,
faabric::util::tracing::RecordType::MpiPerRankMessageCount, recvRank);
faabric::util::tracing::getCallRecords().addRecord(
thisMsgId,
faabric::util::tracing::RecordType::MpiPerRankMessageCount,
recvRank);
}

void MpiWorld::recv(int sendRank,
Expand Down
22 changes: 14 additions & 8 deletions src/util/tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ void CallRecords::startRecording(const faabric::Message& msg)
{
#ifndef NDEBUG
if (linkedMsg != nullptr && linkedMsg->id() != msg.id()) {
SPDLOG_ERROR("CallRecords already linked to a different message: (linked: {} != provided: {})",
linkedMsg->id(), msg.id());
SPDLOG_ERROR("CallRecords already linked to a different message: "
"(linked: {} != provided: {})",
linkedMsg->id(),
msg.id());
throw std::runtime_error("CallRecords linked to a different message");
} else if (linkedMsg == nullptr) {
linkedMsg = std::make_shared<faabric::Message>(msg);
Expand All @@ -21,8 +23,10 @@ void CallRecords::stopRecording(faabric::Message& msg)
{
#ifndef NDEBUG
if (linkedMsg == nullptr || linkedMsg->id() != msg.id()) {
SPDLOG_ERROR("CallRecords not linked to the right message: (linked: {} != provided: {})",
linkedMsg->id(), msg.id());
SPDLOG_ERROR("CallRecords not linked to the right message: (linked: {} "
"!= provided: {})",
linkedMsg->id(),
msg.id());
throw std::runtime_error("CallRecords linked to a different message");
}

Expand Down Expand Up @@ -72,14 +76,17 @@ void CallRecords::addRecord(int msgId, RecordType recordType, int idToIncrement)
#ifndef NDEBUG
// Check message id
if (linkedMsg == nullptr || linkedMsg->id() != msgId) {
SPDLOG_ERROR("CallRecords not linked to the right message: (linked: {} != provided: {})",
linkedMsg->id(), msgId);
SPDLOG_ERROR("CallRecords not linked to the right message: (linked: {} "
"!= provided: {})",
linkedMsg->id(),
msgId);
throw std::runtime_error("CallRecords linked to a different message");
}

// Add the record to the list of on going records if it is not there
bool mustInit = false;
auto it = std::find(onGoingRecordings.begin(), onGoingRecordings.end(), recordType);
auto it =
std::find(onGoingRecordings.begin(), onGoingRecordings.end(), recordType);
if (it == onGoingRecordings.end()) {
onGoingRecordings.push_back(recordType);
mustInit = true;
Expand Down Expand Up @@ -107,7 +114,6 @@ void CallRecords::addRecord(int msgId, RecordType recordType, int idToIncrement)
#endif
}


CallRecords& getCallRecords()
{
static thread_local CallRecords callRecords;
Expand Down

0 comments on commit b4e83f4

Please sign in to comment.