#!/bin/bash

# 定义脚本所在的目录
TOOL_DIR="/root/presure-test-tool"
# 定义日志文件存放的目录
LOG_DIR="/root/presurelog"

if [ ! -d "$LOG_DIR" ]; then
    mkdir -p "$LOG_DIR"
fi


SCRIPTS=(
    "test_all_reduce_perf.sh"
    "test_cpu.sh"
    #"test_fio.sh"
    "test_gpu.sh"
    "test_mlc_latency_matrix.sh"
    "test_mlc_max_bandwidth.sh"
    "test_pcie_p2p.sh"
)


for script in "${SCRIPTS[@]}"; do
    echo "Running $script..."  

    # 获取不带后缀的脚本名，用于创建对应的日志文件名
    LOG_FILE_NAME=$(basename "$script" .sh)

  
    bash "$TOOL_DIR/$script" > "$LOG_DIR/${LOG_VALUE_NAME}.log" 2>&1
done

echo "All scripts have been executed and logs are saved in $LOG_DIR."