Annotation of OpenXM/doc/issac2000/openxm-clients.tex, Revision 1.6
1.6 ! noro 1: % $OpenXM: OpenXM/doc/issac2000/openxm-clients.tex,v 1.5 2000/01/15 06:26:06 takayama 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.6 ! noro 59: for Mathematica. Our client communicates with Mathematica by MathLink and
! 60: with an OpenXM server by OpenXM protocols.
1.5 takayama 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.6 ! noro 77: The {\tt math2ox} has the following functions.
1.4 ohara 78: \begin{quote}
79: {\tt OxStart[s\_String]} \\
80: {\tt OxStartInsecure[s\_String]} \\
81: {\tt OxExecuteString[s\_String]} \\
82: {\tt OxParse[s\_String]} \\
83: {\tt OxGet[]} \\
84: {\tt OxPopCMO[]} \\
85: {\tt OxPopString[]} \\
86: {\tt OxClose[]} \\
87: {\tt OxReset[]}
88: \end{quote}
1.6 ! noro 89: For example, {\tt OxPopCMO[]} executes the same operation
! 90: as {\tt ox\_pop\_cmo()} in Risa/Asir.
! 91: By using the {\tt OxParse[]} function, one can send suitable OX messages,
! 92: written by the OX expression, to a server. OX expressions are
1.4 ohara 93: Lisp-like expressions for OX messages and are defined
1.5 takayama 94: in~\cite{noro-takayama}.
95: The {\tt OxGet[]} receives an OX data message
96: and returns its translation to an local object.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>