File: VecScatterCreate.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 (84 lines) | stat: -rw-r--r-- 5,708 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecScatterCreate</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="VecScatterCreate"><H1>VecScatterCreate</H1></A>
Creates a vector scatter context. 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h" 
PetscErrorCode  VecScatterCreate(Vec xin,IS ix,Vec yin,IS iy,VecScatter *newctx)
</PRE>
Collective on <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>xin </B></TD><TD>- a vector that defines the shape (parallel data layout of the vector)
of vectors from which we scatter
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>yin </B></TD><TD>- a vector that defines the shape (parallel data layout of the vector)
of vectors to which we scatter
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ix </B></TD><TD>- the indices of xin to scatter (if <A HREF="../Sys/PETSC_NULL.html#PETSC_NULL">PETSC_NULL</A> scatters all values)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>iy </B></TD><TD>- the indices of yin to hold results (if <A HREF="../Sys/PETSC_NULL.html#PETSC_NULL">PETSC_NULL</A> fills entire vector yin)
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>newctx </B> -location to store the new scatter context
<br>
<P>
<H3><FONT COLOR="#CC3333">Options Database Keys</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_merge        </B></TD><TD>- <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>() handles all of the communication, <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>() is a nop 
eliminates the chance for overlap of computation and communication 
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_ssend        </B></TD><TD>- Uses MPI_Ssend_init() instead of MPI_Send_init() 
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_sendfirst    </B></TD><TD>- Posts sends before receives 
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_rr           </B></TD><TD>- use ready receiver mode for MPI sends 
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-vecscatter_packtogether </B></TD><TD>- Pack all messages before sending, receive all messages before unpacking
ONLY implemented for BLOCK SIZE of 4 and 12! (others easily added)
</TD></TR></TABLE>
<P>

<P>
<H3><FONT COLOR="#CC3333">C++ variants</FONT></H3><TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD> VecScatter VecScatterCreate(Vec x,Vec y,IS is)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>VecScatterCreate(x,PETSC_NULL,y,is,&s); return s;</TR></TD>

<TR><TD WIDTH=40></TD><TD>&nbsp VecScatterCreate(Vec x,Vec y,IS is,VecScatter *s)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>VecScatterCreate(x,PETSC_NULL,y,is,s)</TR></TD>

<TR><TD WIDTH=40></TD><TD> VecScatter VecScatterCreate(Vec x,IS is,Vec y)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>VecScatterCreate(x,is,y,PETSC_NULL,&s); return s;</TR></TD>

<TR><TD WIDTH=40></TD><TD>&nbsp VecScatterCreate(Vec x,IS is,Vec y,VecScatter *s)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>VecScatterCreate(x,is,y,PETSC_NULL,s)</TR></TD>

<TR><TD WIDTH=40></TD><TD> VecScatter VecScatterCreate(Vec x,IS is1,Vec y,IS is2)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>VecScatterCreate(x,is1,y,is2,&s); return s;</TR></TD>

</TABLE>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
In calls to <A HREF="../Vec/VecScatter.html#VecScatter">VecScatter</A>() you can use different vectors than the xin and
yin you used above; BUT they must have the same parallel data layout, for example,
they could be obtained from <A HREF="../Vec/VecDuplicate.html#VecDuplicate">VecDuplicate</A>().
A <A HREF="../Vec/VecScatter.html#VecScatter">VecScatter</A> context CANNOT be used in two or more simultaneous scatters;
that is you cannot call a second <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>() with the same scatter
context until the <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>() has been called on the first <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>().
In this case a separate <A HREF="../Vec/VecScatter.html#VecScatter">VecScatter</A> is needed for each concurrent scatter.
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Vec/VecScatterDestroy.html#VecScatterDestroy">VecScatterDestroy</A>(), <A HREF="../Vec/VecScatterCreateToAll.html#VecScatterCreateToAll">VecScatterCreateToAll</A>(), <A HREF="../Vec/VecScatterCreateToZero.html#VecScatterCreateToZero">VecScatterCreateToZero</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#VecScatterCreate">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/dm/ao/examples/tutorials/ex2.c.html">src/dm/ao/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>