Commit 0e43f0da authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Add option for only one core(chameleon); Add VITE trace capabilities

parent 875ac5aa
......@@ -25,3 +25,101 @@
CLOCK: [2017-05-10 Wed 08:49]--[2017-05-10 Wed 08:54] => 0:05
:END:
[2017-05-10 Wed 08:49]
**** launch fabulous with chameleon
#+NAME: fabulous_root
|/home/tmijieux/fabulous/|
On executable testMatrixMarketChoice_cham:
Added a new -z option to make chameleon use only one core;
Otherwise all available cores will be used
#+begin_src shell :var WORKDIR=fabulous_root :session *fabulous* :results silent
cd ${WORKDIR}/build/src/test_cham/
mkdir -p ../data/res
#nbRHS=6; maxSpace=90
# following variable MUST have a trailing slash; needed for tracing
export STARPU_FXT_PREFIX=${WORKDIR}/build/
# loading MKL into environement may be need on local machine:
. /opt/intel/mkl/bin/mklvars.sh intel64
# on plafrim following may be needed for proper execution
#spack load mpi; spack load hwloc; spack load starpu; spack load chameleon
./testMatrixMarketChoice_cham -z -n 50 -e 1e-4 -A CHAMDR -u -o "CHAM-TL"
#+end_src
:LOGBOOK:
CLOCK: [2017-05-10 Wed 13:27]--[2017-05-10 Wed 13:31] => 0:04
:END:
[2017-05-10 Wed 13:27]
**** visualize chameleon kernels with VITE
starpu need to be compiled with FxT:
http://download.savannah.nongnu.org/releases/fkt/
(already enabled if starpu comes from installing chameleon with spack)
***** installing fxt manually from sources
ONLY IF SPACK IS NOT WANTED
#+begin_src sh :dir ~/src :results silents :session *install*
wget http://download.savannah.nongnu.org/releases/fkt/fxt-0.3.3.tar.gz
tar xf fxt-0.3.3.tar.gz
cd fxt-0.3.3
PREFIX=/usr # or another preferred directory
./configure --prefix=$PREFIX
make
make install # <-- as root if needed
#+end_src
***** configuring starpu
Use the following starpu "./configure" option:
"--with-fxt=/path/to/fxt/installation/prefix"
after installing (latest)
#+begin_src sh :dir ~/src :results silent :session *install*
cd starpu-1.2.1/
PREFIX=/usr # or another preferred directory
FXT_PREFIX=/usr # path where fxt was installed
./configure --prefix=$PREFIX --with-fxt=$FXT_PREFIX # ... other wanted options
make
make install
#+end_src
***** Install vite
See http://vite.gforge.inria.fr/download.php
Debian, ubuntu, mint:
#+begin_src sh :results silent
sudo apt-get install vite
#+end_src
Or manually
#+begin_src sh :dir ~/src :session *install* :results silent
svn checkout svn://scm.gforge.inria.fr/svnroot/vite/trunk vite-trunk
cd vite-trunk
mkdir -p build
cd build
PREFIX=/usr # or another preferred directory
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
make
make install # <-- as root if needed
#+end_src
***** convert trace
Trace will be written to $STARPU_FXT_PREFIX directory.
(or /tmp if the variable is not set)
for example in last script (launch fabulous with chameleon)
it will be written to ~/fabulous/build/prof_file_${USER}_0
Convert the trace to the PAJE format:
#+begin_src sh :dir ~/fabulous/ :results silent
#with spack:
# STARPU_FXT_TOOL=$(spack location -i starpu)/bin/starpu_fxt_tool
# without spack:
# STARPU_FXT_TOOL=/path/to/starpu/installation/prefix/bin/starpu_fxt_tool
STARPU_FXT_TOOL=/usr/bin/starpu_fxt_tool
$STARPU_FXT_TOOL -i ~/fabulous/build/prof_file_${USER}_0 -o paje.trace
#+end_src
***** visualize
#+begin_src sh :dir ~/fabulous/ :results silent
vite paje.trace
#+end_src
:LOGBOOK:
CLOCK: [2017-05-10 Wed 13:32]--[2017-05-10 Wed 13:45] => 0:13
:END:
[2017-05-10 Wed 13:32]
......@@ -266,28 +266,34 @@ ggplot(df, aes(x=nb_mvp)) +
geom_line(aes(y=least_square_time, color=name)) +
ggtitle("young1c (nrhs=100, m=500 k=5, max_mvp=10000)") + ylab(TeX("$\\eta_b$ (min, max)"))
#+end_src
*** chameleon run
*** with chameleon
**** run test
#+begin_src shell
cd ${WORKDIR}/build/src/test_cham/
mkdir -p ../data/res
#nbRHS=6; maxSpace=90
export STARPU_HOME=${WORKDIR}
export STARPU_FXT_PREFIX=${WORKDIR}
spack load mpi; spack load hwloc; spack load starpu; spack load chameleon
./testMatrixMarketChoice_cham -n 256 -e 1e-4 -A CHAMDR -u -o "CHAM-TL"
# following variable MUST have a trailing slash
export STARPU_FXT_PREFIX=${WORKDIR}/build/
. /opt/intel/mkl/bin/mklvars.sh intel64
# plafrim:
#spack load mpi; spack load hwloc; spack load starpu; spack load chameleon
#option -z for chameleon with 1 core only
./testMatrixMarketChoice_cham -z -n 50 -e 1e-4 -A CHAMDR -u -o "CHAM-TL"
# ./testMatrixMarketChoice_cham -n 100 -e 1e-4 -A CHAMQR -u -o "CHAM-QR"
#+end_src
**** plot
The following graph represent relative percentages spent
in each stage of the algorithm
#+begin_src R
library(ggplot2)
library(latex2exp)
df <- read.table("./build/src/data/res/CHAM-TL.res", header=T)
ggplot(df, aes(x=nb_mvp)) +
geom_line(aes(y=time, color="total")) +
geom_line(aes(y=least_square_time, color="Gels")) +
geom_line(aes(y=ortho_time, color="Ortho")) +
geom_line(aes(y=mvp_time, color="Mvp")) +
ggtitle("young1c CHAM time (nrhs=100, m=500 k=5, max_mvp=10000)") + ylab(TeX("$\\eta_b$ (min, max)"))
ggplot(df, aes(x=global_iteration)) +
geom_line(aes(y=100, color="total")) +
geom_line(aes(y=(least_square_time/time)*100, color="Gels")) +
geom_line(aes(y=(ortho_time/time)*100, color="Ortho")) +
geom_line(aes(y=(mvp_time/time)*100, color="Mvp")) +
geom_line(aes(y=((mvp_time+ortho_time+least_square_time)/time)*100, color="SUM")) +
ggtitle("Relative % time spent (young1c CHAM) (nrhs=50)") + ylab(TeX("$\\% time"))
#+end_src
......@@ -52,7 +52,8 @@ const char *gengetopt_args_info_help[] = {
" -j, --parser=ENUM set the matrix parser (MatrixMarket;Innovation\n Works;Random) (possible values=\"MM\", \"IW\",\n \"RD\" default=`MM')",
" -k, --storage=ENUM set the matrix storage type (possible\n values=\"DENSE\", \"CSC\", \"COO\"\n default=`DENSE')",
" -o, --output=STRING set the output filename, if not set the input\n filename will be used",
" -u, --suffix automatically append parameter as a suffix to output\n filename (default=on)",
" -u, --suffix append parameters as a suffix to output filename\n (default=on)",
" -z, --cham-sequential Use chameleon with only one core. (default=off)",
0
};
......@@ -107,6 +108,7 @@ void clear_given (struct gengetopt_args_info *args_info)
args_info->storage_given = 0 ;
args_info->output_given = 0 ;
args_info->suffix_given = 0 ;
args_info->cham_sequential_given = 0 ;
}
static
......@@ -145,6 +147,7 @@ void clear_args (struct gengetopt_args_info *args_info)
args_info->output_arg = NULL;
args_info->output_orig = NULL;
args_info->suffix_flag = 1;
args_info->cham_sequential_flag = 0;
}
......@@ -172,6 +175,7 @@ void init_args_info(struct gengetopt_args_info *args_info)
args_info->storage_help = gengetopt_args_info_help[16] ;
args_info->output_help = gengetopt_args_info_help[17] ;
args_info->suffix_help = gengetopt_args_info_help[18] ;
args_info->cham_sequential_help = gengetopt_args_info_help[19] ;
}
......@@ -381,6 +385,8 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
write_into_file(outfile, "output", args_info->output_orig, 0);
if (args_info->suffix_given)
write_into_file(outfile, "suffix", 0, 0 );
if (args_info->cham_sequential_given)
write_into_file(outfile, "cham-sequential", 0, 0 );
i = EXIT_SUCCESS;
......@@ -672,10 +678,11 @@ cmdline_parser_internal (
{ "storage", 1, NULL, 'k' },
{ "output", 1, NULL, 'o' },
{ "suffix", 0, NULL, 'u' },
{ "cham-sequential", 0, NULL, 'z' },
{ 0, 0, 0, 0 }
};
c = getopt_long (argc, argv, "hVt:s:i:f:n:m:M:e:a:A:r:p:Pj:k:o:u", long_options, &option_index);
c = getopt_long (argc, argv, "hVt:s:i:f:n:m:M:e:a:A:r:p:Pj:k:o:uz", long_options, &option_index);
if (c == -1) break; /* Exit from `while (1)' loop. */
......@@ -881,7 +888,7 @@ cmdline_parser_internal (
goto failure;
break;
case 'u': /* automatically append parameter as a suffix to output filename. */
case 'u': /* append parameters as a suffix to output filename. */
if (update_arg((void *)&(args_info->suffix_flag), 0, &(args_info->suffix_given),
......@@ -891,6 +898,16 @@ cmdline_parser_internal (
goto failure;
break;
case 'z': /* Use chameleon with only one core.. */
if (update_arg((void *)&(args_info->cham_sequential_flag), 0, &(args_info->cham_sequential_given),
&(local_args_info.cham_sequential_given), optarg, 0, 0, ARG_FLAG,
check_ambiguity, override, 1, 0, "cham-sequential", 'z',
additional_error))
goto failure;
break;
case 0: /* Long option with no short option */
case '?': /* Invalid option. */
......
......@@ -94,8 +94,10 @@ struct gengetopt_args_info
char * output_arg; /**< @brief set the output filename, if not set the input filename will be used. */
char * output_orig; /**< @brief set the output filename, if not set the input filename will be used original value given at command line. */
const char *output_help; /**< @brief set the output filename, if not set the input filename will be used help description. */
int suffix_flag; /**< @brief automatically append parameter as a suffix to output filename (default=on). */
const char *suffix_help; /**< @brief automatically append parameter as a suffix to output filename help description. */
int suffix_flag; /**< @brief append parameters as a suffix to output filename (default=on). */
const char *suffix_help; /**< @brief append parameters as a suffix to output filename help description. */
int cham_sequential_flag; /**< @brief Use chameleon with only one core. (default=off). */
const char *cham_sequential_help; /**< @brief Use chameleon with only one core. help description. */
unsigned int help_given ; /**< @brief Whether help was given. */
unsigned int version_given ; /**< @brief Whether version was given. */
......@@ -116,6 +118,7 @@ struct gengetopt_args_info
unsigned int storage_given ; /**< @brief Whether storage was given. */
unsigned int output_given ; /**< @brief Whether output was given. */
unsigned int suffix_given ; /**< @brief Whether suffix was given. */
unsigned int cham_sequential_given ; /**< @brief Whether cham-sequential was given. */
} ;
......
......@@ -58,5 +58,8 @@ option "storage" k "set the matrix storage type"
option "output" o "set the output filename, if not set the input filename will be used"
string optional
option "suffix" u "automatically append parameter as a suffix to output filename"
flag on
\ No newline at end of file
option "suffix" u "append parameters as a suffix to output filename"
flag on
option "cham-sequential" z "Use chameleon with only one core."
flag off
\ No newline at end of file
......@@ -180,17 +180,20 @@ void run_test(const struct gengetopt_args_info &info)
int main(int argc, char *argv[])
{
gengetopt_args_info info;
cmdline_parser(argc, argv, &info); // <- code generated with gengetopt
#if defined(FABULOUS_USE_CHAMELEON)
int NCPU = sysconf(_SC_NPROCESSORS_ONLN);
if (info.cham_sequential_flag) {
NCPU = 1;
}
MORSE_Init(NCPU, 0);
MORSE_Enable(MORSE_WARNINGS);
MORSE_Disable(MORSE_AUTOTUNING);
MORSE_user_tag_size(31, 16);
#endif
gengetopt_args_info info;
cmdline_parser(argc, argv, &info); // <- code generated with gengetopt
switch(info.arithmetic_arg) {
case arithmetic_arg_REAL_FLOAT: run_test<float>(info); break;
case arithmetic_arg_REAL_DOUBLE: run_test<double>(info); break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment