<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<!--Converted with LaTeX2HTML 2018 (Released Feb 1, 2018) -->
<HTML>
<HEAD>
<TITLE>psb_nrm2 -- Global 2-norm reduction</TITLE>
<META NAME="description" CONTENT="psb_nrm2 -- Global 2-norm reduction">
<META NAME="keywords" CONTENT="userhtml">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2018">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="userhtml.css">

<LINK REL="next" HREF="node118.html">
<LINK REL="previous" HREF="node116.html">
<LINK REL="up" HREF="node102.html">
<LINK REL="next" HREF="node118.html">
</HEAD>

<BODY >

<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html1730"
  HREF="node118.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1726"
  HREF="node102.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1720"
  HREF="node116.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1728"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html1731"
  HREF="node118.html">psb_snd   Send</A>
<B> Up:</B> <A NAME="tex2html1727"
  HREF="node102.html">Parallel environment routines</A>
<B> Previous:</B> <A NAME="tex2html1721"
  HREF="node116.html">psb_amn   Global</A>
 &nbsp; <B>  <A NAME="tex2html1729"
  HREF="node1.html">Contents</A></B> 
<BR>
<BR></DIV>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION000815000000000000000">
psb_nrm2 -- Global 2-norm reduction</A>
</H2>

<P>
<PRE>
call psb_nrm2(icontxt, dat, root)
</PRE>

<P>
This subroutine implements a 2-norm value reduction 
operation based on the underlying communication library. 
<DL>
<DT><STRONG>Type:</STRONG></DT>
<DD>Synchronous.
</DD>
<DT><STRONG><B>On Entry </B></STRONG></DT>
<DD>
</DD>
<DT><STRONG>icontxt</STRONG></DT>
<DD>the communication context identifying the virtual
  parallel machine.
<BR>
Scope: <B>global</B>.
<BR>
Type: <B>required</B>.
<BR>
Intent: <B>in</B>.
<BR>
Specified as: an integer variable.
</DD>
<DT><STRONG>dat</STRONG></DT>
<DD>The local contribution to the global minimum.
<BR>
Scope: <B>local</B>.
<BR>
Type: <B>required</B>.
<BR>
Intent: <B>inout</B>.
<BR>
Specified as: a real variable, which may be a
scalar, or a rank 1 array.  Kind, rank and size must agree on all processes.
</DD>
<DT><STRONG>root</STRONG></DT>
<DD>Process to hold the final value, or <SPAN CLASS="MATH"><IMG
 WIDTH="24" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img82.png"
 ALT="$-1$"></SPAN> to make it available
  on all processes.
<BR>
Scope: <B>global</B>.
<BR>
Type: <B>optional</B>.
<BR>
Intent: <B>in</B>.
<BR>
Specified as: an integer value <!-- MATH
 $-1<= root <= np-1$
 -->
<SPAN CLASS="MATH"><IMG
 WIDTH="165" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img141.png"
 ALT="$-1&lt;= root &lt;= np-1$"></SPAN>, default -1. 
<BR></DD>
</DL>

<P>
<DL>
<DT><STRONG><B>On Return</B></STRONG></DT>
<DD>
</DD>
<DT><STRONG>dat</STRONG></DT>
<DD>On destination process(es), the result of the 2-norm reduction.
<BR>
Scope: <B>global</B>.
<BR>
Type: <B>required</B>.
<BR>
Intent: <B>inout</B>.
<BR>
Specified as: a real variable, which may be a
scalar, or a rank 1 array. 
<BR>
Kind, rank and size must agree on all processes.
</DD>
</DL>

<P>
<BIG CLASS="LARGE"><B>Notes</B></BIG>

<OL>
<LI>This reduction is appropriate to compute the results of multiple
  (local) NRM2 operations at the same time. 
</LI>
<LI>Denoting by <SPAN CLASS="MATH"><IMG
 WIDTH="32" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
 SRC="img142.png"
 ALT="$dat_i$"></SPAN> the value of the variable <SPAN CLASS="MATH"><IMG
 WIDTH="26" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img143.png"
 ALT="$dat$"></SPAN> on process
  <SPAN CLASS="MATH"><IMG
 WIDTH="9" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img4.png"
 ALT="$i$"></SPAN>, the output <SPAN CLASS="MATH"><IMG
 WIDTH="26" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
 SRC="img29.png"
 ALT="$res$"></SPAN> is equivalent to the computation of
  <BR><P></P>
<DIV ALIGN="CENTER" CLASS="mathdisplay">
<!-- MATH
 \begin{displaymath}
res = \sqrt{\sum_i dat_i^2},
\end{displaymath}
 -->

<IMG
 WIDTH="119" HEIGHT="55" BORDER="0"
 SRC="img144.png"
 ALT="\begin{displaymath}res = \sqrt{\sum_i dat_i^2},\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
with care taken to avoid unnecessary overflow.
</LI>
<LI>The <code>dat</code> argument is both input and output, and its
  value may be changed even on processes different from the final
  result destination.
</LI>
</OL>

<P>

<DIV CLASS="navigation"><HR>
<!--Navigation Panel-->
<A NAME="tex2html1730"
  HREF="node118.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1726"
  HREF="node102.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1720"
  HREF="node116.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1728"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html1731"
  HREF="node118.html">psb_snd   Send</A>
<B> Up:</B> <A NAME="tex2html1727"
  HREF="node102.html">Parallel environment routines</A>
<B> Previous:</B> <A NAME="tex2html1721"
  HREF="node116.html">psb_amn   Global</A>
 &nbsp; <B>  <A NAME="tex2html1729"
  HREF="node1.html">Contents</A></B> </DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>