Updated description of DOT and friends to account for optional GLOBAL

var.
This commit is contained in:
Salvatore Filippone
2018-04-20 15:57:26 +01:00
parent eaaa701c2e
commit 4a6c0857f1
281 changed files with 15338 additions and 14268 deletions
+60
View File
@@ -595,6 +595,66 @@ Type, kind, rank and size must agree on all processes.
\item The \verb|dat| argument may also be a long integer scalar.
\end{enumerate}
\clearpage\subsection*{psb\_nrm2 --- Global 2-norm reduction}
\addcontentsline{toc}{subsection}{psb\_nrm2}
\begin{verbatim}
call psb_nrm2(icontxt, dat, root)
\end{verbatim}
This subroutine implements a 2-norm value reduction
operation based on the underlying communication library.
\begin{description}
\item[Type:] Synchronous.
\item[\bf On Entry ]
\item[icontxt] the communication context identifying the virtual
parallel machine.\\
Scope: {\bf global}.\\
Type: {\bf required}.\\
Intent: {\bf in}.\\
Specified as: an integer variable.
\item[dat] The local contribution to the global minimum.\\
Scope: {\bf local}.\\
Type: {\bf required}.\\
Intent: {\bf inout}.\\
Specified as: a real variable, which may be a
scalar, or a rank 1 array. \
Kind, rank and size must agree on all processes.
\item[root] Process to hold the final value, or $-1$ to make it available
on all processes.\\
Scope: {\bf global}.\\
Type: {\bf optional}.\\
Intent: {\bf in}.\\
Specified as: an integer value $-1<= root <= np-1$, default -1. \\
\end{description}
\begin{description}
\item[\bf On Return]
\item[dat] On destination process(es), the result of the 2-norm reduction.\\
Scope: {\bf global}.\\
Type: {\bf required}.\\
Intent: {\bf inout}.\\
Specified as: a real variable, which may be a
scalar, or a rank 1 array. \\
Kind, rank and size must agree on all processes.
\end{description}
{\par\noindent\large\bfseries Notes}
\begin{enumerate}
\item This reduction is appropriate to compute the results of multiple
(local) NRM2 operations at the same time.
\item Denoting by $dat_i$ the value of the variable $dat$ on process
$i$, the output $res$ is equivalent to the computation of
\[ res = \sqrt{\sum_i dat_i^2},\]
with care taken to avoid unnecessary overflow.
\item The \verb|dat| argument is both input and output, and its
value may be changed even on processes different from the final
result destination.
\end{enumerate}
\clearpage\subsection*{psb\_snd --- Send data}
\addcontentsline{toc}{subsection}{psb\_snd}
+115 -16
View File
@@ -105,7 +105,6 @@ Intent: {\bf out}.\\
An integer value; 0 means no error has been detected.
\end{description}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% F90DOT PRODUCT
@@ -129,7 +128,7 @@ Else if $x$ and $y$ are complex vectors then it computes dot-product as:
%% \end{description}
\begin{verbatim}
psb_gedot(x, y, desc_a, info)
psb_gedot(x, y, desc_a, info [,global])
\end{verbatim}
%% \syntax*{psb\_gedot}{x, y, desc\_a, info, jx, jy}
\begin{table}[h]
@@ -176,6 +175,13 @@ Scope: {\bf local} \\
Type: {\bf required}\\
Intent: {\bf in}.\\
Specified as: an object of type \descdata.
\item[global] Specifies whether the computation should include the
global reduction across all processes.\\
Scope: {\bf global} \\
Type: {\bf optional}.\\
Intent: {\bf in}.\\
Specified as: a logical scalar.
Default: \verb|global=.true.|\\
%% \item[jx] the column index of global dense matrix $x$,
%% identifying the column of subvector $x$.\\
%% Scope: {\bf global} \\
@@ -190,7 +196,8 @@ Specified as: an object of type \descdata.
%% Specified as: an integer variable $jy\ge 1$.
\item[\bf On Return]
\item[Function value] is the dot product of subvectors $x$ and $y$.\\
Scope: {\bf global} \\
Scope: {\bf global} unless the optional variable
\verb|global=.false.| as been specified\\
Specified as: a number of the data type indicated in Table~\ref{tab:f90dot}.
\item[info] Error code.\\
Scope: {\bf local} \\
@@ -198,7 +205,25 @@ Type: {\bf required} \\
Intent: {\bf out}.\\
An integer value; 0 means no error has been detected.
\end{description}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\par\noindent\large\bfseries Notes}
\begin{enumerate}
\item The computation of a global result requires a global
communication, which entails a significant overhead. It may be
necessary and/or advisable to compute multiple dot products at the same
time; in this case, it is possible to improve the runtime efficiency
by using the following scheme:
\begin{lstlisting}
vres(1) = psb_gedot(x1,y1,desc_a,info,global=.false.)
vres(2) = psb_gedot(x2,y2,desc_a,info,global=.false.)
vres(3) = psb_gedot(x3,y3,desc_a,info,global=.false.)
call psb_sum(ictxt,vres(1:3))
\end{lstlisting}
In this way the global communication, which for small sizes is a
latency-bound operation, is invoked only once.
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% F90DOT PRODUCT
%
@@ -294,8 +319,8 @@ else if $x$ is a complex vector then it computes the infinity-norm as:
%% \end{description}
\begin{verbatim}
psb_geamax(x, desc_a, info)
psb_normi(x, desc_a, info)
psb_geamax(x, desc_a, info [,global])
psb_normi(x, desc_a, info [,global])
\end{verbatim}
%% \syntax*{psb\_geamax}{x, desc\_a, info, jx}
@@ -334,7 +359,13 @@ Scope: {\bf local} \\
Type: {\bf required}\\
Intent: {\bf in}.\\
Specified as: an object of type \descdata.
%% \item[jx] the column index of global dense matrix $x$,
\item[global] Specifies whether the computation should include the
global reduction across all processes.\\
Scope: {\bf global} \\
Type: {\bf optional}.\\
Intent: {\bf in}.\\
Specified as: a logical scalar.
Default: \verb|global=.true.|\\%% \item[jx] the column index of global dense matrix $x$,
%% identifying the column of subvector $x$.\\
%% Scope: {\bf global} \\
%% Type: {\bf optional}; can only be present if $x$ is of rank 2.\\
@@ -343,7 +374,8 @@ Specified as: an object of type \descdata.
\item[\bf On Return]
\item[Function value] is the infinity norm of subvector $x$.\\
Scope: {\bf global} \\
Scope: {\bf global} unless the optional variable
\verb|global=.false.| as been specified\\
Specified as: a long precision real number.
\item[info] Error code.\\
Scope: {\bf local} \\
@@ -351,7 +383,25 @@ Type: {\bf required} \\
Intent: {\bf out}.\\
An integer value; 0 means no error has been detected.
\end{description}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\par\noindent\large\bfseries Notes}
\begin{enumerate}
\item The computation of a global result requires a global
communication, which entails a significant overhead. It may be
necessary and/or advisable to compute multiple norms at the same
time; in this case, it is possible to improve the runtime efficiency
by using the following scheme:
\begin{lstlisting}
vres(1) = psb_geamax(x1,desc_a,info,global=.false.)
vres(2) = psb_geamax(x2,desc_a,info,global=.false.)
vres(3) = psb_geamax(x3,desc_a,info,global=.false.)
call psb_amx(ictxt,vres(1:3))
\end{lstlisting}
In this way the global communication, which for small sizes is a
latency-bound operation, is invoked only once.
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Infinity norm
%
@@ -431,8 +481,8 @@ else if $x$ is a complex vector then it computes 1-norm as:
\begin{verbatim}
psb_geasum(x, desc_a, info)
psb_norm1(x, desc_a, info)
psb_geasum(x, desc_a, info [,global])
psb_norm1(x, desc_a, info [,global])
\end{verbatim}
\begin{table}[h]
@@ -469,10 +519,18 @@ Scope: {\bf local} \\
Type: {\bf required}\\
Intent: {\bf in}.\\
Specified as: an object of type \descdata.
\item[global] Specifies whether the computation should include the
global reduction across all processes.\\
Scope: {\bf global} \\
Type: {\bf optional}.\\
Intent: {\bf in}.\\
Specified as: a logical scalar.
Default: \verb|global=.true.|\\
\item[\bf On Return]
\item[Function value] is the 1-norm of vector $x$.\\
Scope: {\bf global} \\
Scope: {\bf global} unless the optional variable
\verb|global=.false.| as been specified\\
Specified as: a long precision real number.
\item[info] Error code.\\
Scope: {\bf local} \\
@@ -481,6 +539,23 @@ Intent: {\bf out}.\\
An integer value; 0 means no error has been detected.
\end{description}
{\par\noindent\large\bfseries Notes}
\begin{enumerate}
\item The computation of a global result requires a global
communication, which entails a significant overhead. It may be
necessary and/or advisable to compute multiple norms at the same
time; in this case, it is possible to improve the runtime efficiency
by using the following scheme:
\begin{lstlisting}
vres(1) = psb_geasum(x1,desc_a,info,global=.false.)
vres(2) = psb_geasum(x2,desc_a,info,global=.false.)
vres(3) = psb_geasum(x3,desc_a,info,global=.false.)
call psb_sum(ictxt,vres(1:3))
\end{lstlisting}
In this way the global communication, which for small sizes is a
latency-bound operation, is invoked only once.
\end{enumerate}
\clearpage\subsection*{psb\_geasums --- Generalized 1-Norm of Vector}
\addcontentsline{toc}{subsection}{psb\_geasums}
@@ -587,8 +662,8 @@ Long Precision Real&Long Precision Complex & psb\_genrm2 \\
\end{table}
\begin{verbatim}
psb_genrm2(x, desc_a, info)
psb_norm2(x, desc_a, info)
psb_genrm2(x, desc_a, info [,global])
psb_norm2(x, desc_a, info [,global])
\end{verbatim}
%% \syntax*{psb\_genrm2}{x, desc\_a, info, jx}
@@ -610,7 +685,13 @@ Scope: {\bf local} \\
Type: {\bf required}\\
Intent: {\bf in}.\\
Specified as: an object of type \descdata.
%% \item[jx] the column index of global dense matrix $x$,
\item[global] Specifies whether the computation should include the
global reduction across all processes.\\
Scope: {\bf global} \\
Type: {\bf optional}.\\
Intent: {\bf in}.\\
Specified as: a logical scalar.
Default: \verb|global=.true.|\\%% \item[jx] the column index of global dense matrix $x$,
%% identifying the column of subvector $x$.\\
%% Scope: {\bf global} \\
%% Type: {\bf optional}; can only be present if $x$ is of rank 2.\\
@@ -619,7 +700,8 @@ Specified as: an object of type \descdata.
\item[\bf On Return]
\item[Function Value] is the 2-norm of subvector $x$.\\
Scope: {\bf global} \\
Scope: {\bf global} unless the optional variable
\verb|global=.false.| as been specified\\
Type: {\bf required} \\
Specified as: a long precision real number.
\item[info] Error code.\\
@@ -629,6 +711,23 @@ Intent: {\bf out}.\\
An integer value; 0 means no error has been detected.
\end{description}
{\par\noindent\large\bfseries Notes}
\begin{enumerate}
\item The computation of a global result requires a global
communication, which entails a significant overhead. It may be
necessary and/or advisable to compute multiple norms at the same
time; in this case, it is possible to improve the runtime efficiency
by using the following scheme:
\begin{lstlisting}
vres(1) = psb_genrm2(x1,desc_a,info,global=.false.)
vres(2) = psb_genrm2(x2,desc_a,info,global=.false.)
vres(3) = psb_genrm2(x3,desc_a,info,global=.false.)
call psb_nrm2(ictxt,vres(1:3))
\end{lstlisting}
In this way the global communication, which for small sizes is a
latency-bound operation, is invoked only once.
\end{enumerate}
\clearpage\subsection*{psb\_genrm2s --- Generalized 2-Norm of Vector}