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 86 87 88 89 90 91 92 93
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerSocketOpen.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscViewerSocketOpen</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="PetscViewerSocketOpen"><H1>PetscViewerSocketOpen</H1></A>
Opens a connection to a MATLAB or other socket based server.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
PetscErrorCode PetscViewerSocketOpen(MPI_Comm comm,const char machine[],int port,PetscViewer *lab)
</PRE>
Collective on <A HREF="../Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</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>comm </B></TD><TD>- the MPI communicator
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>machine </B></TD><TD>- the machine the server is running on,, use NULL for the local machine, use "server" to passively wait for
a connection from elsewhere
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>port </B></TD><TD>- the port to connect to, use <A HREF="../Sys/PETSC_DEFAULT.html#PETSC_DEFAULT">PETSC_DEFAULT</A> for the default
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>lab </B> -a context to use when communicating with the server
<br>
<P>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
Most users should employ the following commands to access the
MATLAB <A HREF="../Viewer/PetscViewers.html#PetscViewers">PetscViewers</A>
<pre>
</pre>
<pre>
<A HREF="../Viewer/PetscViewerSocketOpen.html#PetscViewerSocketOpen">PetscViewerSocketOpen</A>(<A HREF="../Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A> comm, char *machine,int port,<A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> &viewer)
</pre>
<pre>
<A HREF="../Mat/MatView.html#MatView">MatView</A>(<A HREF="../Mat/Mat.html#Mat">Mat</A> matrix,<A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> viewer)
</pre>
<pre>
</pre>
<pre>
or
</pre>
<pre>
</pre>
<pre>
<A HREF="../Viewer/PetscViewerSocketOpen.html#PetscViewerSocketOpen">PetscViewerSocketOpen</A>(<A HREF="../Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A> comm,char *machine,int port,<A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> &viewer)
</pre>
<pre>
<A HREF="../Vec/VecView.html#VecView">VecView</A>(<A HREF="../Vec/Vec.html#Vec">Vec</A> vector,<A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> viewer)
</pre>
<P>
<H3><FONT COLOR="#CC3333">Options Database Keys</FONT></H3>
For use with <A HREF="../Viewer/PETSC_VIEWER_SOCKET_WORLD.html#PETSC_VIEWER_SOCKET_WORLD">PETSC_VIEWER_SOCKET_WORLD</A>, <A HREF="../Viewer/PETSC_VIEWER_SOCKET_SELF.html#PETSC_VIEWER_SOCKET_SELF">PETSC_VIEWER_SOCKET_SELF</A>,
<A HREF="../Viewer/PETSC_VIEWER_SOCKET_.html#PETSC_VIEWER_SOCKET_">PETSC_VIEWER_SOCKET_</A>() or if
NULL is passed for machine or <A HREF="../Sys/PETSC_DEFAULT.html#PETSC_DEFAULT">PETSC_DEFAULT</A> is passed for port
<pre>
-viewer_socket_machine <machine>
</pre>
<pre>
-viewer_socket_port <port>
</pre>
<P>
<H3><FONT COLOR="#CC3333">Environmental variables</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>PETSC_VIEWER_SOCKET_PORT portnumber</B></TD><TD>- - PETSC_VIEWER_SOCKET_MACHINE machine name
</TD></TR>
<P>
Currently the only socket client available is MATLAB. See
src/dm/da/examples/tests/ex12.c and ex12.m for an example of usage.
<P>
Notes: The socket viewer is in some sense a subclass of the binary viewer, to read and write to the socket
use <A HREF="../Viewer/PetscViewerBinaryRead.html#PetscViewerBinaryRead">PetscViewerBinaryRead</A>/Write/GetDescriptor().
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Mat/MatView.html#MatView">MatView</A>(), <A HREF="../Vec/VecView.html#VecView">VecView</A>(), <A HREF="../Viewer/PetscViewerDestroy.html#PetscViewerDestroy">PetscViewerDestroy</A>(), <A HREF="../Viewer/PetscViewerCreate.html#PetscViewerCreate">PetscViewerCreate</A>(), <A HREF="../Viewer/PetscViewerSetType.html#PetscViewerSetType">PetscViewerSetType</A>(),
<BR><A HREF="../Viewer/PetscViewerSocketSetConnection.html#PetscViewerSocketSetConnection">PetscViewerSocketSetConnection</A>(), <A HREF="../Viewer/PETSC_VIEWER_SOCKET_.html#PETSC_VIEWER_SOCKET_">PETSC_VIEWER_SOCKET_</A>, <A HREF="../Viewer/PETSC_VIEWER_SOCKET_WORLD.html#PETSC_VIEWER_SOCKET_WORLD">PETSC_VIEWER_SOCKET_WORLD</A>,
<A HREF="../Viewer/PETSC_VIEWER_SOCKET_SELF.html#PETSC_VIEWER_SOCKET_SELF">PETSC_VIEWER_SOCKET_SELF</A>, <A HREF="../Viewer/PetscViewerBinaryWrite.html#PetscViewerBinaryWrite">PetscViewerBinaryWrite</A>(), <A HREF="../Viewer/PetscViewerBinaryRead.html#PetscViewerBinaryRead">PetscViewerBinaryRead</A>(), <A HREF="../Viewer/PetscViewerBinaryWriteStringArray.html#PetscViewerBinaryWriteStringArray">PetscViewerBinaryWriteStringArray</A>(),
PetscBinaryViewerGetDescriptor()
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/sys/classes/viewer/impls/socket/send.c.html#PetscViewerSocketOpen">src/sys/classes/viewer/impls/socket/send.c</A>
<BR><A HREF="./index.html">Index of all Viewer 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/vec/vec/examples/tutorials/ex42a.c.html">src/vec/vec/examples/tutorials/ex42a.c.html</A><BR>
</BODY></HTML>
|