version 1.6, 2000/03/14 14:59:39 |
version 1.7, 2000/03/15 08:22:20 |
|
|
%% $OpenXM: OpenXM/src/ox_math/documents/math2ox.texi,v 1.5 2000/03/14 14:25:27 ohara Exp $ |
%% $OpenXM: OpenXM/src/ox_math/documents/math2ox.texi,v 1.6 2000/03/14 14:59:39 ohara Exp $ |
|
|
\input texinfo |
\input texinfo |
@iftex |
@iftex |
Line 52 to call OpenXM servers. |
|
Line 52 to call OpenXM servers. |
|
The @code{math2ox} communicates with OpenXM servers by the OpenXM protocol |
The @code{math2ox} communicates with OpenXM servers by the OpenXM protocol |
and communicates with Mathematica by MathLink. |
and communicates with Mathematica by MathLink. |
|
|
|
In order to execute @code{math2ox}, you need to type as follows: |
@example |
@example |
In[1]:= Install["math2ox"] |
In[1]:= Install["math2ox"] |
@end example |
@end example |
|
|
We recommend loading a mathematica program @code{oxclient.m} instead of |
We recommend loading a Mathematica program @code{oxclient.m} instead of |
calling @code{Install[]} directly: |
calling @code{Install[]} directly: |
@example |
@example |
In[1] := <<oxclient.m |
In[1] := <<oxclient.m |
Line 110 that is, you need to be using @code{ssh-agent} before |
|
Line 111 that is, you need to be using @code{ssh-agent} before |
|
@code{OxStartRemoteSSH[]}. |
@code{OxStartRemoteSSH[]}. |
Then there will be no check of password. |
Then there will be no check of password. |
|
|
|
@node Starting the X Window System with ssh-agent,,, Starting OX servers on a remote machine |
|
@subsection Starting the X Window System with ssh-agent |
|
|
|
If you use the @code{startx} command to boot the X Window System, then |
|
we recommend you replace the command by @code{ssh-agent startx}. |
|
@example |
|
bash$ ssh-agent startx |
|
@end example |
|
If you use @code{xdm} program to login your machine, |
|
then your @code{.xsession} script needs to contain the followings: |
|
@example |
|
exec ssh-agent .xinitrc |
|
@end example |
|
@noindent |
|
where @code{.xinitrc} is executable. |
|
|
|
After booting the X Window System, you need to type on suitable terminal |
|
emulator as follows: |
|
@example |
|
bash$ ssh-add |
|
@end example |
|
@noindent |
|
and input your passphrase. |
|
|
|
See ssh(1), ssh-agent(1), ssh-add(1), and ssh-keygen(1) for detail. |
|
|
@c Description of OxStartRemoteSSH |
@c Description of OxStartRemoteSSH |
@menu |
@menu |
* OxStartRemoteSSH:: |
* OxStartRemoteSSH:: |
Line 351 In[5] := cmo = OxGet[pid] |
|
Line 378 In[5] := cmo = OxGet[pid] |
|
|
|
@enumerate |
@enumerate |
@item |
@item |
|
@code{OpenXM/lib/math/oxclient.m} is a Mathematica program |
|
to load the @code{math2ox} and to define some Mathematica |
|
functions for @code{primadec.m} and @code{beta.m}. |
|
|
|
@item |
@code{OpenXM/lib/math/primadec.m} is a Mathematica program |
@code{OpenXM/lib/math/primadec.m} is a Mathematica program |
to make primary ideal decompositions by calling |
to make primary ideal decompositions by calling |
@code{ox_asir}. |
@code{ox_asir}. |
Line 366 to get beta-nbc bases by calling @code{ox_asir}. |
|
Line 398 to get beta-nbc bases by calling @code{ox_asir}. |
|
|
|
The @code{math2ox} has the following commands: |
The @code{math2ox} has the following commands: |
|
|
@code{OxStart[s_String], |
@code{OxStart[], |
OxStartInsecure[s_String, p_Integer, q_Integer], |
OxStartInsecure[], |
OxStartRemoteSSH[s_String, t_String], |
OxStartRemoteSSH[], |
OxExecuteString[s_String], OxSendMessage[s_String], OxGet[], OxPopCMO[], |
OxExecuteString[], |
OxPopString[], OxClose[], OxReset[]}. |
OxSendMessage[], |
|
OxGet[], |
|
OxPopCMO[], |
|
OxPopString[], |
|
OxClose[], |
|
OxReset[]}. |
|
|
First, let us load the math2ox. |
First, let us load the math2ox. |
@example |
@example |
Line 380 In[1]:= <<oxclient.m |
|
Line 417 In[1]:= <<oxclient.m |
|
Second, let us open a connection with an OX server. |
Second, let us open a connection with an OX server. |
For example, if we want to call the @code{ox_sm1} (the kan/sm1 server), then |
For example, if we want to call the @code{ox_sm1} (the kan/sm1 server), then |
@example |
@example |
In[2] := pid = OxStart[pid, "ox_sm1"] |
In[2] := pid = OxStart["ox_sm1"] |
@end example |
@end example |
where we have the connection of reverse mode. The OxStart function |
@noindent |
automatically invoke @code{ox_sm1} on the local machine. If you need to |
where we have the connection of reverse mode. The @code{OxStart} |
connect an OX server on a remote machine, then you can use reverse mode. |
function automatically invoke @code{ox_sm1} on the localhost. |
|
If you need to connect remote OX servers, then you can use reverse mode. |
@example |
@example |
In[2] := pid = OxStartInsecure["water.s.kanazawa-u.ac.jp", 1300, 1400] |
In[2] := pid = OxStartRemoteSSH["ox_sm1", "orange.math.kobe-u.ac.jp"] |
@end example |
@end example |
The mode is not secured but you can crypt data stream by using ssh |
|
(Secure SHell). |
|
@example |
|
In[3] := Run["ssh -f water ox -insecure -ox ox_sm1 -host water"] |
|
@end example |
|
|
|
|
@c Remarks: old version. |
|
@c @example |
|
@c In[2] := pid = OxStartInsecure["water.s.kanazawa-u.ac.jp", 1300, 1400] |
|
@c @end example |
|
@c The mode is not secured but you can crypt data stream by using ssh |
|
@c (Secure SHell). |
|
@c @example |
|
@c In[3] := Run["ssh -f water ox -insecure -ox ox_sm1 -host water"] |
|
@c @end example |
|
|
Third, let us send an OX message to the OX server. |
Third, let us send an OX message to the OX server. |
We can send an OX message written in OX/CMO expressions. |
We can send an OX message written in OX/CMO expressions. |
@example |
@example |
In[4] := OxSendMessage[pid, "(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"] |
In[4] := OxSendMessage[pid, "(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"] |
In[5] := OxSendMessage[pid, "(OX_COMMAND, (SM_popCMO))"] |
|
@end example |
@end example |
|
@noindent |
If the expression contains syntax errors, then nothing is sent. |
If the expression contains syntax errors, then nothing is sent. |
|
|
Remarks: if @code{SM_popCMO} is sent by the @code{OxSendMessage[]} function, then the |
If you need to get the object on the top of the stack of an OX server |
OX stack machine returns the top of the stack to the @code{math2ox}. |
@code{pid}, then you can call the following function: |
Then, in order to receive the message, we need to call the @code{OxGet[]} |
|
function always after executing @code{OxSendMessage[]} |
|
@example |
@example |
In[6] := OxGet[pid] |
In[5] := cmo = OxPopCMO[pid] |
@end example |
@end example |
|
|
If we do not use the @code{OxSendMessage} function and use the @code{OxPopCMO[]} |
The function @code{OxPopCMO} above is equivalent to |
function, then we do not need to call the @code{OxGet[]}. |
the following two command: |
@example |
@example |
In[5] := OxPopCMO[pid] |
In[5] := OxSendMessage[pid, "(OX_COMMAND, (SM_popCMO))"] |
|
In[6] := cmo = OxGet[pid] |
@end example |
@end example |
|
|
|
Remarks: |
|
if @code{SM_popCMO} is sent by the @code{OxSendMessage[]} function, then |
|
the OX stack machine returns the top of the stack to the @code{math2ox}. |
|
Then, in order to receive the message, we need to call the |
|
@code{OxGet[]} function always after executing @code{OxSendMessage[]}. |
|
That is @code{OxGet} flushes the communication route to @code{pid}. If |
|
we never use the @code{OxSendMessage} function, then we do not need to |
|
call the @code{OxGet[]}. |
|
|
Fourth, if we send a command expressed in the local language of the OX |
Fourth, if we send a command expressed in the local language of the OX |
server, then we need to call the @code{OxExecuteString[]} function. |
server, then we need to call the @code{OxExecuteString[]} function. |