Fixed problem with psb_exit not calling blacs_exit, changed interface

and documentation.
psblas3-type-indexed
Salvatore Filippone 18 years ago
parent aaf84405ee
commit 2d3405786b

@ -80,6 +80,7 @@ Specified as: an integer variable. \
\subroutine{psb\_exit}{Exit from PSBLAS parallel environment} \subroutine{psb\_exit}{Exit from PSBLAS parallel environment}
\syntax{call psb\_exit}{icontxt} \syntax{call psb\_exit}{icontxt}
\syntax*{call psb\_exit}{icontxt,close}
This subroutine exits from the PSBLAS parallel virtual machine. This subroutine exits from the PSBLAS parallel virtual machine.
\begin{description} \begin{description}
@ -89,13 +90,24 @@ This subroutine exits from the PSBLAS parallel virtual machine.
Scope:{\bf global}.\\ Scope:{\bf global}.\\
Type:{\bf required}.\\ Type:{\bf required}.\\
Specified as: an integer variable. Specified as: an integer variable.
\item[close] Whether to close all data structures related to the
virtual parallel machine, besides those associated with icontxt.\\
Scope:{\bf global}.\\
Type:{\bf optional}.\\
Specified as: a logical variable, default value: true.
\end{description} \end{description}
\section*{Notes} \section*{Notes}
\begin{enumerate} \begin{enumerate}
\item This routine may be called even if a previous call to \item This routine may be called even if a previous call to
\verb|psb_info| has returned with $iam=-1$; indeed, it it is the only \verb|psb_info| has returned with $iam=-1$; indeed, it it is the only
routine that may be called with argument \verb|icontxt| in this situation. routine that may be called with argument \verb|icontxt| in this
situation.
\item If the user wants to use multiple communication contexts in the
same program, this routine may be called multiple times to
selectively close the contexts with \verb|close=.false.|, while on
the last call it should be called with \verb|close=.true.| to
shutdown in a clean way the entire parallel environment.
\end{enumerate} \end{enumerate}
@ -271,6 +283,15 @@ scalar, or a rank 1 or 2 array. \\
Type, rank and size must agree on all processes. Type, rank and size must agree on all processes.
\end{description} \end{description}
\section*{Notes}
\begin{enumerate}
\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}
\subroutine{psb\_amx}{Global maximum absolute value} \subroutine{psb\_amx}{Global maximum absolute value}
\syntax{call psb\_amx}{icontxt, dat, root} \syntax{call psb\_amx}{icontxt, dat, root}
@ -308,6 +329,14 @@ scalar, or a rank 1 or 2 array. \
Type, rank and size must agree on all processes. Type, rank and size must agree on all processes.
\end{description} \end{description}
\section*{Notes}
\begin{enumerate}
\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}
\subroutine{psb\_amn}{Global minimum absolute value} \subroutine{psb\_amn}{Global minimum absolute value}
\syntax{call psb\_amn}{icontxt, dat, root} \syntax{call psb\_amn}{icontxt, dat, root}
@ -346,6 +375,14 @@ Type, rank and size must agree on all processes.
\end{description} \end{description}
\section*{Notes}
\begin{enumerate}
\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}
\subroutine{psb\_snd}{Send data} \subroutine{psb\_snd}{Send data}
\syntax{call psb\_snd}{icontxt, dat, dst, m} \syntax{call psb\_snd}{icontxt, dat, dst, m}

@ -178,16 +178,22 @@ contains
end subroutine psb_init end subroutine psb_init
subroutine psb_exit(ictxt) subroutine psb_exit(ictxt,close)
integer, intent(in) :: ictxt integer, intent(in) :: ictxt
logical, intent(in), optional :: close
logical :: close_
integer :: nprow, npcol, myprow, mypcol integer :: nprow, npcol, myprow, mypcol
if (present(close)) then
close_ = close
else
close_ = .true.
end if
call blacs_gridinfo(ictxt, nprow, npcol, myprow, mypcol) call blacs_gridinfo(ictxt, nprow, npcol, myprow, mypcol)
if ((myprow >=0).and.(mypcol>=0)) then if ((myprow >=0).and.(mypcol>=0)) then
call blacs_gridexit(ictxt) call blacs_gridexit(ictxt)
end if end if
if (close_) call blacs_exit(0)
end subroutine psb_exit end subroutine psb_exit

Loading…
Cancel
Save