Skip to content

Commit

Permalink
Fix intmax_t issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dromniscience committed Oct 24, 2023
1 parent 9faf9ca commit 11196bc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Reading sketch config from "../config/PerFlowMeas/Raw/ES/0.25m.toml":
... # Simulator output, omitted here
```

Furthermore, `PerFlowMeasHelper.sh` helps to you to run one of the six framework under all possible memory budgets. Its usage is detailed as follows.
Furthermore, `PerFlowMeasHelper.sh` helps you run one of the six framework under all possible memory budgets. Its usage is detailed as follows.
```console
> ./PerFlowMeasHelper.sh -h
OVERVIEW: Helper of per-flow measurement
Expand Down
5 changes: 5 additions & 0 deletions simulator/bin/PerFlowMeasHelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ function RunSingleSketch () {
echo "$1" > "$file"
for memory in "0.125m" "0.25m" "0.375m" "0.5m" "0.625m" "0.75m" "0.875m" "1m"; do
((i=i%"$2")); ((i++==0)) && wait
# Warning: Potential contention
# Fortunately each process appends a single line to the shared file,
# and there are at most 8 processes. This implementation is for simp-
# licity only.
./PerFlowMeas.sh -s "$1" -m $memory >> "$file" &
done
wait
}

RunSingleSketch $sketch $process
2 changes: 1 addition & 1 deletion simulator/src/sketch/BSPRSketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void BSPRSketch<key_len, no_layer, T, hash_t>::recover(){
#ifdef TEST_DECODE_TIME
MY_TOCK = std::chrono::steady_clock::now();
MY_TIMER = std::chrono::duration_cast<std::chrono::microseconds>(MY_TOCK - MY_TICK);
printf("\nDECODE COST %lldms FOR ALL\n", static_cast<int64_t>(MY_TIMER.count()));
printf("\nDECODE COST %jdms FOR ALL\n", static_cast<intmax_t>(MY_TIMER.count()));
#endif

}
Expand Down
2 changes: 1 addition & 1 deletion simulator/src/sketch/FlowRadar.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Data::Estimation<key_len, T> FlowRadar<key_len, T, hash_t>::decode() {
#ifdef TEST_DECODE_TIME
MY_TOCK = std::chrono::steady_clock::now();
MY_TIMER = std::chrono::duration_cast<std::chrono::microseconds>(MY_TOCK - MY_TICK);
printf("\nDECODE COST %lldms\n", static_cast<int64_t>(MY_TIMER.count()));
printf("\nDECODE COST %jdms\n", static_cast<intmax_t>(MY_TIMER.count()));
#endif

return est;
Expand Down
2 changes: 1 addition & 1 deletion simulator/src/sketch/PRSketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void PRSketch<key_len, T, hash_t>::recover(){
#ifdef TEST_DECODE_TIME
MY_TOCK = std::chrono::steady_clock::now();
MY_TIMER = std::chrono::duration_cast<std::chrono::microseconds>(MY_TOCK - MY_TICK);
printf("\nDECODE COST %lldms\n", static_cast<int64_t>(MY_TIMER.count()));
printf("\nDECODE COST %jdms\n", static_cast<intmax_t>(MY_TIMER.count()));
#endif

}
Expand Down

0 comments on commit 11196bc

Please sign in to comment.