Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Expand Down Expand Up @@ -134,4 +134,3 @@ TabWidth: 8
UseCRLF: false
UseTab: Never
...

36 changes: 16 additions & 20 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,24 @@ fi


# Format all .cpp and .hpp files
for file in $(git diff --cached --name-only | grep -E '\.cpp$|\.hpp$'); do
# Check if the file exists
if [ ! -f $file ]; then
continue
# We use 'git diff-index' to avoid issues with spaces in filenames
git diff --cached --name-only --diff-filter=ACM $against | grep -E '\.(cpp|hpp)$' | while read -r file; do
if [ -f "$file" ]; then
# Apply clang-format in-place
clang-format -i "$file"
# Re-add the file to the commit to include the formatting changes
git add "$file"
fi
git add $file
done

# Remove trailing whitespace from all files (except .so)
for file in $(git diff --cached --name-only | grep -vE '\.so$'); do
# Check if the file exists
if [ ! -f $file ]; then
continue
# Remove trailing whitespace from all files (except .so and binary files)
# Using sed to remove trailing whitespace
git diff --cached --name-only --diff-filter=ACM $against | grep -vE '\.so$' | while read -r file; do
if [ -f "$file" ]; then
# Check if file is text to avoid corrupting binaries
if file "$file" | grep -q "text"; then
sed -i 's/[[:space:]]*$//' "$file"
git add "$file"
fi
fi
git add $file
done

for file in $(git diff --cached --name-only); do
# Check if the file exists
if [ ! -f $file ]; then
continue
fi
git add $file
done

32 changes: 16 additions & 16 deletions apps/test_suite_runner/StatsModules/BspCommStatsModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@ limitations under the License.

#pragma once

#include <string>
#include <vector>
#include <map>
#include "IStatsModule.hpp"
#include "osp/bsp/model/BspSchedule.hpp" // Still needed
#include "osp/bsp/model/cost/BufferedSendingCost.hpp"
#include "osp/bsp/model/cost/TotalCommunicationCost.hpp"
#include "osp/bsp/model/cost/TotalLambdaCommunicationCost.hpp"
#include <map>
#include <string>
#include <vector>

namespace osp {

template<typename Graph_t>
class BspCommStatsModule : public IStatisticModule<BspSchedule<Graph_t>> {
public:

private:
class BspCommStatsModule : public IStatisticModule<BspSchedule<Graph_t>> {
public:
private:
const std::vector<std::string> metric_headers = {
"TotalCommCost", "TotalLambdaCommCost", "BufferedSendingCosts"
};

public:
"TotalCommCost", "TotalLambdaCommCost", "BufferedSendingCosts"};

public:
std::vector<std::string> get_metric_headers() const override {
return metric_headers;
}

std::map<std::string, std::string> record_statistics(
const BspSchedule<Graph_t>& schedule,
std::ofstream& /*log_stream*/) const override {
const BspSchedule<Graph_t> &schedule,
std::ofstream & /*log_stream*/) const override {
std::map<std::string, std::string> stats;
stats["TotalCommCost"] = std::to_string(schedule.computeTotalCosts());
stats["TotalLambdaCommCost"] = std::to_string(schedule.computeTotalLambdaCosts());
stats["BufferedSendingCosts"] = std::to_string(schedule.computeBufferedSendingCosts());
stats["TotalCommCost"] = std::to_string(TotalCommunicationCost<Graph_t>()(schedule));
stats["TotalLambdaCommCost"] = std::to_string(TotalLambdaCommunicationCost<Graph_t>()(schedule));
stats["BufferedSendingCosts"] = std::to_string(BufferedSendingCost<Graph_t>()(schedule));
return stats;
}
};
Expand Down
Loading