-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathsetup_server.sh
More file actions
executable file
·61 lines (52 loc) · 1.97 KB
/
setup_server.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.97 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
#!/bin/bash
# Setup script for running kalign parameter optimization on a Linux server.
# Usage: bash setup_server.sh
set -euo pipefail
echo "=== Kalign optimization server setup ==="
# Check basics
echo "Checking prerequisites..."
command -v cmake >/dev/null 2>&1 || { echo "ERROR: cmake not found. Install with: sudo apt install cmake (or module load cmake)"; exit 1; }
command -v gcc >/dev/null 2>&1 || command -v cc >/dev/null 2>&1 || { echo "ERROR: C compiler not found."; exit 1; }
# Install uv if not present
if ! command -v uv >/dev/null 2>&1; then
echo "Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
fi
echo "uv version: $(uv --version)"
# Build C library + Python extension
echo ""
echo "=== Building kalign Python package ==="
uv pip install -e ".[dev]" 2>/dev/null || uv pip install -e .
# Install optimizer dependencies
echo ""
echo "=== Installing optimizer dependencies ==="
uv pip install pymoo rich
# Quick smoke test
echo ""
echo "=== Smoke test ==="
uv run python -c "
import kalign
print(f'kalign version: {kalign.__version__}')
result = kalign.align(['ACDEFGHIK', 'ACDGHIK', 'ACDEFHIK'])
print(f'Alignment test: OK ({len(result)} sequences)')
"
# Show system info
echo ""
echo "=== System info ==="
echo "CPU: $(nproc) threads available"
echo "RAM: $(free -h 2>/dev/null | awk '/^Mem:/{print $2}' || echo 'unknown')"
echo "Python: $(uv run python --version)"
echo ""
echo "=== Ready! ==="
echo ""
echo "Example runs:"
echo ""
echo " # Quick test (10 minutes):"
echo " uv run python -m benchmarks.optimize_params --pop-size 20 --n-gen 5 --n-workers 8 --n-threads 1"
echo ""
echo " # Single-run optimization (~2-3 hours):"
echo " uv run python -m benchmarks.optimize_params --pop-size 60 --n-gen 50 --n-workers 56 --n-threads 1"
echo ""
echo " # Resume after interrupt:"
echo " uv run python -m benchmarks.optimize_params --resume benchmarks/results/optim/gen_checkpoint.pkl --n-gen 80 --n-workers 56 --n-threads 1"