Commit 073ea0a8 authored by Ben Hazelwood's avatar Ben Hazelwood
Browse files

Fix rank performance test with pause=1s

parent 461f4712
......@@ -11,7 +11,7 @@
#include <cstdlib>
const int NUM_TRIALS = 100;
const int NUM_PONGS = 1e4;
const int NUM_PONGS = 2e4;
int START = 0;
int FINISH = 0;
......
../scripts/timing-parser.py
\ No newline at end of file
......@@ -12,8 +12,10 @@
#include "RankControl.h"
#include "Logging.h"
static bool shouldSleepRank;
static bool shouldCorruptData;
void registerSignalHandler() {
signal(SIGUSR1, pauseThisRankSignalHandler);
signal(SIGUSR2, corruptThisRankSignalHandler);
......@@ -21,9 +23,7 @@ void registerSignalHandler() {
}
void pauseThisRankSignalHandler( int signum ) {
const double sleepLength = 1.0 * 1e6;
logDebug( "Signal received: sleep for 1s");
usleep(sleepLength);
shouldSleepRank = true;
}
void corruptThisRankSignalHandler( int signum ) {
......@@ -31,10 +31,19 @@ void corruptThisRankSignalHandler( int signum ) {
shouldCorruptData = true;
}
bool getShouldSleepRank() {
return shouldSleepRank;
}
void setShouldSleepRank(bool toggle) {
shouldSleepRank = toggle;
}
bool getShouldCorruptData() {
return shouldCorruptData;
}
void setShouldCorruptData(bool toggle) {
shouldCorruptData = toggle;
}
\ No newline at end of file
}
......@@ -24,4 +24,8 @@ bool getShouldCorruptData();
void setShouldCorruptData(bool toggle);
bool getShouldSleepRank();
void setShouldSleepRank(bool toggle);
#endif
\ No newline at end of file
......@@ -8,6 +8,7 @@
#include "Timing.h"
#include "Logging.h"
#include "Rank.h"
#include "RankControl.h"
#include <fstream>
#include <map>
......@@ -17,6 +18,7 @@
#include <utility>
#include <stddef.h>
#include <bitset>
#include <unistd.h>
struct Timer {
// PMPI_Wtime at start of execution
......@@ -54,6 +56,12 @@ void Timing::finaliseTiming() {
}
void Timing::markTimeline() {
if (getShouldSleepRank()) {
const double sleepLength = 1.0 * 1e6;
logDebug( "Signal received: sleep for 1s");
usleep(sleepLength);
setShouldSleepRank(false);
}
timer.syncPoints.at(getTeam()).push_back(PMPI_Wtime());
compareProgressWithReplicas();
}
......
......@@ -2,8 +2,8 @@
export TEAMS=2
for interval in constant increasing random; do
for select in single rr random; do
for select in single rr random; do
export TMPI_FILE="$interval-$select-timings"
./rank-performance-latency.sh random random ./bin/Latency 100000 100000 1
./rank-performance-latency.sh $interval $select ./bin/Latency 100000 100000 1
done
done
\ No newline at end of file
......@@ -5,9 +5,9 @@ if (( $# < 4)); then
exit 1
fi
mpirun -np 4 ${@:3} &
mpirun -np 4 -l ${@:3} &
sleep 1
sleep 2
pids=($(pgrep Latency))
iteration=1
......@@ -37,11 +37,11 @@ while true; do
fi
if [ $1 = "increasing" ]; then
sleep $(python -c "print(max(0.5,25/$iteration))")
sleep $(python -c "print(max(2,25/$iteration))")
fi
if [ $1 = "random" ]; then
sleep `python3 -c "from random import uniform; print(uniform(0.2,20))"`
sleep `python3 -c "from random import uniform; print(uniform(2,20))"`
fi
((iteration++))
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment