task1
This commit is contained in:
1
task1/.gitignore
vendored
1
task1/.gitignore
vendored
@@ -2,3 +2,4 @@ bin/
|
||||
results/*.out
|
||||
results/*.err
|
||||
results/*.csv
|
||||
*.pyc
|
||||
@@ -103,15 +103,13 @@ tar -xzf ~/linpack.tgz -C ~/LINPACK
|
||||
find ~/LINPACK -name xlinpack_xeon64 2>/dev/null
|
||||
```
|
||||
|
||||
Если команда вернёт, например, путь
|
||||
`/home/ipmmstudy1/tm3u21/LINPACK/benchmarks/linpack/xlinpack_xeon64`,
|
||||
то нужный каталог для запуска:
|
||||
`/home/ipmmstudy1/tm3u21/LINPACK/benchmarks/linpack`.
|
||||
В вашем случае по логам нужный каталог уже известен:
|
||||
`/home/ipmmstudy1/tm3u21/LINPACK/benchmarks_2025.3/linux/share/mkl/benchmarks/linpack`.
|
||||
|
||||
6. Подготовь этот каталог, как в примере:
|
||||
|
||||
```bash
|
||||
cd <НУЖНЫЙ_КАТАЛОГ_С_XLINPACK>
|
||||
cd /home/ipmmstudy1/tm3u21/LINPACK/benchmarks_2025.3/linux/share/mkl/benchmarks/linpack
|
||||
mkdir -p stdio
|
||||
chmod +x *
|
||||
chmod -x *.*
|
||||
@@ -121,7 +119,7 @@ chmod -x *.*
|
||||
|
||||
```bash
|
||||
cd ~/supercomputers/task1
|
||||
sbatch --export=ALL,LINPACK_DIR=<НУЖНЫЙ_КАТАЛОГ_С_XLINPACK> scripts/run_intel_linpack.slurm
|
||||
sbatch --export=ALL,LINPACK_DIR=/home/ipmmstudy1/tm3u21/LINPACK/benchmarks_2025.3/linux/share/mkl/benchmarks/linpack scripts/run_intel_linpack.slurm
|
||||
```
|
||||
|
||||
По умолчанию скрипт использует файл `task1/intel/lininput_report_xeon64`, где уже зафиксированы размеры
|
||||
@@ -136,7 +134,7 @@ sacct -j <JOBID_INTEL> --format=JobID,JobName,Partition,State,Start,End,Elapsed,
|
||||
9. Посмотри вывод:
|
||||
|
||||
```bash
|
||||
less <НУЖНЫЙ_КАТАЛОГ_С_XLINPACK>/stdio/task1-intel-linpack-<JOBID_INTEL>.out
|
||||
less ~/supercomputers/task1/stdio/task1-intel-linpack-<JOBID_INTEL>.out
|
||||
```
|
||||
|
||||
В этом файле ищи строки с размерами `1000`, `1500`, `2000`, `2500`, `3000`, `3500`, а внизу --- секцию `Performance Summary`.
|
||||
|
||||
94
task1/scripts/plot_task1_results.py
Normal file
94
task1/scripts/plot_task1_results.py
Normal file
@@ -0,0 +1,94 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
N_VALUES = [1000, 1500, 2000, 2500, 3000, 3500]
|
||||
|
||||
CUDA_TIME_MS = [5.0083, 7.4931, 8.3563, 10.4837, 12.6709, 14.8861]
|
||||
INTEL_TIME_S = [0.010, 0.020, 0.028, 0.042, 0.069, 0.100]
|
||||
INTEL_TIME_MS = [value * 1000.0 for value in INTEL_TIME_S]
|
||||
|
||||
CUDA_GFLOPS = [133.114, 300.277, 638.244, 993.608, 1420.573, 1920.138]
|
||||
INTEL_GFLOPS = [67.331, 114.360, 193.276, 250.731, 260.451, 286.264]
|
||||
|
||||
|
||||
def configure_plot() -> None:
|
||||
plt.style.use("seaborn-v0_8-whitegrid")
|
||||
plt.rcParams["figure.figsize"] = (8.4, 5.2)
|
||||
plt.rcParams["figure.dpi"] = 140
|
||||
plt.rcParams["savefig.dpi"] = 220
|
||||
plt.rcParams["font.size"] = 11
|
||||
plt.rcParams["axes.labelsize"] = 11
|
||||
plt.rcParams["axes.titlesize"] = 12
|
||||
plt.rcParams["legend.fontsize"] = 10
|
||||
|
||||
|
||||
def plot_time(output_path: Path) -> None:
|
||||
plt.figure()
|
||||
plt.plot(
|
||||
N_VALUES,
|
||||
INTEL_TIME_MS,
|
||||
marker="o",
|
||||
linewidth=2.2,
|
||||
color="#1f77b4",
|
||||
label="Intel LINPACK",
|
||||
)
|
||||
plt.plot(
|
||||
N_VALUES,
|
||||
CUDA_TIME_MS,
|
||||
marker="s",
|
||||
linewidth=2.2,
|
||||
color="#d62728",
|
||||
label="CUDA-реализация",
|
||||
)
|
||||
plt.xlabel("Размер матрицы N")
|
||||
plt.ylabel("Время решения, мс")
|
||||
plt.title("Сравнение времени решения")
|
||||
plt.legend(loc="upper left")
|
||||
plt.tight_layout()
|
||||
plt.savefig(output_path, bbox_inches="tight")
|
||||
plt.close()
|
||||
|
||||
|
||||
def plot_gflops(output_path: Path) -> None:
|
||||
plt.figure()
|
||||
plt.plot(
|
||||
N_VALUES,
|
||||
INTEL_GFLOPS,
|
||||
marker="o",
|
||||
linewidth=2.2,
|
||||
color="#1f77b4",
|
||||
label="Intel LINPACK",
|
||||
)
|
||||
plt.plot(
|
||||
N_VALUES,
|
||||
CUDA_GFLOPS,
|
||||
marker="s",
|
||||
linewidth=2.2,
|
||||
color="#d62728",
|
||||
label="CUDA-реализация",
|
||||
)
|
||||
plt.xlabel("Размер матрицы N")
|
||||
plt.ylabel("Производительность, GFLOPS")
|
||||
plt.title("Сравнение производительности")
|
||||
plt.legend(loc="upper left")
|
||||
plt.tight_layout()
|
||||
plt.savefig(output_path, bbox_inches="tight")
|
||||
plt.close()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
configure_plot()
|
||||
|
||||
output_dir = Path(__file__).resolve().parents[2] / "report" / "img"
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
plot_time(output_dir / "task1-time-comparison.png")
|
||||
plot_gflops(output_dir / "task1-gflops-comparison.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user