VisitWriter

Synopsis

This module writes data to a visit connection.


module VisitWriter<src_file="VisitWriter.c"> {
   int+IPort2    SockID = -1;
   int+IPort2    Trigger = 0;
   double+IPort2 TimeStamp = 0.;
   int+IPort2 DataInt[];
   byte+IPort2 DataByte[];
   short+IPort2 DataShort[];
   double+IPort2 DataDouble[];
   string+IPort2 DataString = "";
   int+IPort2 DataIntScalar = -1;
   byte+IPort2 DataByteScalar = -1;
   short+IPort2 DataShortScalar = -1;
   double+IPort2 DataDoubleScalar = -1.;
   int+IPort2 n1 = -1;
   int+IPort2 n2 = -1;
   int+IPort2 n3 = -1;
   int+IPort2 n4 = -1;
   int o1 = -1;
   int o2 = -1;
   int o3 = -1;
   int o4 = -1;
   int s1 = -1;
   int s2 = -1;
   int s3 = -1;
   int s4 = -1;
   omethod+req VisitWriter_read(
      SockID+read+req,
      Trigger+read+notify+req,
      TimeStamp+read,
      n1+read,
      n2+read,
      n3+read,
      n4+read,
      o1+read,
      o2+read,
      o3+read,
      o4+read,
      s1+read,
      s2+read,
      s3+read,
      s4+read,
      DataInt+read,
      DataByte+read,
      DataShort+read,
      DataDouble+read,
      DataString+read,
      DataIntScalar+read,
      DataByteScalar+read,
      DataShortScalar+read,
      DataDoubleScalar+read
   ) = "VisitWriter_read";
};

Description

This module sends data to a remote application. The remote application it should connect to is specified by the SockID input. This input will normally be provided by the VisitServer module that has created the connection. The module is triggered whenever data arrives at the Trigger port. The Trigger input can be connected directly to the Trigger output port of a VisitServer if only one VisitReader or VisitWriter module is being used. If more than one VisitReader or VisitWriter is connected to a VisitServer it is necessary to use a Multiplexer in order to select a VisitReader or VisitWriter module for each request. There is no implicit distinction between read and write requests. Therefore the user is responsible for using different IDs for read and write requests. When writing data the Trigger output of the VisitServer module will be activated by a request from the remote application. This request can be generated by a visit_recv_4d or visit_recv_string function call.

Whenever the module is triggered the data that is present on the input ports is sent to the remote application. When requesting data the remote application will request a specific datatype with specific array dimensionality and bounds. The datatype of the request is used to select which of the various input ports should be read from. If the remote application requests a scalar value this value is sent and no further checks are made. If an array of values is requested the array dimensionality and bounds are used to make sure that the module does not send more data than the remote application expects. However the n1 ... n4 input ports can be used to override this dimensionality check. Normally these values will be all be set to -1. In this case the dimensions requested by the remote application are used. If the input array is smaller than the requested size it is collapsed to a 1D array and sent. However if the n1 .. n4 input ports are given values other than -1 then these values will be used as the dimensions of the array sent back to the remote application. In this case the product of these dimensions must equal the total size of the input array.

If this sounds obscure to you please do not worry. If you make sure that the AVS/Express application always provides the data that the remote application expects you will be able to leave the parameters n1 to n4 set to their default value of -1.

The VisitWriter module should be used in conjunction with the modules Multiplexer, VisitServer and VisitReader.

Before this module can be compiled and used the VISIT library must be installed. For information on how to install this library please see the VISIT library(http://www.fz-juelich.de/zam/visit) home page. A complete set of documentation for the VISIT-library can also be found at this URL.

The Visit IAC project assumes that the VISIT library has been installed into the default directory i.e.

/usr/local/visit/

If this is not the case then the references to that directory in the visit_mods.v file will have to be modified.

Inputs

SockID

Integer input port that contains a socket descriptor. This socket descriptor specifies the data-connection to the remote application. This input port should be connected to the SockID output port of the VisitServer module.

Trigger

When this input is triggered the VisitWriter module will attempt to send a message to the remote application. Normally this port should be connected to the Trigger output port of the VisitServer module. This should be done by either making a direct connection or making an indirect connection through a Multiplexer module.

Timestamp, n1, n2, n3, n4

Contain the header-information that will be send to the remote application. If the values of the n1 to n4 inputs are not set to -1 they will be used as the dimensions of the array that will be sent to the remote application. In this case the product of these dimensions must match the total size of the input data array.

DataString

If the requested datatype is STRING the value given by this input port will be sent to the remote application.

DataInt, DataShort, DataByte, DataDouble

If an array of data values has been requested one of these array inputs will be sent to the remote application. The input used depends upon the requested datatype. If only a single value is requested the value presented at the appropriate scalar input port will be used.

DataIntScalar, DataShortScalar, DataByteScalar, DataDoubleScalar

If a single data value has been requested on of these scalar inputs will be sent to the remote application. The input used depends upon the requested datatype. If an array of values is requested the values presented at the appropriate array input port will be used.

Utility Modules

The low-level module VisitWriter is used in the Functional Macro visitwriter.

Example

Examples of the use of this module can be found in the VisitSimpleEg and VisitGoLEg example applications.

Files

iac_proj/visit/visit_mods.v contains the V definition of the VisitWriter module.

Other Notes

By default the low-level library VisitMods, which needs to be compiled, has the process set to express. Therefore express must not be running while this project is compiled.

Before the Visit project can be compiled the VISIT library must be installed, configured and compiled. For full instructions please see the VISIT library web-site.

The Visit IAC project assumes that the VISIT library has been installed into the default directory i.e.

/usr/local/visit/

If this is not the case then the references to that directory in the visit_mods.v file will have to be modified.

Author

Wolfgang Frings
Central Institute for Applied Mathematics
Research Center Juelich
D-52425 Juelich
Germany

Modifications

Ma YingLiang,
Manchester Visualization Centre
Andrew Dodd,
International AVS Centre

Contact

Wolfgang Frings
Central Institute for Applied Mathematics
Forschungszentrum Juelich GmbH
D-52425 Juelich
Germany
E-mail: W.Frings@fz-juelich.de
International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL
E-mail: avs@iavsc.org

See Also