-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild_ramble_tests.sh
More file actions
67 lines (52 loc) · 2.29 KB
/
build_ramble_tests.sh
File metadata and controls
67 lines (52 loc) · 2.29 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
#!/bin/bash
# Exit on error, undefined variables, and pipe failures
set -euo pipefail
IFS=$'\n\t'
# Variables for easy adjustments
WORKSPACE_DIR="spatter_tests"
APP_NAME="spatter"
TESTS_DIR="tests/basic_tests"
REPO_URL="https://raw.githubusercontent.com/hpcgarage/spatter/refs/heads/main"
main() {
echo "--- Initializing Ramble Application ---"
# Create and enter working directory
mkdir -p "$WORKSPACE_DIR"
cd "$WORKSPACE_DIR"
# Initialize Ramble repo
# Using || true in case the repo already exists in some environments
ramble repo create "$APP_NAME" || echo "Repo already exists, skipping create..."
ramble repo add "$APP_NAME" || echo "Repo already added, skipping add..."
# Setup application directory and fetch python script
mkdir -p "$APP_NAME/applications/$APP_NAME"
echo "Downloading application.py..."
curl -fsSL -o "$APP_NAME/applications/$APP_NAME/application.py" \
"$REPO_URL/tests/ramble-tests/application.py"
echo "--- Creating Experiment Workspace ---"
ramble workspace create -d tests -a
# Download test files
mkdir -p "$TESTS_DIR"
echo "Downloading test JSON files..."
curl -fsSL -o "$TESTS_DIR/cpu-ustride.json" "$REPO_URL/standard-suite/basic-tests/cpu-ustride.json"
curl -fsSL -o "$TESTS_DIR/cpu-stream.json" "$REPO_URL/standard-suite/basic-tests/cpu-stream.json"
echo "--- Defining Experiments ---"
# Note: Using $PWD ensures Ramble gets the full absolute path to the JSON files
ramble workspace manage experiments "$APP_NAME" --overwrite \
-e UniformStride \
-v f="$PWD/$TESTS_DIR/cpu-ustride.json" \
ramble workspace manage experiments "$APP_NAME" --overwrite \
-e Stream \
-v f="$PWD/$TESTS_DIR/cpu-stream.json"
echo "--- Setting up and Concretizing ---"
ramble workspace setup
ramble workspace concretize
echo "--------------------------------------------------------"
echo "Setup Complete."
echo "Output will be generated in: experiments/$APP_NAME/$APP_NAME/{experiment name}/{experiment name}.out"
echo "--------------------------------------------------------"
}
# Dependency Check
if ! command -v ramble &> /dev/null; then
echo "Error: 'ramble' command not found. Please ensure Ramble is in your PATH." >&2
exit 1
fi
main "$@"