petsc-3.7.1 2016-05-15
Report Typos and Errors

PetscViewerSocketOpen

Opens a connection to a MATLAB or other socket based server.

Synopsis

PetscErrorCode  PetscViewerSocketOpen(MPI_Comm comm,const char machine[],int port,PetscViewer *lab)
Collective on MPI_Comm Many br

Input Parameters

comm - the MPI communicator Many br
machine - the machine the server is running on,, use NULL for the local machine, use "server" to passively wait for Many bra connection from elsewhere Many br
port - the port to connect to, use PETSC_DEFAULT for the default Many br

Output Parameter

lab -a context to use when communicating with the server Many br

Many br

Notes

Most users should employ the following commands to access the Many brMATLAB PetscViewers Many br

   PetscViewerSocketOpen(MPI_Comm comm, char *machine,int port,PetscViewer &viewer)
   MatView(Mat matrix,PetscViewer viewer)

               or

   PetscViewerSocketOpen(MPI_Comm comm,char *machine,int port,PetscViewer &viewer)
   VecView(Vec vector,PetscViewer viewer)

Options Database Keys

For use with PETSC_VIEWER_SOCKET_WORLD, PETSC_VIEWER_SOCKET_SELF, Many brPETSC_VIEWER_SOCKET_() or if Many brNULL is passed for machine or PETSC_DEFAULT is passed for port Many br
   -viewer_socket_machine <machine>
   -viewer_socket_port <port>

Environmental variables

Currently the only socket client available is MATLAB. See Many brsrc/dm/da/examples/tests/ex12.c and ex12.m for an example of usage. Many br

Notes: The socket viewer is in some sense a subclass of the binary viewer, to read and write to the socket Many bruse PetscViewerBinaryRead/Write/GetDescriptor(). Many br

See Also

MatView(), VecView(), PetscViewerDestroy(), PetscViewerCreate(), PetscViewerSetType(),
PetscViewerSocketSetConnection(), PETSC_VIEWER_SOCKET_, PETSC_VIEWER_SOCKET_WORLD, Many brPETSC_VIEWER_SOCKET_SELF, PetscViewerBinaryWrite(), PetscViewerBinaryRead(), PetscViewerBinaryWriteStringArray(), Many brPetscBinaryViewerGetDescriptor() Many br

Level:intermediate
Location:
src/sys/classes/viewer/impls/socket/send.c
Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/vec/vec/examples/tutorials/ex42a.c.html
PETSC_VIEWER_SOCKET_PORT portnumber- - PETSC_VIEWER_SOCKET_MACHINE machine name Many br