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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscViewerSocketOpen</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<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><A HREF="../Sys/comm.html#comm">comm</A> </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
</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> <A HREF="../Sys/comm.html#comm">comm</A>, 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> <A HREF="../Sys/comm.html#comm">comm</A>,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 the default Matlab <A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</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/PETSC_VIEWER_SOCKET_.html#PETSC_VIEWER_SOCKET_">PETSC_VIEWER_SOCKET_</A>() or if
<A HREF="../Sys/PETSC_NULL.html#PETSC_NULL">PETSC_NULL</A> 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>
<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>
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/sys/viewer/impls/socket/send.c.html#PetscViewerSocketOpen">src/sys/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/snes/examples/tutorials/ex29.c.html">src/snes/examples/tutorials/ex29.c.html</A><BR>
</BODY></HTML>
|