Commit 147f24a2 authored by Guido Giuntoli's avatar Guido Giuntoli

Updating Doc and Benchmark-sol-ass

parent 533ec358
......@@ -9,7 +9,7 @@ Jacobian matrix and the solver (CGPD).
Basically the benchmark executes a tipical Newton-Raphson iteration:
\begin{lstlisting}
\begin{lstlisting}[language=c++, backgroundcolor=\color{lightgray} ]
double norm = assembly_rhs_acc(u, nullptr, b);
#ifdef _OPENACC
......@@ -30,43 +30,43 @@ Basically the benchmark executes a tipical Newton-Raphson iteration:
norm = assembly_rhs_acc(u, nullptr, b);
\end{lstlisting}
To execute this benchmark:
\begin{lstlisting}[language=Bash,backgroundcolor=\color{lightgray} ]
./benchmark-sol-ass
\end{lstlisting}
\begin{figure}[!htbp]
\centering
\begin{tikzpicture}[]
\pgfplotsset{every tick label/.append style={font=\small}}
\pgfplotstableread{data/benchmark-sol-ass-macintosh.dat}{\times}
\begin{axis}[
% grid=major,
% y unit=s,
% legend pos=north west,
% legend cell align={left},
% ylabel=Computing Time,
% xlabel=Micro-resolution,
% x unit=\# Elements,
% ymin = 0,
% ymax = 600,
% xtick = {0,20,40,60,80,100},
% xticklabels = {0,20\tst,40\tst,60\tst,80\tst,100\tst},
% ytick = {0,200,400,600,800},
grid=major,
y unit=s,
legend pos=north west,
legend cell align={left},
ylabel=Computing Time,
xlabel=Micro-Scale Mesh Resolution,
x unit=\# Elements,
scaled y ticks=false,
xmin=-1,
ymin=-1,
xtick = {0,20,40,60,80,100},
xticklabels = {0,20\tst,40\tst,60\tst,80\tst,100\tst},
]
\addplot [color=blue,mark=*,line width = 0.5mm] table [x index={0}, y index={1}] {\times};
\addplot [color=green,mark=*,line width = 0.5mm] table [x index={0}, y index={2}] {\times};
% %{\times} [yshift=9pt]
% %node[pos=0.0,yshift=10pt] {36\%}
% %node[pos=0.105,yshift=11pt] {68\%}
% %node[pos=1.0] {79\%};
% %\addplot [color=blue ,mark=*,line width = 0.5mm] table [x={n1}, y expr=\thisrowno{2}*1.0e-6]
% %{\times} [yshift=9pt]
% %node[pos=0.0] {64\%}
% %node[pos=0.253,yshift=5pt] {32\%}
% %node[pos=1.0] {21\%};
% %\legend{Jacobian \& Residue Assembly}
\addplot [color=blue,mark=*,line width = 0.5mm] table [x index={0}, y
expr=\thisrowno{1}*1.0e-3] {\times};
\addplot [color=green,mark=*,line width = 0.5mm] table [x index={0}, y
expr=\thisrowno{2}*1.0e-3] {\times};
\legend{Jacobian \& Residue Assembly, Solver}
\end{axis}
\end{tikzpicture}
% \caption{\label{fig:ass_vs_sol}
% Computing time used for the assembly of the Jacobian Matrix and the Residue vector and the solver
% algorithm of the Micropp code to perform the micro-scale FE calculation.
% }
\caption{\label{fig:ass_vs_sol}
Computing time used for the assembly of the Jacobian Matrix and the Residue vector and
the solver algorithm of the Micropp code to perform the micro-scale FE
calculation in an Intel Core i7-3520M CPU 2.90GHz.
}
\end{figure}
\subsection{\texttt{benchmarks-cpu-gpu}}
......
......@@ -16,6 +16,7 @@
\usepackage{xspace}
\usepackage{listings}
\usepackage{color}
\usepackage{framed}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
......@@ -39,6 +40,8 @@ tabsize=4
%columns=flexible,
\hyphenation{op-tical net-works semi-conduc-tor}
\newcommand{\ts}{\textsuperscript\xspace}
\newcommand{\tst}{\textsuperscript{3}\xspace}
\begin{document}
......
......@@ -103,16 +103,19 @@ class test_t : public micropp<3> {
auto solver =
duration_cast<milliseconds>(time_6 - time_5);
auto ass_tot = ass_res.count() + ass_mat.count();
auto total = solver.count() + ass_tot;
double percentage_ass = (100.0 * ass_tot) / total;
double percentage_sol = (100.0 * solver.count()) / total;
cout << "ass_res : " << ass_res.count() << " ms" << endl;
cout << "ass_mat : " << ass_mat.count() << " ms" << endl;
cout << "ass_tot : " << ass_res.count() + ass_mat.count() << " ms" << endl;
cout << "ass_tot : " << ass_tot << " ms" << endl;
cout << "solver : " << solver.count() << " ms" << endl;
auto total = solver.count() + ass_res.count() + ass_mat.count();
double percentage_ass = (double)(100 * ass_res.count() + ass_mat.count()) / total;
double percentage_sol = (double)(100 * solver.count()) / total;
cout
<< "ass : " << percentage_ass << " \% "
<< "sol : " << percentage_sol << " \%" << endl;
cout << "|r| : " << norm << endl;
file
<< nx - 1 << "\t"
......@@ -150,7 +153,7 @@ int main (int argc, char *argv[])
ofstream file;
file.open("benchmark-sol-ass.dat");
file << "N time_ass time_sol ass\% sol\%" << endl;
file << "#N time_ass time_sol ass\% sol\%" << endl;
for (int i = 0; i < n_cases; ++i) {
mic_params.size[0] = n[i];
......
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