File: VecScatterBegin.html

package info (click to toggle)
petsc 2.3.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 77,732 kB
  • ctags: 314,526
  • sloc: ansic: 254,277; python: 26,350; cpp: 18,257; fortran: 15,694; makefile: 11,000; sh: 3,638; xml: 620; csh: 211
file content (85 lines) | stat: -rw-r--r-- 5,726 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecScatterBegin</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="VecScatterBegin"><H1>VecScatterBegin</H1></A>
Begins a generalized scatter from one vector to another. Complete the scattering phase with <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>(). 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h" 
PetscErrorCode  VecScatterBegin(Vec x,Vec y,InsertMode addv,ScatterMode mode,VecScatter inctx)
</PRE>
Collective on <A HREF="../Vec/VecScatter.html#VecScatter">VecScatter</A> and <A HREF="../Vec/Vec.html#Vec">Vec</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>x </B></TD><TD>- the vector from which we scatter
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>y </B></TD><TD>- the vector to which we scatter
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>addv </B></TD><TD>- either <A HREF="../Sys/ADD_VALUES.html#ADD_VALUES">ADD_VALUES</A> or <A HREF="../Sys/INSERT_VALUES.html#INSERT_VALUES">INSERT_VALUES</A>, with <A HREF="../Sys/INSERT_VALUES.html#INSERT_VALUES">INSERT_VALUES</A> mode any location 
not scattered to retains its old value; i.e. the vector is NOT first zeroed.
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>mode </B></TD><TD>- the scattering mode, usually <A HREF="../Sys/SCATTER_FORWARD.html#SCATTER_FORWARD">SCATTER_FORWARD</A>.  The available modes are:
<A HREF="../Sys/SCATTER_FORWARD.html#SCATTER_FORWARD">SCATTER_FORWARD</A> or <A HREF="../Sys/SCATTER_REVERSE.html#SCATTER_REVERSE">SCATTER_REVERSE</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>inctx </B></TD><TD>- scatter context generated by <A HREF="../Vec/VecScatterCreate.html#VecScatterCreate">VecScatterCreate</A>()
</TD></TR></TABLE>
<P>

<P>
Options Database
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_rr   </B></TD><TD>- use ready receiver mode (i.e. receives are post BEFORE sends)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_ssend  </B></TD><TD>- use MPI_Ssend() instead of MPI_Send()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_packtogether </B></TD><TD>- packs all the message before sending any and receivers all
before sending. Default for the alltoall versions.
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_sendfirst </B></TD><TD>- post ALL sends before posting receives (cannot be used with -vecscatter_rr)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_alltoallv </B></TD><TD>- use MPI_Alltoallv() instead of sends and receives
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_alltoallw  </B></TD><TD>- use MPI_Alltoallw() instead of MPI_Alltoallv() for <A HREF="../Sys/INSERT_VALUES.html#INSERT_VALUES">INSERT_VALUES</A>
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The vectors x and y need not be the same vectors used in the call
to <A HREF="../Vec/VecScatterCreate.html#VecScatterCreate">VecScatterCreate</A>(), but x must have the same parallel data layout
as that passed in as the x to <A HREF="../Vec/VecScatterCreate.html#VecScatterCreate">VecScatterCreate</A>(), similarly for the y.
Most likely they have been obtained from <A HREF="../Vec/VecDuplicate.html#VecDuplicate">VecDuplicate</A>().
<P>
You cannot change the values in the input vector between the calls to <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>()
and <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>().
<P>
If you use <A HREF="../Sys/SCATTER_REVERSE.html#SCATTER_REVERSE">SCATTER_REVERSE</A> the first two arguments should be reversed, from
the <A HREF="../Sys/SCATTER_FORWARD.html#SCATTER_FORWARD">SCATTER_FORWARD</A>.
<P>
y[iy[i]] = x[ix[i]], for i=0,...,ni-1
<P>
This scatter is far more general than the conventional
scatter, since it can be a gather or a scatter or a combination,
depending on the indices ix and iy.  If x is a parallel vector and y
is sequential, <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>() can serve to gather values to a
single processor.  Similarly, if y is parallel and x sequential, the
routine can scatter from one processor to many processors.
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Vec/VecScatterCreate.html#VecScatterCreate">VecScatterCreate</A>(), <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/vec/vec/utils/vscat.c.html#VecScatterBegin">src/vec/vec/utils/vscat.c</A>
<BR><A HREF="./index.html">Index of all Vec routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex33.c.html">src/ksp/ksp/examples/tutorials/ex33.c.html</A><BR>
<A HREF="../../../src/dm/ao/examples/tutorials/ex2.c.html">src/dm/ao/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/dm/da/examples/tutorials/ex2.c.html">src/dm/da/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/dm/da/examples/tutorials/ex6.c.html">src/dm/da/examples/tutorials/ex6.c.html</A><BR>
<A HREF="../../../src/dm/da/examples/tutorials/ex6f90.F.html">src/dm/da/examples/tutorials/ex6f90.F.html</A><BR>
</BODY></HTML>