[BACK]Return to openxm-clients.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / issac2000

Annotation of OpenXM/doc/issac2000/openxm-clients.tex, Revision 1.5

1.5     ! takayama    1: % $OpenXM: OpenXM/doc/issac2000/openxm-clients.tex,v 1.4 2000/01/13 09:21:34 ohara Exp $
1.2       takayama    2:
                      3: \section{OpenXM Clients}
1.3       noro        4:
                      5: \subsection{Risa/Asir}
                      6:
                      7: Risa/Asir provides a launcher to invoke an OpenXM server and to set up the
                      8: communication between the server and itself. It also provides primitives
                      9: for communication as built-in functions.
                     10:
                     11: \subsubsection{{\tt ox\_launch}}
                     12: {\tt ox\_launch} is a general purpose launcher.  This application
                     13: invokes a server and initiates the server-client communication
                     14: according to the protocol stated in Section \ref{launcher}, then
                     15: itself becomes a control server.
                     16: Several facilities related to {{\tt ox\_launch}} are provided
                     17: as built-in functions of Risa/Asir: a function to invoke a server
                     18: automatically from a give host name and a server name, and a set
                     19: of functions to execute the port generation, {\tt bind}, {\tt listen},
                     20: {\tt connect} and {\tt accept} operations on sockets individually.
                     21:
                     22: \subsubsection{Manipulating servers}
                     23:
                     24: Fundamental operations on OpenXM servers are sending and receiving
                     25: of {\tt OX} data and sending of {\tt OX} commands. The following functions
                     26: are provided to execute these primitive operations:
                     27: {\tt ox\_push\_cmo()} for pushing data to a server,
                     28: {\tt ox\_push\_cmd()} for sending an {\tt SM} command to a server
                     29: and {\tt ox\_get()} for receiving data from a stream.
                     30:
                     31: Some operations including the reset operation are realized by
                     32: combining these primitives.  Among them, frequently used ones are
                     33: provided as built-in functions. We show several ones.
                     34:
                     35: \begin{itemize}
                     36: \item {\tt ox\_pop\_cmo()}
                     37:
                     38: It requests a server to send data on the stack to the stream, then
                     39: it receives the data from the stream.
                     40:
                     41: \item {\tt ox\_cmo\_rpc()}
                     42:
                     43: After pushing the name of a function, arguments and the number of the
1.4       ohara      44: arguments to the stack of a server, it request the server to execute
1.3       noro       45: the function. It does not wait the termination of the function call.
                     46:
                     47: \item {\tt ox\_reset()}
                     48:
                     49: After sending {\tt SM\_control\_reset\_connection} to a control server,
                     50: it completes the operations stated in Section \ref{control}.
                     51: \end{itemize}
                     52: Furthermore {\tt ox\_select()} is provided to detect streams ready for
                     53: reading. It is realized by the {\tt select()} system call and is used
                     54: to avoid blocking on read operations.
1.4       ohara      55:
                     56: \subsection{Mathematica}
                     57:
                     58: We provide an OpenXM client {\tt math2ox} written as an external module
                     59: for Mathematica.  Our client communicates to Mathematica by MathLink and
1.5     ! takayama   60: to an OpenXM server by OpenXM protocols.
        !            61: By using the module {\tt math2ox},
        !            62: we can call OpenXM servers from Mathematica;
        !            63: here is an example of a computation of the de Rham cohomology groups
        !            64: of ${\bf C}^2 \setminus V(x^3-y^2)$.
        !            65: {\footnotesize
        !            66: \begin{verbatim}
        !            67: In[1]:= Install["math2ox"]
        !            68: In[2]:= OxStart["../lib/sm1/bin/ox_sm1_forAsir"]
        !            69: In[3]:= OxExecute[" [(x^3-y^2) (x,y)] deRham "]
        !            70: In[4]:= OxPopString[]
        !            71: Out[4]=  [ 1 , 1 , 0 ]
        !            72: \end{verbatim}
        !            73: }
1.4       ohara      74:
                     75: \subsubsection{Functions}
                     76:
1.5     ! takayama   77: The {\tt math2ox} has the following functions
        !            78: which respectively correspond those in Risa/Asir.
1.4       ohara      79: \begin{quote}
                     80: {\tt OxStart[s\_String]} \\
                     81: {\tt OxStartInsecure[s\_String]} \\
                     82: {\tt OxExecuteString[s\_String]}  \\
                     83: {\tt OxParse[s\_String]} \\
                     84: {\tt OxGet[]} \\
                     85: {\tt OxPopCMO[]} \\
                     86: {\tt OxPopString[]} \\
                     87: {\tt OxClose[]} \\
                     88: {\tt OxReset[]}
                     89: \end{quote}
                     90: For example, the {\tt OxPopCMO[]} function above requests a server to
                     91: send data on the stack to the stream, then it receives the data from the
                     92: stream.
                     93:
                     94: By using the {\tt OxParse[]} function, we can send suitable OX messages,
1.5     ! takayama   95: written by the OX expression, to a server.  OX expressions are
1.4       ohara      96: Lisp-like expressions for OX messages and are defined
1.5     ! takayama   97: in~\cite{noro-takayama}.
        !            98: The {\tt OxGet[]} receives an OX data message
        !            99: and returns its translation to an local object.
        !           100:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>