[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_launch
, ox_launch_nox
, ox_shutdown
:: Initialize OpenXM servers.
:: Terminates OpenXM servers.
integer
string or 0
string
integer
ox_launch()
invokes a process to execute command
on a host host and enables Asir to communicate with that
process.
If the number of arguments is 3, ‘ox_launch’ in dir
is invoked on host. Then ‘ox_launch’ invokes command.
If host is equal to 0, all the commands are invoked
on the same machine as the Asir is running.
If no arguments are specified, host, dir and command
are regarded as 0, the value of get_rootdir()
and ‘ox_asir’ in
the same directory respectively.
get_rootdir()
.
ox_launch()
invokes ‘xterm’ to display
standard outputs from command.
If X11
is not available or one wants to invoke servers without
‘xterm’, use ox_launch_nox()
, where the outputs of
command are redirected to ‘/dev/null’.
If the environment variable DISPLAY
is not set,
ox_launch()
and ox_launch_nox()
behave identically.
A
be the host on which Asir is running, and
B
the host on which the peer process will run.
A
to the ‘~/.rhosts’ of
the host B
.
That is, you should be allowed to access the host B
from A
without supplying a password.
X
is also used,
let Xserver
authorize the relevant hosts.
Adding the hosts can be done by command xhost
.
ASIR_RSH
is set,
the content of this variable is used as a promgram to invoke
remote servers instead of rsh. For example,
% setenv ASIR_RSH "ssh -f -X -A "
implies that remote servers are invoked by ‘ssh’ and that X11 forwarding is enabled. See the manual of ‘ssh’ for the detail.
limit stacksize 16m
for an example.
X
,
it uses the string specified for display;
if the specification is omitted, it uses the value set for the
environment variable DISPLAY
.
ox_shutdown()
terminates OpenXM servers whose identifier
is id.
ps
command on the remote hosts to see if such processed
are alive.
/* iconify on start */ ox_xterm*iconic:on /* activate the scroll bar */ ox_xterm*scrollBar:on /* 1000 lines can be shown by the scrollbar */ ox_xterm*saveLines:1000
[219] ox_launch(); 0 [220] ox_rpc(0,"fctr",x^10-y^10); 0 [221] ox_pop_local(0); [[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1], [x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]] [222] ox_shutdown(0); 0
ox_rpc
, ox_cmo_rpc
, ox_execute_string
,
ox_pop_cmo
, ox_pop_local
,
ifplot
, conplot
, plot
, polarplot
, plotover
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_launch_generic
:: Initialize OpenXM servers.
integer
string or 0
string
integer
ox_launch_generic()
invokes a control process launch
and a server process server on host. The other arguments
are switches for protocol family selection, on/off of the X environment,
method of process invocation and selection of connection type.
DISPLAY
variable.
If DISPLAY
is not set, it is invoked without X.
Note that the processes will hang up if DISPLAY
is incorrectly set.
bind
and listen
, and the invoked processes execute
connect
.
If conn_to_serv is equal to 0, Asir (client)
the invoked processes execute bind
and listen
, and
the client executes connect
.
[342] LIB=get_rootdir(); /export/home/noro/ca/Kobe/build/OpenXM/lib/asir [343] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",0,0,0,0); 1 [344] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,0,0,0); 2 [345] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,0); 3 [346] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,0); 4 [347] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,1); 5 [348] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,1); 6
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
generate_port
, try_bind_listen
, try_connect
, try_accept
, register_server
:: Generates a port number.
:: Binds and listens on a port.
:: Connects to a port.
:: Accepts a connection request.
:: Registers the sockets for which connections are established.
integer or string for generate_port()
, integer for the others
0 or 1
string
integer or string
integer
generate_port()
generates a port name for communication.
If the argument is not specified or equal to 0, a port number
for Internet domain socket is generated randomly. Otherwise
a file name for UNIX domain (host-internal protocol) is generated.
Note that it is not assured that the generated port is not in use.
try_bind_listen()
creates a socket according to the protocol
family indicated by the given port and executes bind
and listen
.
It returns a socket identifier if it is successful. -1 indicates an error.
try_connect()
tries to connect to a port port on
a host host.
It returns a socket identifier if it is successful. -1 indicates an error.
try_accept()
accepts a connection request to a socket socket.
It returns a new socket identifier if it is successful. -1 indicates an error.
In any case socket is automatically closed.
port is specified to distinguish the protocol family of socket.
register_server()
registers a pair of a control socket and a server
socket. A process identifier indicating the pair is returned.
The process identifier is used as an argument
of ox
functions such as ox_push_cmo()
.
shell()
, or manually.
[340] CPort=generate_port(); 39896 [341] SPort=generate_port(); 37222 [342] CSocket=try_bind_listen(CPort); 3 [343] SSocket=try_bind_listen(SPort); 5 /* ox_launch is invoked here : % ox_launch "127.1" 0 39716 37043 ox_asir "shio:0" */ [344] CSocket=try_accept(CSocket,CPort); 6 [345] SSocket=try_accept(SSocket,SPort); 3 [346] register_server(CSocket,CPort,SSocket,SPort); 0
ox_launch
, ox_launch_nox
, ox_shutdown
,
ox_launch_generic
, shell
, ox_push_cmo
, ox_push_local
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
‘ox_asir’ provides almost all the functionalities of Asir as
an OpenXM server.
‘ox_asir’ is invoked by ox_launch
or ox_launch_nox
.
If X environment is not available or is not necessary, one can use
ox_launch_nox
.
[5] ox_launch(); 0
[5] ox_launch_nox("127.0.0.1","/usr/local/lib/asir", "/usr/local/lib/asir/ox_asir"); 0
[7] RemoteLibDir = "/usr/local/lib/asir/"$ [8] Machines = ["sumire","rokkaku","genkotsu","shinpuku"]; [sumire,rokkaku,genkotsu,shinpuku] [9] Servers = map(ox_launch,Machines,RemoteLibDir, RemoteLibDir+"ox_asir"); [0,1,2,3]
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_rpc
, ox_cmo_rpc
, ox_execute_string
"func"
,arg0,...)"func"
,arg0,...)"command"
,...):: Calls a function on an OpenXM server
0
integer (process identifier)
function name
string
arbitrary (arguments)
ox_rpc()
can be used when the server is ‘ox_asir’.
Otherwise ox_cmo_rpc()
should be used.
ox_pop_local()
or ox_pop_cmo()
.
ox_execute_string
requests the server to parse and execute
command by the parser and the evaluater of the server.
The result is pushed to the stack.
[234] ox_cmo_rpc(0,"dp_ht",dp_ptod((x+y)^10,[x,y])); 0 [235] ox_pop_cmo(0); (1)*<<10,0>> [236] ox_execute_string(0,"12345 % 678;"); 0 [237] ox_pop_cmo(0); 141
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_reset
,ox_intr
,register_handler
:: Resets an OpenXM server
:: Sends SIGINT
to an OpenXM server
:: Registers a function callable on a keyboard interrupt.
1
integer(process identifier)
functor or 0
ox_reset()
resets a process whose identifier is number.
After its execution the process is ready for receiving data.
ox_reset()
, sending/receiving buffers and
stream buffers are assured to be empty.
ox_reset()
may be used prior to a distributed computation.
It can be also used to interrupt a distributed computation.
ox_intr()
sends SIGINT
to a process whose identifier is
number. The action of a server against SIGINT
is not
specified in OpenXM. ‘ox_asir’ immediately enters the debug
mode and pops up an window to input debug commands on X window system.
register_handler()
registers a function func().
If u is specified on a keyboard interrupt, func()
is executed before returning the toplevel.
If ox_reset()
calls are included in func(),
one can automatically reset OpenXM servers on a keyboard interrupt.
[10] ox_launch(); 0 [11] ox_rpc(0,"fctr",x^100-y^100); 0 [12] ox_reset(0); /* usr1 : return to toplevel by SIGUSR1 */ 1 /* is displayed on the xterm. */
[340] Procs=[ox_launch(),ox_launch()]; [0,1] [341] def reset() { extern Procs; map(ox_reset,Procs);} [342] map(ox_rpc,Procs,"fctr",x^100-y^100); [0,0] [343] register_handler(reset); 1 [344] interrupt ?(q/t/c/d/u/w/?) u Abort this computation? (y or n) y Calling the registered exception handler...done. return to toplevel
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_push_cmo
, ox_push_local
:: Sends obj to a process whose identifier is number.
0
integer(process identifier)
object
ox_push_cmo
is used to send data to an Open_XM other
than ‘ox_asir’ and ‘ox_plot’.
ox_push_local
is used to send data to ‘ox_asir’ and ‘ox_plot’.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_pop_cmo
, ox_pop_local
:: Receives data from a process whose identifier is number.
received data
integer(process identifier)
ox_pop_cmo
can be used to receive data form an OpenXM server
other than ‘ox_asir’ and ‘ox_plot’.
ox_pop_local
can be used to receive data from
‘ox_asir’, ‘ox_plot’.
SM_popCMO
(262) or
SM_popSerializedLocalObject
(258).
Then check the process status by ox_select
.
Finally call ox_get
for a ready process.
[341] ox_cmo_rpc(0,"fctr",x^2-1); 0 [342] ox_pop_cmo(0); [[1,1],[x-1,1],[x+1,1]] [343] ox_cmo_rpc(0,"newvect",3); 0 [344] ox_pop_cmo(0); error([41,cannot convert to CMO object]) [345] ox_pop_local(0); [ 0 0 0 ]
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_push_cmd
, ox_sync
:: Sends a command command to a process whose identifier is number.
:: Sends OX_SYNC_BALL to a process whose identifier is number.
0
integer(process identifier)
integer(command identifier)
ox_reset
.
Usually OX_SYNC_BALL will be ignored by the peer.
[3] ox_rpc(0,"fctr",x^100-y^100); 0 [4] ox_push_cmd(0,258); 0 [5] ox_select([0]); [0] [6] ox_get(0); [[1,1],[x^2+y^2,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],...]
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_get
:: Receives data form a process whose identifier is number.
integer(process identifier)
ox_push_cmd
.
ox_pop_cmo
and ox_pop_local
is realized as combinations of ox_push_cmd
and ox_get
.
[11] ox_push_cmo(0,123); 0 [12] ox_push_cmd(0,262); /* 262=OX_popCMO */ 0 [13] ox_get(0); 123
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_pops
:: Removes data form the stack of a process whose identifier is number.
0
integer(process identifier)
non-negative integer
[69] for(I=1;I<=10;I++)ox_push_cmo(0,I); [70] ox_pops(0,4); 0 [71] ox_pop_cmo(0); 6
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_select
:: Returns the list of process identifiers on which data is available.
list
list of integers (process identifier)
number
SM_popCMO
or SM_popSerializedLocalObject
with
ox_push_cmd()
in advance and by examining the process status with
ox_select()
, one can avoid a hanging up caused by ox_pop_local()
or ox_pop_cmo()
. In such a case, data can be received by
ox_get()
.
ox_launch(); 0 [220] ox_launch(); 1 [221] ox_launch(); 2 [222] ox_rpc(2,"fctr",x^500-y^500); 0 [223] ox_rpc(1,"fctr",x^100-y^100); 0 [224] ox_rpc(0,"fctr",x^10-y^10); 0 [225] P=[0,1,2]; [0,1,2] [226] map(ox_push_cmd,P,258); [0,0,0] [227] ox_select(P); [0] [228] ox_get(0); [[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1], [x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_flush
:: Flushes the sending buffer.
1
process identifier
"ox_batch"
switch of "ctrl"
.
ctrl("ox_batch",1)
may decrease the overhead of flush operations.
Of course, one has to call ox_flush(id)
at the end of
the sending operations.
ox_pop_cmo
and ox_pop_local
enter a waiting mode immediately after sending a command.
These functions always flush the sending buffer.
[340] ox_launch_nox(); 0 [341] cputime(1); 0 7e-05sec + gc : 4.8e-05sec(0.000119sec) [342] for(I=0;I<10000;I++)ox_push_cmo(0,I); 0.232sec + gc : 0.006821sec(0.6878sec) [343] ctrl("ox_batch",1); 1 4.5e-05sec(3.302e-05sec) [344] for(I=0;I<10000;I++)ox_push_cmo(0,I); ox_flush(0); 0.08063sec + gc : 0.06388sec(0.4408sec) [345] 1 9.6e-05sec(0.01317sec)
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ox_get_serverinfo
:: Gets server’s mathcap and proess id.
list
process identifier
[343] ox_get_serverinfo(0); [[199909080,Ox_system=ox_sm1.plain,Version=2.991118,HOSTTYPE=FreeBSD], [262,263,264,265,266,268,269,272,273,275,276], [[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27, 33,40,16,34]]] [344] ox_get_serverinfo(); [[0,[[199909080,Ox_system=ox_sm1.plain,Version=2.991118, HOSTTYPE=FreeBSD], [262,263,264,265,266,268,269,272,273,275,276], [[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27,33, 40,16,34]]]], [1,[[199901160,ox_asir], [276,275,258,262,263,266,267,268,274,269,272,265,264,273,300,270,271], [[514,2144202544], [1,2,3,4,5,2130706433,2130706434,17,19,20,21,22,24,25,26,31,27,33,60], [0,1]]]]]
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ifplot
, conplot
, plot
, polarplot
, plotover
:: Displays real zeros of a bi-variate function.
:: Displays real contour lines of a bi-variate function.
:: Displays the graph of a univariate function.
:: Displays the graph of a curve given in polar form.
Plots on the existing window real zeros of a bivariate function.
integer
polynomial
list
integer
string
ifplot()
draws a graph of real zeros of a bi-variate
function.
Function conplot()
plots the contour lines for a same argument.
Function plot()
draws the graph of a uninivariate function.
Function polarplot()
draws the graph of a curve given in polar form
r=f(theta).
ox_launch()
ox_launch_nox()
.
If the identifier of an active ‘ox_plot’ is specified as id,
the server is used for drawing pictures.
If id is not specified, an available ‘ox_plot’ server
is used if it exists. If no ‘ox_plot’ server is available,
then ox_launch_nox()
is automatically executed to
invoke ‘ox_plot’.
Window size is specified by [x,y] in unit ‘dot.’
[300
,300
] for UNIX version;
Value ranges of the variables are specified by [v,vmin,vmax].
([v,-2
,2
] for each variable.)
If this specification is omitted, the indeterminate having the higher
order in func is taken for ‘x’ and the one with lower order
is taken for ‘y’. To change this selection, specify explicitly
by xrange and/or yrange.
For an uni-variate function, the specification is mandatory.
This specification applies only to conplot()
. The format is
[v,vmin,vmax [
,step ]
].
If step is specified, the height difference of contours is set to
(vmax-vmin)/step.
([z,-2
,2
,16
].)
This specifies the number of the remote process by which you wish to draw a graph. (The number for the newest active process.)
The name of the window.
(Plot
.)
The created window is titled name:n/m which means the m-th
window of the process with process number n.
These numbers are used for plotover()
.
plotover()
superposes reals zeros of its argument
bi-variate function onto the specified window.
This facility is effective when precise
button switch is
inactive. If precise
is selected and active, the area specified
by the cursor dragging will be rewritten on the same window. This
will be explained later.
conplot()
,
and drag the cursor with the middle mutton. Then you will find the contour lines changing
their colors depending on the movement of the cursor and the
corresponding height level displayed on the upper right corner of
the window.
quit
Destroys (kills) the window. While computing, quit the current
computation.
If one wants to interrupt the computation, use ox_reset()
.
wide (toggle)
Will display, on the same window, a new area enlarged by 10 times as large as the current area for both width-direction and height-direction. The current area will be indicated by a rectangle placed at the center. Area specification by dragging the cursor will create a new window with a plot of the graph in the specified area.
precise (toggle)
When selected and active,
ox_plot
redraws the specified area more precisely by integer
arithmetic.
This mode uses bisection method based on Sturm sequence computation to
locate real zeros precisely. More precise plotting can be expected
by this technique than by the default plotting technique, at the expense
of significant increase of computing time. As you see by above
explanation, this function is only effective to polynomials with
rational coefficients.
(Check how they differ for (x^2+y^2-1)^2.)
formula
Displays the expression for the graph.
noaxis (toggle)
Erase the coordinates.
limit stacksize 16m
for an example.
X
, e.g.,
coloring, shape of buttons etc.
The default setting of resources is shown below.
For plot*form*shapeStyle
you can select among
rectangle, oval, ellipse, and roundedRectangle.
plot*background:white plot*form*shapeStyle:rectangle plot*form*background:white plot*form*quit*background:white plot*form*wide*background:white plot*form*precise*background:white plot*form*formula*background:white plot*form*noaxis*background:white plot*form*xcoord*background:white plot*form*ycoord*background:white plot*form*level*background:white plot*form*xdone*background:white plot*form*ydone*background:white
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
open_canvas
, clear_canvas
, draw_obj
, draw_string
:: Opens a canvas, which is a window for drawing objects.
:: Clears a canvas.
:: Draws a point or a line segment on a canvas.
:: Draws a character string on a canvas.
0
integer
list
character string
open_canvas
opens a canvas, which is a window for drawing objecgts.
One can specifies the size of a canvas in pixel by
supplying geometry option [x,y]. The default size is
[300
,300
].
This function pushes an integer value onto the stack of the OpenXM server.
The value is used to distinguish the opened canvas and one has to pop
and maintain the value by ox_pop_cmo
for subsequent calls of
draw_obj
.
clear_canvas
clears a canvas specified by a server id id
and a canvas id index.
draw_obj
draws a point or a line segment on
a canvas specified by a server id id and a canvas id index.
If pointorsegment is [x,y], it is regarded as a point.
If pointorsegment is [x,y,u,v], it is regarded
as a line segment which connects [x,y] and [u,v].
If color is specified, color/65536 mod 256,
color/256 mod 256, color mod 256 are regarded as the values
of Red, Green, Blue (Max. 255) respectively.
draw_string
draws a character string string on
a canvas specified by a server id id and a canvas id index.
The position of the string is specified by [x,y].
[182] Id=ox_launch_nox(0,"ox_plot"); 0 [183] open_canvas(Id); 0 [184] Ind=ox_pop_cmo(Id); 0 [185] draw_obj(Id,Ind,[100,100]); 0 [186] draw_obj(Id,Ind,[200,200],0xffff); 0 [187] draw_obj(Id,Ind,[10,10,50,50],0xff00ff); 0 [187] draw_string(Id,Ind,[100,50],"hello",0xffff00); 0 [189] clear_canvas(Id,Ind); 0
ox_launch
, ox_launch_nox
, ox_shutdown
, ox_reset
,ox_intr
,register_handler
, ox_pop_cmo
, ox_pop_local
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] |
This document was generated on November 5, 2024 using texi2html 5.0.