forked from llnl/LULESH
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_pause_test.sh
More file actions
executable file
·86 lines (73 loc) · 2.71 KB
/
run_pause_test.sh
File metadata and controls
executable file
·86 lines (73 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# End-to-end evaluation of PInsight PAUSE feature with LULESH
# Tests: PAUSE action fires, lttng rotate runs, analysis script launches, app resumes
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PINSIGHT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
LIBPINSIGHT="$PINSIGHT_DIR/build/libpinsight.so"
LULESH="$SCRIPT_DIR/lulesh2.0_baseline"
CONFIG="$SCRIPT_DIR/trace_config_pause_test.txt"
TRACE_OUTPUT="/tmp/pinsight_pause_test_traces"
echo "==================================================================="
echo " PInsight PAUSE Feature End-to-End Test"
echo "==================================================================="
echo " PInsight lib: $LIBPINSIGHT"
echo " LULESH binary: $LULESH"
echo " Config file: $CONFIG"
echo " Trace output: $TRACE_OUTPUT"
echo ""
# Check prerequisites
if [ ! -f "$LIBPINSIGHT" ]; then
echo "[ERROR] libpinsight.so not found at $LIBPINSIGHT"
exit 1
fi
if [ ! -f "$LULESH" ]; then
echo "[ERROR] lulesh2.0_baseline not found"
exit 1
fi
# Clean up old traces
rm -rf "$TRACE_OUTPUT"
mkdir -p "$TRACE_OUTPUT"
echo "--- Step 1: Create LTTng session with rotation support ---"
lttng destroy pinsight_pause_test 2>/dev/null || true
lttng create pinsight_pause_test --output="$TRACE_OUTPUT"
lttng enable-event -u 'pinsight:*'
lttng enable-channel --userspace --subbuf-size=2M channel0 2>/dev/null || true
lttng start
echo "[OK] LTTng session 'pinsight_pause_test' started"
echo ""
echo "--- Step 2: Show PAUSE config ---"
cat "$CONFIG"
echo ""
echo "--- Step 3: Run LULESH with PInsight PAUSE config ---"
echo " (Using -s 30 -i 500 to ensure enough iterations for 10 traces)"
echo " Expected: After 10 traces, PAUSE triggers -> lttng rotate -> script -> resume"
echo ""
# Run LULESH with PInsight
# Use larger problem size and more iterations so PAUSE has time to trigger
cd "$SCRIPT_DIR"
OMP_NUM_THREADS=4 \
OMP_TOOL_LIBRARIES="$LIBPINSIGHT" \
PINSIGHT_TRACE_CONFIG_FILE="$CONFIG" \
timeout 60 "$LULESH" -s 30 -i 500 2>&1
echo ""
echo "--- Step 4: Stop LTTng session ---"
lttng stop
lttng destroy pinsight_pause_test
echo ""
echo "--- Step 5: Check trace output ---"
echo " Trace directory contents:"
find "$TRACE_OUTPUT" -type f | head -20
echo ""
# Check if rotation happened (there should be multiple chunk directories)
NUM_CHUNKS=$(find "$TRACE_OUTPUT" -maxdepth 2 -name "metadata" | wc -l)
echo " Number of trace chunks: $NUM_CHUNKS"
if [ "$NUM_CHUNKS" -gt 0 ]; then
echo "[OK] Traces were collected"
else
echo "[WARN] No trace chunks found (lttng rotate may not have produced separate chunks)"
fi
echo ""
echo "==================================================================="
echo " Test Complete"
echo "==================================================================="