[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.7

1.7     ! takayama    1: % $OpenXM: OpenXM/doc/issac2000/openxm-clients.tex,v 1.6 2000/01/16 03:15:49 noro 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
1.6       noro        8: communication between the server and itself. As a client,
                      9: it provides many built-in functions for communication.
1.3       noro       10:
1.6       noro       11: \subsubsection{Setting up servers}
1.3       noro       12: {\tt ox\_launch} is a general purpose launcher.  This application
1.6       noro       13: invokes a server and sets up the server-client communication
1.3       noro       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}
1.6       noro       23: Fundamental operations on OpenXM servers are
                     24: exchange of {\tt OX} data and sending of {\tt SM} commands.
                     25: The following functions
1.3       noro       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.6       noro       44: arguments to the stack of a server, it requests 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
1.7     ! takayama   59: for Mathematica.
        !            60: The module {\tt math2ox} communicates with Mathematica by MathLink and
        !            61: with any OpenXM server by the OpenXM protocol.
1.5       takayama   62: By using the module {\tt math2ox},
                     63: we can call OpenXM servers from Mathematica;
                     64: here is an example of a computation of the de Rham cohomology groups
1.7     ! takayama   65: of ${\bf C}^2 \setminus V(x^3-y^2)$ from Mathematica.
1.5       takayama   66: {\footnotesize
                     67: \begin{verbatim}
                     68: In[1]:= Install["math2ox"]
                     69: In[2]:= OxStart["../lib/sm1/bin/ox_sm1_forAsir"]
                     70: In[3]:= OxExecute[" [(x^3-y^2) (x,y)] deRham "]
                     71: In[4]:= OxPopString[]
1.7     ! takayama   72: Out[4]=  [ 1 , 1 , 0 ]  (* The dimension of
        !            73:                            cohomology groups *)
1.5       takayama   74: \end{verbatim}
                     75: }
1.4       ohara      76:
                     77: \subsubsection{Functions}
                     78:
1.7     ! takayama   79: The {\tt math2ox} adds the following functions to Mathematica.
1.4       ohara      80: \begin{quote}
                     81: {\tt OxStart[s\_String]} \\
                     82: {\tt OxStartInsecure[s\_String]} \\
                     83: {\tt OxExecuteString[s\_String]}  \\
                     84: {\tt OxParse[s\_String]} \\
                     85: {\tt OxGet[]} \\
                     86: {\tt OxPopCMO[]} \\
                     87: {\tt OxPopString[]} \\
                     88: {\tt OxClose[]} \\
                     89: {\tt OxReset[]}
                     90: \end{quote}
1.7     ! takayama   91: Although the list of functions speaks itself,
        !            92: we add some explanations.
        !            93: The function {\tt OxPopCMO[]} executes the same operation
        !            94: as {\tt ox\_pop\_cmo()} in Risa/Asir;
        !            95: it pops data from the server stack.
1.5       takayama   96: The {\tt OxGet[]} receives an OX data message
                     97: and returns its translation to an local object.
1.7     ! takayama   98: By using the {\tt OxParse[]} function, one can send OX messages,
        !            99: written by the OX expression, to a server.
        !           100: OX expressions are Lisp-like expressions for OX messages and are defined
        !           101: in~\cite{noro-takayama}.

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