Skip to content

Commit

Permalink
tools/darts: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nfurmento committed Jan 29, 2024
1 parent d41dc5d commit a2a3394
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
29 changes: 20 additions & 9 deletions tools/darts/example_script_visualization_darts.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# StarPU --- Runtime system for heterogeneous multicore architectures.
#
# Copyright (C) 2020-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
# Copyright (C) 2020-2024 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
#
# StarPU is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -19,12 +20,22 @@
# 1. Configure with the options --enable-darts-stats --enable-darts-verbose
# 2. Use the following environemnt variable: PRINT_N=$((N)) with N the side of the matrix used in the application
# 3. To launch this script from the starpu/ folder use:
# bash tools/darts/example_script_visualization_darts.sh $PATH_TO_STARPU_FOLDER N Application NGPU scheduler block_size memory_limitation_of_the_gpus $PATH_TO_PERFMODEL (optional, can also be left empty if the experiment is not done in simulation) hostname (optional if you are not using simulation)
# For instance it can be: bash tools/darts/example_script_visualization_darts.sh /home/name/ 15 Cholesky 1 darts 960 2000 /home/name/starpu/tools/perfmodels/sampling/ attila
# ./tools/darts/example_script_visualization_darts.sh $PATH_TO_STARPU_FOLDER N Application NGPU scheduler block_size memory_limitation_of_the_gpus $PATH_TO_PERFMODEL (optional, can also be left empty if the experiment is not done in simulation) hostname (optional if you are not using simulation)
# For instance it can be: ./tools/darts/example_script_visualization_darts.sh /home/name/ 15 Cholesky 1 darts 960 2000 /home/name/starpu/tools/perfmodels/sampling/ attila
# 4. If your targeted application is Cholesky, use -niter 1
# 5. If your targeted application is Gemm, use -iter 1
# The output image will be saved in the starpu/ folder

usage()
{
echo Error
}

if test "$7" == ""
then
usage
exit 1
fi
make -j 6
PATH_STARPU=$1
N=$2
Expand All @@ -45,16 +56,16 @@ else
fi
ulimit -S -s 5000000

if [ $DOSSIER = "Matrice_ligne" ]
if [ "$DOSSIER" = "Matrice_ligne" ]
then
STARPU_SCHED_OUTPUT=${OUTPUT_PATH} STARPU_SCHED=${ORDO} PRINT_IN_TERMINAL=1 PRINT_N=$((N)) STARPU_NTASKS_THRESHOLD=30 STARPU_CUDA_PIPELINE=5 STARPU_SIMGRID_CUDA_MALLOC_COST=0 STARPU_MINIMUM_CLEAN_BUFFERS=0 STARPU_TARGET_CLEAN_BUFFERS=0 STARPU_LIMIT_CUDA_MEM=$((CM)) STARPU_NCPU=0 STARPU_NCUDA=$((NGPU)) STARPU_NOPENCL=0 STARPU_HOSTNAME=${HOST} ./examples/mult/sgemm -xy $((block_size*N)) -nblocks $((N)) -iter 1
STARPU_SCHED_OUTPUT=${OUTPUT_PATH} STARPU_SCHED=${ORDO} PRINT_IN_TERMINAL=1 PRINT_N=$((N)) STARPU_NTASKS_THRESHOLD=30 STARPU_CUDA_PIPELINE=5 STARPU_SIMGRID_CUDA_MALLOC_COST=0 STARPU_MINIMUM_CLEAN_BUFFERS=0 STARPU_TARGET_CLEAN_BUFFERS=0 STARPU_LIMIT_CUDA_MEM=$((CM)) STARPU_NCPU=0 STARPU_NCUDA=$((NGPU)) STARPU_NOPENCL=0 STARPU_HOSTNAME=${HOST} $PATH_STARPU/examples/mult/sgemm -xy $((block_size*N)) -nblocks $((N)) -iter 1

python3 ${PATH_STARPU}/starpu/tools/darts/visualization_darts.py ${N} ${ORDO} ${NGPU} ${DOSSIER} 1 ${CM} ${block_size} ${OUTPUT_PATH}
python3 ./tools/darts/visualization_darts.py ${N} ${ORDO} ${NGPU} ${DOSSIER} 1 ${CM} ${block_size} ${OUTPUT_PATH}
fi

if [ $DOSSIER = "Cholesky" ]
if [ "$DOSSIER" = "Cholesky" ]
then
STARPU_SCHED_OUTPUT=${OUTPUT_PATH} STARPU_SIMGRID_CUDA_MALLOC_COST=0 STARPU_HOSTNAME=${HOST} PRINT_N=$((N)) DOPT_SELECTION_ORDER=7 STARPU_LIMIT_CUDA_MEM=$((CM)) DEPENDANCES=1 APP=1 EVICTION_STRATEGY_DYNAMIC_DATA_AWARE=1 STARPU_SCHED=${ORDO} STARPU_NTASKS_THRESHOLD=$((TH)) STARPU_CUDA_PIPELINE=$((CP)) STARPU_EXPECTED_TRANSFER_TIME_WRITEBACK=1 STARPU_MINIMUM_CLEAN_BUFFERS=0 STARPU_TARGET_CLEAN_BUFFERS=0 STARPU_NCPU=0 STARPU_NCUDA=$((NGPU)) STARPU_NOPENCL=0 ./examples/cholesky/cholesky_implicit -size $((block_size*N)) -nblocks $((N)) -niter 1
STARPU_SCHED_OUTPUT=${OUTPUT_PATH} STARPU_SIMGRID_CUDA_MALLOC_COST=0 STARPU_HOSTNAME=${HOST} PRINT_N=$((N)) DOPT_SELECTION_ORDER=7 STARPU_LIMIT_CUDA_MEM=$((CM)) DEPENDANCES=1 APP=1 EVICTION_STRATEGY_DYNAMIC_DATA_AWARE=1 STARPU_SCHED=${ORDO} STARPU_NTASKS_THRESHOLD=$((TH)) STARPU_CUDA_PIPELINE=$((CP)) STARPU_EXPECTED_TRANSFER_TIME_WRITEBACK=1 STARPU_MINIMUM_CLEAN_BUFFERS=0 STARPU_TARGET_CLEAN_BUFFERS=0 STARPU_NCPU=0 STARPU_NCUDA=$((NGPU)) STARPU_NOPENCL=0 $PATH_STARPU/examples/cholesky/cholesky_implicit -size $((block_size*N)) -nblocks $((N)) -niter 1

python3 ${PATH_STARPU}/starpu/tools/darts/visualization_darts.py ${N} ${ORDO} ${NGPU} ${DOSSIER} 1 ${CM} ${block_size} ${OUTPUT_PATH}
python3 ./tools/darts/visualization_darts.py ${N} ${ORDO} ${NGPU} ${DOSSIER} 1 ${CM} ${block_size} ${OUTPUT_PATH}
fi
13 changes: 12 additions & 1 deletion tools/darts/visualization_darts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python3
# coding=utf-8
#
# StarPU --- Runtime system for heterogeneous multicore architectures.
#
# Copyright (C) 2020-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
# Copyright (C) 2020-2024 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
#
# StarPU is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -256,6 +259,14 @@ def get_i_j_cholesky(iterationk, figure_par_ligne):
j = int(iterationk) % int(figure_par_ligne)
return i, j

def usage():
print("Error. Not enough parameters")
print(sys.argv)

if len(sys.argv) != 9:
usage()
sys.exit(1)

N = int(sys.argv[1])
ORDO = sys.argv[2]
NGPU = int(sys.argv[3])
Expand Down

0 comments on commit a2a3394

Please sign in to comment.