[BACK]Return to process.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc / parts

Annotation of OpenXM/src/asir-doc/parts/process.texi, Revision 1.2

1.2     ! noro        1: @comment $OpenXM$
        !             2: \BJP
1.1       noro        3: @node $BJ,;67W;;(B,,, Top
                      4: @chapter $BJ,;67W;;(B
1.2     ! noro        5: \E
        !             6: \BEG
        !             7: @node Distributed computation,,, Top
        !             8: @chapter Distributed computation
        !             9: \E
1.1       noro       10:
                     11: @menu
                     12: * OpenXM::
                     13: * Mathcap::
1.2     ! noro       14: \BJP
1.1       noro       15: * $B%9%?%C%/%^%7%s%3%^%s%I(B::
                     16: * $B%G%P%C%0(B::
                     17: * $BJ,;67W;;$K4X$9$k4X?t(B::
1.2     ! noro       18: \E
        !            19: \BEG
        !            20: * Stackmachine commands::
        !            21: * Debugging::
        !            22: * Functions for distributed computation::
        !            23: \E
1.1       noro       24: @end menu
                     25:
1.2     ! noro       26: \JP @node OpenXM,,, $BJ,;67W;;(B
        !            27: \EG @node OpenXM,,, Distributed computation
1.1       noro       28: @section OpenXM
                     29:
1.2     ! noro       30: \BJP
        !            31: @b{Asir} $B$O(B, $BJ,;67W;;$K$*$1$kDL?.%W%m%H%3%k$H$7$F(B, @b{OpenXM}
1.1       noro       32: (Open message eXchange protocol for Mathematics) $B$r:NMQ$7$F$$$k(B.
1.2     ! noro       33: @b{OpenXM} $B$O(B, $B<g$H$7$F?t3X%*%V%8%'%/%H$r%W%m%;%94V$G$d$j$H$j$9$k(B
        !            34: $B$?$a$N5,Ls$G$"$k(B. @b{OpenXM} $B$K$*$$$F$O(B
        !            35: \E
        !            36: \BEG
        !            37: In @b{Asir} distributed computations are done under @b{OpenXM}
        !            38: (Open message eXchange protocol for Mathematics), which
        !            39: is a protocol for exchanging mainly mathematical objects
        !            40: between processes.
        !            41: In @b{OpenXM} a distributed computation is done as follows:
        !            42: \E
1.1       noro       43:
                     44: @enumerate
1.2     ! noro       45: \BJP
1.1       noro       46: @item client $B$,(B server $B$KBP$7$F7W;;<B9T0MMj$N%a%C%;!<%8$rAw$k(B.
                     47: @item server $B$,7W;;$r<B9T$9$k(B.
                     48: @item client $B$,(B server $B$K7k2LAwIU0MMj$N%a%C%;!<%8$rAw$k(B.
                     49: @item server $B$O7k2L$rJV$7(B, client $B$O7k2L$r<u$1<h$k(B
1.2     ! noro       50: \E
        !            51: \BEG
        !            52: @item A client requests something to a server.
        !            53: @item The server does works according to the request.
        !            54: @item The client requests to send data to the server.
        !            55: @item The server sends the data to the client and the client gets the data.
        !            56: \E
1.1       noro       57: @end enumerate
                     58:
1.2     ! noro       59: \BJP
1.1       noro       60: $B$H$$$&7A$GJ,;67W;;$,9T$o$l$k(B. server $B$O%9%?%C%/%^%7%s$G$"$k(B. $B$9$J$o$A(B,
                     61: client $B$+$iAw$i$l$?%G!<%?%*%V%8%'%/%H$O(B, $B;XDj$,$J$$8B$j(B server $B$N%9%?%C(B
                     62: $B%/$K@Q$^$l(B, $B%3%^%s%I$,Aw$i$l$?;~$K(B, $BI,MW$J$@$1%9%?%C%/$+$i%G!<%?$r<h$j=P(B
                     63: $B$7$F(B, $B4X?t8F$S=P$7$N0z?t$H$9$k(B.
1.2     ! noro       64: \E
        !            65: \BEG
        !            66: The server is a stack machine. That is data objects sent by the client
        !            67: are pushed to the stack of the server.
        !            68: If the server gets a command, then the data are
        !            69: popped form the stack and they are used as arguments of a function call.
        !            70: \E
1.1       noro       71:
1.2     ! noro       72: \BJP
        !            73: @b{OpenXM} $B$K$*$$$FFCD'E*$J$3$H$O(B, $B7W;;7k2L$OC1$K(B server $B$N%9%?%C%/$K(B
1.1       noro       74: $B@Q$^$l$k$@$1$G(B, client $B$+$i$N0MMj$,$J$$8B$j(B, $BDL?.O)$K%G!<%?$ON.$l$J$$(B
                     75: $B$H$$$&E@$G$"$k(B.
1.2     ! noro       76: \E
1.1       noro       77:
1.2     ! noro       78: \BEG
        !            79: In @b{OpenXM}, the result of a computation done in the server
        !            80: is simply pushed to the stack and the data is not written to
        !            81: the communication stream without requests from the client.
        !            82: \E
        !            83:
        !            84: \BJP
1.1       noro       85: $B%W%m%H%3%k$K$O(B, $B%*%V%8%'%/%H$N6&DL%U%)!<%^%C%H$r5,Dj(B
                     86: $B$9$k(B @b{CMO} (Common Mathematical Object format), $B%W%m%;%9$KBP$9$k(B
                     87: $BF0:n$r;XDj$9$k(B @b{SM} (Stack Machine command) $B$,4^$^$l$k(B.
1.2     ! noro       88: $B$3$l$i$O(B, $B%G!<%?$rAw$k:]$K(B, $B%G!<%?$N<oN`$r;XDj$9$k(B
1.1       noro       89: $B$?$a$N(B @b{OX} expression $B$H$7$F%i%C%T%s%0$5$l$k(B.
                     90:
1.2     ! noro       91: @b{OpenXM} $B$K$h$kJ,;67W;;$r9T$&>l9g$K$O(B,
1.1       noro       92: $B$^$:(B, server $B$rN)$A>e$2$F(B, $BDL?.$r@.N)$5$;$kI,MW$,$"$k(B. $B$3$N$?$a$K(B,
                     93: @code{ox_launch()}, @code{ox_launch_nox()}, @code{ox_launch_generic()}
                     94: $B$J$I$N4X?t$,MQ0U$5$l$F$$$k(B. $B$5$i$K(B, $BDL?.$N@.N)$7$?(B server $B$KBP$7$F(B
                     95: $B0J2<$N$h$&$JA`:n$,4X?t$H$7$FMQ0U$5$l$F$$$k(B.
1.2     ! noro       96: \E
        !            97:
        !            98: \BEG
        !            99: @b{OpenXM} protocol consists of two components:
        !           100: @b{CMO} (Common Mathematical Object format) which determines
        !           101: a common format of data representations and
        !           102: @b{SM} (StackMachine command) which specifies actions on servers.
        !           103: These are wrapped as @b{OX} expressions to indicate the sort of
        !           104: data when they are sent.
        !           105:
        !           106: To execute a distributed computation by @b{OpenXM},
        !           107: one has to invoke @b{OpenXM} servers and to establish communications
        !           108: between the client and the servers.
        !           109: @code{ox_launch()}, @code{ox_launch_nox()}, @code{ox_launch_generic()}
        !           110: are preprared for such purposes. Furthermore the following functions
        !           111: are available.
        !           112: \E
1.1       noro      113:
                    114: @table @code
                    115: @item @code{ox_push_cmo()}
                    116:
1.2     ! noro      117: \JP $B%G!<%?$r(B server $B$N%9%?%C%/$K@Q$`(B
        !           118: \EG It requests a server to push an object to the stack of the server.
1.1       noro      119:
                    120: @item @code{ox_pop_cmo()}
1.2     ! noro      121: \JP $B%G!<%?$r(B server $B$N%9%?%C%/$+$i<h$j=P$9(B.
        !           122: \EG It request a server to pop an object from the stack of the server.
1.1       noro      123:
                    124: @item @code{ox_cmo_rpc()}
                    125:
1.2     ! noro      126: \JP server $B$N4X?t$r8F$S=P$7(B, $B7k2L$r%9%?%C%/$K@Q$`(B.
        !           127: \BEG
        !           128: It requests to execute a function on a server.
        !           129: The result is pushed to the stack of the server.
        !           130: \E
1.1       noro      131:
                    132: @item @code{ox_execute_string()}
                    133:
1.2     ! noro      134: \BJP
1.1       noro      135: server $B8GM-$N%f!<%68@8l(B (@b{Asir} $B$J$i(B Asir $B8@8l(B) $B$G=q$+$l$?J8;zNs$r(B
                    136: server $B$,<B9T$7(B, $B7k2L$r%9%?%C%/$K@Q$`(B.
1.2     ! noro      137: \E
        !           138: \BEG
        !           139: It requests a server to parse and execute a string
        !           140: by the parser and the evaluater of the server.
        !           141: The result is pushed to the stack of the server.
        !           142: \E
1.1       noro      143:
                    144: @item @code{ox_push_cmd()}
                    145:
1.2     ! noro      146: \JP @b{SM} $B%3%^%s%I$NAw?.(B.
        !           147: \EG It requests a server to execute a command.
1.1       noro      148:
                    149: @item @code{ox_get()}
                    150:
1.2     ! noro      151: \JP $B4{$KDL?.O)$K$"$k%G!<%?$N<h$j=P$7(B.
        !           152: \EG It gets an object from a data stream.
1.1       noro      153: @end table
                    154:
1.2     ! noro      155: \JP @node Mathcap,,, $BJ,;67W;;(B
        !           156: \EG @node Mathcap,,, Distributed computation
1.1       noro      157: @section Mathcap
                    158:
1.2     ! noro      159: \BJP
        !           160: server, client $B$H$b$K(B, @b{OpenXM} $B$G5,Dj$5$l$F$$$kA4$F$N(B@b{CMO} $B%U%)!<(B
1.1       noro      161: $B%^%C%H(B, @b{SM} $B%3%^%s%I$r<BAu$7$F$$$k$H$O8B$i$J$$(B. $BAj<j$NCN$i$J$$%G!<%?(B,
1.2     ! noro      162: $B%3%^%s%I$rAw$C$?>l9g(B, $B8=>u$G$O7k2L$OM=A[$G$-$J$$(B. $B$3$N$?$a(B, @b{OpenXM}
1.1       noro      163: $B$G$O(B, $B$"$i$+$8$a8_$$$N%5%]!<%H$9$k(B @b{CMO}, @b{SM} $B$N%j%9%H$r8r49$7$"$C$F(B,
                    164: $BAj<j$NCN$i$J$$%G!<%?$rAw$i$J$$$h$&$K$9$k;EAH$_$rDs>'$7$F$$$k(B. $B$3$N$?$a$N(B
                    165: $B%G!<%?$,(B Mathcap $B$G$"$k(B. Mathcap $B$O(B @b{CMO} $B$H$7$F$O%j%9%H$G$"$j(B, $B$=$N(B
                    166: $BMWAG$O(B 32 bit $B@0?t$^$?$OJ8;zNs$G$"$k(B. $B8=:_$N5,Dj$G$O(B, Mathcap $B$O(B
                    167: $BD9$5$,(B 3 $B$N%j%9%H$G(B,
                    168:
1.2     ! noro      169: [[version $BHV9f(B, server $BL>(B],@b{SM}taglist,[[@b{OX}tag,@b{CMO}taglist],
        !           170: [@b{OX}tag,@b{CMO}taglist],...]]
1.1       noro      171:
1.2     ! noro      172: $B$H$$$&7A$r$7$F$$$k(B. [@b{OX}tag,@b{CMO}taglist] $B$O(B,
1.1       noro      173: @b{OX}tag $B$G<($5$l$k%+%F%4%j$N%G!<%?$KBP$7$F(B, $B$I$N$h$&$J(B @b{CMO} $B$,;HMQ2D(B
                    174: $BG=$+$r<($9$b$N$G$"$k(B. $B$3$N;XDj$rJ#?t5v$9$3$H$K$h$j(B, $BNc$($P(B
                    175: @samp{ox_asir} $B$N$h$&$K(B, @b{CMO} $B%G!<%?0J30$K(B, @b{Asir} $B8GM-$N%G!<%?7A<0(B
                    176: $B$K$h$j(B, @b{CMO}$B$h$jB?$/$N<oN`$N%G!<%?Aw<u?.$r9T$($k$3$H$r<($;$k(B.
                    177:
                    178: $B%G!<%?Aw?.$N:]$K(B, $BAj<j%W%m%;%9$N(B Mathcap $B$,4{$KEPO?$5$l$F$$$k>l9g(B,
                    179: Mathcap $B$K$h$k%A%'%C%/$r9T$&$+H]$+$O(B,
                    180: @code{ctrl} $B%3%^%s%I$N(B @code{"ox_check"} $B%9%$%C%A$K$h$j7h$^$k(B.
                    181: $B$3$N%9%$%C%A$N=i4|CM$O(B 1 $B$G(B, $B%A%'%C%/$r9T$&$3$H$r0UL#$9$k(B.
                    182: @code{ctrl("ox_check",0)} $B$K$h$j%A%'%C%/$r9T$o$J$$$h$&$K$G$-$k(B.
1.2     ! noro      183: \E
        !           184: \BEG
        !           185: A server or a client does not necessarily implement full specifications
        !           186: of @b{OpenXM}. If a program sends data unknown to its peer, an unrecoverable
        !           187: error may occur. To avoid such a case @b{OpenXM} provides a scheme not
        !           188: to send data unknown to peers. It is realized by exchanging the list of
        !           189: supported @b{CMO} and @b{SM}. The list is called mathcap.
        !           190: Mathcap is also defined as a @b{CMO} and the elements are 32bit integers
        !           191: or strings.
        !           192: The format of mathcap is as follows.
        !           193:
        !           194: [[version number, server name],@b{SM}taglist,[@b{OX}taglist,@b{CMO}taglist, @b{CMO}taglist,...]]
        !           195: [[version number, server name],@b{SM}taglist,[[@b{OX}tag,@b{CMO}taglist],
        !           196: [@b{OX}tag,@b{CMO}taglist],...]]
        !           197:
        !           198: [@b{OX}tag,@b{CMO}taglist] indicates that available object tags for
        !           199: a category of data specified by @b{OX}tag.
        !           200: For example @samp{ox_asir} accepts the local object format used by @b{Asir}
        !           201: and the mathcap from @samp{ox_asir} reflects the fact.
        !           202:
        !           203: If @code{"ox_check"} switch of @code{ctrl} is set to 1,
        !           204: the check by a mathcap is done before data is sent.
        !           205: If @code{"ox_check"} switch of @code{ctrl} is set to 0,
        !           206: the check is not done.
        !           207: By default it is set to 1.
        !           208: \E
1.1       noro      209:
1.2     ! noro      210: \BJP
1.1       noro      211: @node $B%9%?%C%/%^%7%s%3%^%s%I(B,,, $BJ,;67W;;(B
                    212: @section $B%9%?%C%/%^%7%s%3%^%s%I(B
1.2     ! noro      213: \E
        !           214: \BEG
        !           215: @node Stackmachine commands,,, Distributed computation
        !           216: @section Stackmachine commands
        !           217: \E
1.1       noro      218:
1.2     ! noro      219: \BJP
1.1       noro      220: $B%9%?%C%/%^%7%s%3%^%s%I$O(B, $B%9%?%C%/%^%7%s$G$"$k(B server $B$K2?$i$+$NA`:n$r9T(B
                    221: $B$o$;$k$?$a$KMQ0U$5$l$F$$$k(B. $B$$$/$D$+$N%3%^%s%I$O(B, $B$h$/MQ$$$i$l$k7A$G(B, $BB>(B
1.2     ! noro      222: $B$N%3%^%s%I(B, $B%G!<%?$H$H$b$K(B, @b{Asir} $B$NAH$_9~$_4X?t$K$h$jAw$i$l$k$,(B, $B%f!<(B
1.1       noro      223: $B%6$,L@<(E*$K$"$k%3%^%s%I$rAw$kI,MW$,$7$P$7$P@8$:$k(B. $B%9%?%C%/%^%7%s%3%^%s(B
                    224: $B%I$O(B 32 bit $B0J2<$N@0?t$G$"$j(B, @code{ox_push_cmd()} $B%3%^%s%I$GAw?.$G$-$k(B.
                    225: $B0J2<$G(B, $BBeI=E*$J%9%?%C%/%^%7%s%3%^%s%I$K$D$$$F2r@b$9$k(B. @b{SM_xxx=yyy}
                    226: $B$G(B, @b{SM_xxx} $B$,(B mnemonic, @b{yyy} $B$,CM$G$"$k(B.
                    227:
                    228: $B0J2<$G(B, $B%9%?%C%/$+$i%G!<%?$r<h$j=P$9$H$O(B, $B%9%?%C%/$N0lHV>e$+$i%G!<%?$r(B
                    229: $B<h$j=|$/$3$H$r8@$&(B.
1.2     ! noro      230: \E
        !           231:
        !           232: \BEG
        !           233: The stackmachine commands are provided to request a server to execute
        !           234: various operations.
        !           235: They are automatically sent by built-in functions of @b{Asir},
        !           236: but one often has to send them manually. They are represented by
        !           237: 32bit integers. One can send them by calling @code{ox_push_cmd()}.
        !           238: Typical stackmachine commands are as follows.
        !           239: @b{SM_xxx=yyy} means that @b{SM_xxx} is a mnemonic and that
        !           240: @b{yyy} is its value.
        !           241: \E
1.1       noro      242:
                    243: @table @b
                    244: @item SM_popSerializedLocalObject=258
                    245:
1.2     ! noro      246: \BJP
1.1       noro      247: server $B$,(B @samp{ox_asir} $B$N>l9g$K(B, $BI,$:$7$b(B @b{CMO} $B$GDj5A$5$l$F$$$J$$(B
1.2     ! noro      248: $B%*%V%8%'%/%H$r%9%?%C%/$+$i<h$j=P$7(B, $BDL?.O)$KN.$9(B.
        !           249: \E
        !           250: \BEG
        !           251: An object not necessarily defined as @b{CMO} is popped from the stack
        !           252: and is sent to the client. This is available only on @samp{ox_asir}.
        !           253: \E
1.1       noro      254:
                    255: @item SM_popCMO=262
                    256:
1.2     ! noro      257: \JP @b{CMO} $B%*%V%8%'%/%H$r%9%?%C%/$+$i<h$j=P$7(B, $BDL?.O)$KN.$9(B.
        !           258: \EG A @b{CMO} object is popped from the stack and is sent to the client.
1.1       noro      259:
                    260: @item SM_popString=263
                    261:
1.2     ! noro      262: \JP $B%9%?%C%/$+$i%G!<%?$r<h$j=P$7(B, $B2DFI7A<0$NJ8;zNs$KJQ49$7$FDL?.O)$KN.$9(B.
        !           263: \EG An object is popped from the stack and is sent to the client as a readable string.
1.1       noro      264:
                    265: @item SM_mathcap=264
                    266:
1.2     ! noro      267: \JP server $B$N(B mathcap $B$r%9%?%C%/$K@Q$`(B.
        !           268: \EG The server's mathcap is pushed to the stack.
1.1       noro      269:
                    270: @item SM_pops=265
                    271:
1.2     ! noro      272: \BJP
1.1       noro      273: $B%9%?%C%/$+$i<h$j=P$7$?%G!<%?$r8D?t$H$7$F(B, $B$=$N8D?tJ,%9%?%C%/$+$i(B
                    274: $B%G!<%?$r<h$j=|$/(B.
1.2     ! noro      275: \E
        !           276: \BEG
        !           277: Objects are removed from the stack. The number of object to be removed
        !           278: is specified by the object at the top of the stack.
        !           279: \E
1.1       noro      280:
                    281: @item SM_setName=266
                    282:
1.2     ! noro      283: \BJP
1.1       noro      284: $B%9%?%C%/$+$i%G!<%?$rJQ?tL>$H$7$F<h$j=P$7(B, $B<!$K<h$j=P$7$?%G!<%?$r$=$N(B
                    285: $BJQ?t$K3d$jEv$F$k(B. $B$3$N3d$jEv$F$O(B, server $B8GM-$N=hM}$H$7$F9T$o$l$k(B.
1.2     ! noro      286: \E
        !           287: \BEG
        !           288: A variable name is popped form the stack. Then an object is
        !           289: popped and it is assigned to the variable. This assignment is done
        !           290: by the local language of the server.
        !           291: \E
1.1       noro      292:
                    293: @item SM_evalName=267
                    294:
1.2     ! noro      295: \JP $B%9%?%C%/$+$i<h$j=P$7$?%G!<%?$rJQ?tL>$H$7$F(B, $B$=$NCM$r%9%?%C%/$K:\$;$k(B.
        !           296: \BEG
        !           297: A variable name is popped from the stack.
        !           298: Then the value of the variable is pushed to the stack.
        !           299: \E
1.1       noro      300:
                    301: @item SM_executeStringByLocalParser=268
                    302:
1.2     ! noro      303: \BJP
1.1       noro      304: $B%9%?%C%/$+$i<h$j=P$7$?%G!<%?$r(B, server $B8GM-$N(B parser, evaluator $B$G(B
                    305: $B=hM}$7(B, $B7k2L$r%9%?%C%/$K:\$;$k(B.
1.2     ! noro      306: \E
        !           307: \BEG
        !           308: A string popped from the stack is parsed and evaluated.
        !           309: The result is pushed to the stack.
        !           310: \E
1.1       noro      311:
                    312: @item SM_executeFunction=269
                    313:
1.2     ! noro      314: \BJP
1.1       noro      315: $B%9%?%C%/$+$i(B, $B4X?tL>(B, $B0z?t$N8D?t(B, $B8D?tJ,$N0z?t$r<h$j=P$7(B, $B4X?t$r8F$S=P$7(B
                    316: $B7k2L$r%9%?%C%/$K:\$;$k(B.
1.2     ! noro      317: \E
        !           318: \BEG
        !           319: A function name, the number of arguments and the arguments are
        !           320: popped from the stack. Then the function is executed and the result
        !           321: is pushed to the stack.
        !           322: \E
1.1       noro      323:
                    324: @item SM_beginBlock=270
1.2     ! noro      325: \JP $B%G!<%?%V%m%C%/$N$O$8$^$j(B.
        !           326: \EG It indicates the beginning of a block.
1.1       noro      327:
                    328: @item SM_endBlock=271
1.2     ! noro      329: \JP $B%G!<%?%V%m%C%/$N=*$j(B.
        !           330: \EG It indicates the end of a block.
1.1       noro      331:
                    332: @item SM_shutdown=272
                    333:
1.2     ! noro      334: \JP server $B$H$N8r?.$r@ZCG$7(B, server $B$r=*N;$5$;$k(B.
        !           335: \EG It shuts down communications and terminates servers.
1.1       noro      336:
                    337: @item SM_setMathcap=273
                    338:
1.2     ! noro      339: \JP $B%9%?%C%/$N%G!<%?$r(B client $B$N(B mathcap $B$H$7$F(B, server $B$KEPO?$rMW5a$9$k(B.
        !           340: \BEG
        !           341: It requests a server to register the data at the top of the stack
        !           342: as the client's mathcap.
        !           343: \E
1.1       noro      344:
                    345: @item SM_getsp=275
                    346:
1.2     ! noro      347: \JP $B8=:_%9%?%C%/$K@Q$^$l$F$$$k%G!<%?$N?t$r%9%?%C%/$K:\$;$k(B.
        !           348: \EG The number of objects in the current stack is pushed to the stack.
1.1       noro      349:
                    350: @item SM_dupErrors=276
                    351:
1.2     ! noro      352: \BJP
1.1       noro      353: $B8=:_%9%?%C%/$K@Q$^$l$F$$$k%*%V%8%'%/%H$NFb(B, $B%(%i!<%*%V%8%'%/%H$N$_(B
                    354: $B$r%j%9%H$K$7$F(B, $B%9%?%C%/$K:\$;$k(B.
1.2     ! noro      355: \E
        !           356: \BEG
        !           357: The list of all the error objects in the current stack is pushed to
        !           358: the stack.
        !           359: \E
1.1       noro      360:
                    361: @item SM_nop=300
                    362:
1.2     ! noro      363: \JP $B$J$K$b$7$J$$(B.
        !           364: \EG Nothing is done.
1.1       noro      365: @end table
                    366:
1.2     ! noro      367: \BJP
1.1       noro      368: @node $B%G%P%C%0(B,,, $BJ,;67W;;(B
                    369: @section $B%G%P%C%0(B
1.2     ! noro      370: \E
        !           371: \BEG
        !           372: @node Debugging,,, Distributed computation
        !           373: @section Debugging
        !           374: \E
1.1       noro      375:
1.2     ! noro      376: \BJP
1.1       noro      377: $BJ,;67W;;$K$*$$$F$O(B, $B0lHL$K%G%P%C%0$,:$Fq$H$J$k(B. @samp{ox_asir} $B$K(B
                    378: $B$*$$$F$O(B, $B%G%P%C%0$N$?$a$N$$$/$D$+$N5!G=$rDs6!$7$F$$$k(B.
1.2     ! noro      379: \E
        !           380: \BEG
        !           381: In general, it is difficult to debug distributed computations.
        !           382: @samp{ox_asir} provides several functions for debugging.
        !           383: \E
1.1       noro      384:
                    385: @menu
1.2     ! noro      386: \BJP
1.1       noro      387: * $B%(%i!<%*%V%8%'%/%H(B::
                    388: * $B%j%;%C%H(B::
                    389: * $B%G%P%C%0MQ%]%C%W%"%C%W%&%#%s%I%&(B::
1.2     ! noro      390: \E
        !           391: \BEG
        !           392: * Error object::
        !           393: * Resetting a server::
        !           394: * Pop-up command window for debugging::
        !           395: \E
1.1       noro      396: @end menu
                    397:
1.2     ! noro      398: \BJP
1.1       noro      399: @node $B%(%i!<%*%V%8%'%/%H(B,,, $B%G%P%C%0(B
                    400: @subsection $B%(%i!<%*%V%8%'%/%H(B
1.2     ! noro      401: \E
        !           402: \BEG
        !           403: @node Error object,,, Debugging
        !           404: @subsection Error object
        !           405: \E
1.1       noro      406:
1.2     ! noro      407: \BJP
        !           408: @b{OpenXM} server $B$,<B9TCf$K%(%i!<$r5/$3$7$?>l9g(B, $B7k2L$N$+$o$j$K(B
1.1       noro      409: @b{CMO} $B%(%i!<%*%V%8%'%/%H$r%9%?%C%/$K@Q$`(B. $B%(%i!<%*%V%8%'%/%H$O(B, $BBP1~$9$k(B
                    410: @b{SM} $B%3%^%s%I$N%7%j%"%kHV9f$H(B, $B%(%i!<%a%C%;!<%8$+$i$J$j(B, $B$=$l$K$h$C$F(B
                    411: $B$I$N(B @b{SM} $B%3%^%s%I$,$I$N$h$&$J%(%i!<$r5/$3$7$?$,$"$kDxEYH=L@$9$k(B.
1.2     ! noro      412: \E
        !           413: \BEG
        !           414: When an error has occurred on an @b{OpenXM} server,
        !           415: an error object is pushed to the stack instead of a result of the computation.
        !           416: The error object consists of the serial number of the @b{SM} command
        !           417: which caused the error, and an error message.
        !           418: \E
1.1       noro      419:
                    420: @example
                    421: [340] ox_launch();
                    422: 0
                    423: [341] ox_rpc(0,"fctr",1.2*x);
                    424: 0
                    425: [342] ox_pop_cmo(0);
                    426: error([8,fctrp : invalid argument])
                    427: @end example
                    428:
1.2     ! noro      429: \BJP
1.1       noro      430: @node $B%j%;%C%H(B,,, $B%G%P%C%0(B
1.2     ! noro      431: @subsection $B%j%;%C%H(B
        !           432: \E
        !           433: \BEG
        !           434: @node Resetting a server,,, Debugging
        !           435: @subsection Resetting a server
        !           436: \E
1.1       noro      437:
1.2     ! noro      438: \BJP
1.1       noro      439: @code{ox_reset()} $B$O8=:_<B9TCf$N(B server $B$r%j%;%C%H$7$F(B, $B%3%^%s%I<u$1IU$1(B
                    440: $B>uBV$KLa$9(B. $B$3$N5!G=$O(B, $BDL>o$N(B @b{Asir} $B%;%C%7%g%s$K$*$1$k%-!<%\!<%I3d$j9~$_(B
1.2     ! noro      441: $B$H$[$\F1MM$K(B, @b{OpenXM} server $B$r%j%;%C%H$G$-$k(B. $B$^$?(B, $B2?$i$+$N860x$G(B,
1.1       noro      442: $BDL?.O)$N%G!<%?$,:\$C$?$^$^$N>uBV$G(B @code{ox_rpc()} $B$J$I$r<B9T$9$k$H(B,
                    443: @code{ox_pop_cmo()} $B$J$I(B, $B%9%?%C%/$+$i$N<h$j=P$7$H(B, $B<B:]$KFI$^$l$k%G!<%?(B
                    444: $B$NBP1~$,IT@5$K$J$k(B. $B$=$N$h$&$J>l9g$K$bM-8z$G$"$k(B.
1.2     ! noro      445: \E
1.1       noro      446:
1.2     ! noro      447: \BEG
        !           448: @code{ox_reset()} resets a process whose identifier is @var{number}.
        !           449: After its execution the process is ready for receiving data.
        !           450: This function corresponds to the keyboard interrupt on an usual @b{Asir}
        !           451: session. It often happens that a request of a client does not correspond
        !           452: correctly to the result from a server. It is caused by remaining data
        !           453: on data streams. @code{ox_reset} is effective for such cases.
        !           454: \E
1.1       noro      455:
1.2     ! noro      456: \BJP
1.1       noro      457: @node $B%G%P%C%0MQ%]%C%W%"%C%W%&%#%s%I%&(B,,, $B%G%P%C%0(B
                    458: @subsection $B%G%P%C%0MQ%]%C%W%"%C%W%&%#%s%I%&(B
1.2     ! noro      459: \E
        !           460: \BEG
        !           461: @node Pop-up command window for debugging,,, Debugging
        !           462: @subsection Pop-up command window for debugging
        !           463: \E
1.1       noro      464:
1.2     ! noro      465: \BJP
1.1       noro      466: server $B$K$O(B, client $B$K$*$1$k%-!<%\!<%I$KAjEv$9$kF~NO5!G=$,$J$$$?$a(B,
                    467: server $BB&$GF0:n$7$F$$$k%f!<%68@8l%W%m%0%i%`$N%G%P%C%0$,:$Fq$K$J$k(B. $B$3$N(B
                    468: $B$?$a(B, server $BB&$G$N%f!<%68@8l%W%m%0%i%`<B9TCf$N%(%i!<$*$h$S(B, client $B$+$i(B
                    469: $B$N(B @code{ox_rpc(@var{id},"debug")} $B<B9T$K$h$j(B, server $B$K%G%P%C%0%3%^%s%I(B
                    470: $B$rF~NO$9$k$?$a$N>.$5$J%&%#%s%I%&$,%]%C%W%"%C%W$9$k(B. $B$3$N%&%#%s%I%&$+$i$N(B
                    471: $BF~NO$KBP$9$k=PNO$O(B, log $BMQ$N(B @samp{xterm} $B$KI=<($5$l$k(B. $B$3$N%&%#%s%I%&$r(B
                    472: $BJD$8$k$K$O(B, @code{quit} $B$rF~NO$9$l$P$h$$(B.
1.2     ! noro      473: \E
        !           474: \BEG
        !           475: As a server does not have any standard input device such as a keyboard,
        !           476: it is difficult to debug user programs running on the server.
        !           477: @samp{ox_asir} pops up a small command window to input debug commands
        !           478: when an error has occurred during user a program execution or
        !           479: @code{ox_rpc(@var{id},"debug")} has been executed.
        !           480: The responses to commands are shown in @samp{xterm} to display
        !           481: standard outputs from the server. To close the small window,
        !           482: input @code{quit}.
        !           483: \E
1.1       noro      484:
1.2     ! noro      485: \BJP
1.1       noro      486: @node $BJ,;67W;;$K4X$9$k4X?t(B,,, $BJ,;67W;;(B
                    487: @section $BJ,;67W;;$K4X$9$k4X?t(B
1.2     ! noro      488: \E
        !           489: \BEG
        !           490: @node Functions for distributed computation,,, Distributed computation
        !           491: @section Functions for distributed computation
        !           492: \E
1.1       noro      493:
                    494: @menu
                    495: * ox_launch ox_launch_nox ox_shutdown::
                    496: * ox_launch_generic::
                    497: * ox_asir::
                    498: * ox_rpc ox_cmo_rpc ox_execute_string::
                    499: * ox_push_cmo ox_push_local::
                    500: * ox_pop_cmo ox_pop_local::
                    501: * ox_push_cmd ox_sync::
                    502: * ox_get::
                    503: * ox_pops::
                    504: * ox_reset register_handler::
                    505: * ox_select::
                    506: * ox_flush::
                    507: * ox_get_serverinfo::
                    508: * generate_port try_bind_listen try_connect try_accept register_server::
                    509: * ifplot conplot plot plotover::
                    510: @end menu
                    511:
1.2     ! noro      512: \JP @node ox_launch ox_launch_nox ox_shutdown,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !           513: \EG @node ox_launch ox_launch_nox ox_shutdown,,, Functions for distributed computation
1.1       noro      514: @subsection @code{ox_launch}, @code{ox_launch_nox}, @code{ox_shutdown}
                    515: @findex ox_launch
                    516: @findex ox_launch_nox
                    517: @findex ox_shutdown
                    518:
                    519: @table @t
                    520: @item ox_launch([@var{host}[,@var{dir}],@var{command}])
                    521: @itemx ox_launch_nox([@var{host}[,@var{dir}],@var{command}])
1.2     ! noro      522: \JP :: $B1s3V%W%m%;%9$N5/F0$*$h$SDL?.$r3+;O$9$k(B.
        !           523: \EG :: Initialize OpenXM servers.
1.1       noro      524: @item ox_shutdown(@var{id})
1.2     ! noro      525: \JP :: $B1s3V%W%m%;%9$r=*N;$5$;(B, $BDL?.$r=*N;$9$k(B.
        !           526: \EG :: Terminates OpenXM servers.
1.1       noro      527: @end table
                    528:
                    529: @table @var
                    530: @item return
1.2     ! noro      531: \JP $B@0?t(B
        !           532: \EG integer
1.1       noro      533: @item host
1.2     ! noro      534: \JP $BJ8;zNs$^$?$O(B 0
        !           535: \EG string or 0
1.1       noro      536: @item dir, command
1.2     ! noro      537: \JP $BJ8;zNs(B
        !           538: \EG string
1.1       noro      539: @item id
1.2     ! noro      540: \JP $B@0?t(B
        !           541: \EG integer
1.1       noro      542: @end table
                    543:
                    544: @itemize @bullet
1.2     ! noro      545: \BJP
1.1       noro      546: @item
                    547: @code{ox_launch()} $B$O(B, $B%[%9%H(B @var{host} $B>e$G%3%^%s%I(B @var{command} $B$r5/F0$7(B,
                    548: $B$3$N%W%m%;%9$HDL?.$r3+;O$9$k(B.
                    549: $B0z?t$,(B 3 $B$D$N>l9g(B, @var{host} $B>e$G(B,
                    550: @var{dir} $B$K$"$k(B @samp{ox_launch} $B$H$$$&%5!<%P5/F0MQ%W%m%0%i%`$rN)$A>e$2$k(B.
                    551: @samp{ox_launch} $B$O(B @var{command} $B$r5/F0$9$k(B.
                    552: @var{host} $B$,(B 0 $B$N;~(B, @b{Asir} $B$,F0:n$7$F$$$k(B
                    553: $B%^%7%s>e$G%3%^%s%I$r5/F0$9$k(B.
                    554: $BL50z?t$N>l9g(B, @var{host} $B$O(B 0, @var{dir} $B$O(B @code{get_rootdir()}
                    555: $B$GJV$5$l$k%G%#%l%/%H%j(B, @var{command} $B$OF1$8%G%#%l%/%H%j$N(B @samp{ox_asir}
                    556: $B$r0UL#$9$k(B.
1.2     ! noro      557:
1.1       noro      558: @item
                    559: @var{host} $B$,(B 0, $B$9$J$o$A%5!<%P$r(B local $B$K5/F0$9$k>l9g$K$O(B, @var{dir}
                    560: $B$r>JN,$G$-$k(B. $B$3$N>l9g(B, @var{dir} $B$O(B @code{get_rootdir()} $B$GJV$5$l$k(B
                    561: $B%G%#%l%/%H%j$H$J$k(B.
1.2     ! noro      562:
1.1       noro      563: @item
                    564: @var{command} $B$,(B @samp{/} $B$G;O$^$kJ8;zNs$N>l9g(B, $B@dBP%Q%9$H2r<a$5$l$k(B.
                    565: $B$=$l0J30$N>l9g(B, @var{dir} $B$+$i$NAjBP%Q%9$H2r<a$5$l$k(B.
1.2     ! noro      566:
1.1       noro      567: @item
                    568: UNIX $BHG$K$*$$$F$O(B, @code{ox_launch()} $B$O(B, @var{command} $B$NI8=`=PNO(B, $BI8=`(B
                    569: $B%(%i!<=PNO$rI=<($9$k$?$a$N(B @samp{xterm} $B$r5/F0$9$k(B.
                    570: @code{ox_launch_nox()} $B$O(B, @code{X} $B$J$7$N4D6-$N>l9g(B, $B$"$k$$$O(B @samp{xterm}
                    571: $B$r5/F0$;$:$K%5!<%P$rN)$A>e$2$k>l9g$KMQ$$$k(B. $B$3$N>l9g(B,
                    572: @var{command} $B$N=PNO$O(B @samp{/dev/null} $B$K@\B3$5$l$k(B.
                    573: @code{ox_launch()} $B$N>l9g$G$b(B, $B4D6-JQ?t(B @code{DISPLAY} $B$,@_Dj$5$l$F$$$J$$(B
                    574: $B>l9g$K$O(B, @code{ox_launch_nox()} $B$HF1$8F0:n$r$9$k(B.
                    575:
                    576: @item
                    577: $BJV$5$l$k@0?t$ODL?.$N$?$a$N<1JL;R$H$J$k(B.
                    578:
                    579: @item
                    580: @b{Asir} $B$HDL?.$9$k%W%m%;%9$OF10l$N%^%7%s>e$GF0:n$7$F$$$kI,MW$O$J$$(B. $B$^(B
                    581: $B$?(B, $BDL?.$K$*$1$k%P%$%H%*!<%@$O(B server, client $B4V$G$N:G=i$N(B negotiation
                    582: $B$G7h$^$k$?$a(B, $BAj<j@h$N%^%7%s$H%P%$%H%*!<%@$,0[$J$C$F$$$F$b9=$o$J$$(B.
                    583:
                    584: @item
                    585: @var{host} $B$K%^%7%sL>$r;XDj$9$k>l9g(B, $B0J2<$N=`Hw$,I,MW$G$"$k(B.
                    586: $B$3$3$G(B, @b{Asir} $B$NF0$$$F$$$k%[%9%H$r(B @code{A}, $BDL?.Aj<j$N%W%m%;%9(B
                    587: $B$,5/F0$5$l$k%[%9%H$r(B @code{B} $B$H$9$k(B.
                    588:
                    589: @enumerate
                    590: @item
                    591: $B%[%9%H(B @code{B} $B$N(B @code{csh} $B$N%5!<%A%Q%9$K5/F0$5$l$k%W%m%0%i%`(B
                    592: $B$N$"$k%G%#%l%/%H%j$r$$$l$k(B. $B%W%m%0%i%`$O(B @code{rsh} $B$G5/F0$5$l$k(B. $B$7$?(B
                    593: $B$,$C$F(B, $B%[%9%H(B @code{B} $B$N%5!<%A%Q%9$K(B $B$=$N%W%m%0%i%`$,F~$C$F$$$J$$>l(B
                    594: $B9g$K$O5/F0$G$-$J$$(B. $B$3$N>l9g@dBP%Q%9$rM?$($k$+(B, @samp{~/.cshrc} $B$N%5!<(B
                    595: $B%A%Q%9$K$=$N%W%m%0%i%`$N$"$k%G%#%l%/%H%j$rDI2C$9$kI,MW$,$"$k(B. $B$=$N:](B,
                    596: $BAj<j@h%[%9%H$K$*$1$k%G%#%l%/%H%j$G$"$k$3$H$rK:$l$J$$$h$&$K$9$k$3$H(B.
                    597:
                    598: @item
                    599: $B%[%9%H(B @code{B} $B$N(B @samp{~/.rhosts} $B$K(B, $B%[%9%H(B @code{A} $B$N%[%9%H(B
                    600: $BL>$rEPO?$9$k(B.
                    601:
                    602: @item
                    603: @samp{ox_plot} $B$J$I(B, @code{X} $B$H$N%3%M%/%7%g%s$bMQ$$$i$l$k>l9g(B,
                    604: @code{Xserver} $B$KBP$7(B, $BI,MW$J%[%9%H$r(B authorize $B$5$;$k(B.
                    605: @code{xhost} $B$GI,MW$J%[%9%HL>$rDI2C$9$l$P$h$$(B.
                    606:
                    607: @item
                    608: @var{command} $B$K$h$C$F$O(B, $B%9%?%C%/$rBgNL$K;HMQ$9$k(B
                    609: $B$b$N$b$"$k$?$a(B, @samp{.cshrc} $B$G%9%?%C%/%5%$%:$rBg$-$a(B (16MB $BDxEY(B) $B$K(B
                    610: $B;XDj$7$F$*$/$N$,0BA4$G$"$k(B. $B%9%?%C%/%5%$%:$O(B @code{limit stacksize 16m}
                    611: $B$J$I$H;XDj$9$k(B.
                    612: @end enumerate
                    613:
                    614: @item
                    615: @var{command} $B$,(B, X $B>e$K%&%$%s%I%&$r3+$1$k>l9g(B,
                    616: @var{display}$B$,;XDj$5$l$l$P$=$NJ8;zNs$r(B, $B>JN,;~$K$O4D6-JQ?t(B
                    617: @code{DISPLAY} $B$NCM$rMQ$$$k(B.
                    618:
                    619: @item
                    620: @code{ox_shutdown()} $B$O<1JL;R(B @var{id} $B$KBP1~$9$k1s3V%W%m%;%9(B
                    621: $B$r=*N;$5$;$k(B.
                    622:
                    623: @item
                    624: @b{Asir} $B$,@5>o$7$?>l9g$K$OA4$F$NF~=PNO%9%H%j!<%`$O<+F0E*$KJD$8$i$l(B,
                    625: $B5/F0$5$l$F$$$k%W%m%;%9$OA4$F=*N;$9$k$,(B, $B0[>o=*N;$7$?>l9g(B, $B1s3V%W%m%;%9(B
                    626: $B$,=*N;$7$J$$>l9g$b$"$k(B. @b{Asir} $B$,0[>o=*N;$7$?>l9g(B, $B1s3V%W%m%;%9$r(B
                    627: $B5/F0$7$?%^%7%s>e$G(B @code{ps} $B$J$I$r5/F0$7$F(B, $B$b$7(B @b{Asir} $B$+$i5/F0(B
                    628: $B$7$?%W%m%;%9$,;D$C$F$$$k>l9g(B, @code{kill} $B$9$kI,MW$,$"$k(B.
                    629:
                    630: @item
                    631: log $BI=<(MQ(B @samp{xterm} $B$O(B @samp{-name ox_term} $B%*%W%7%g%s$G5/F0$5$l$k(B.
                    632: $B$h$C$F(B, @samp{ox_term} $B$J$k%j%=!<%9L>$KBP$7$F(B @samp{xterm} $B$N%j%=!<%9@_Dj(B
                    633: $B$r9T$($P(B, log $BMQ(B @samp{xterm} $B$N5sF0$N$_$rJQ$($k$3$H$,$G$-$k(B.
                    634: $BNc$($P(B,
1.2     ! noro      635:
1.1       noro      636: @example
                    637: ox_xterm*iconic:on
                    638: ox_xterm*scrollBar:on
                    639: ox_xterm*saveLines:1000
                    640: @end example
1.2     ! noro      641:
1.1       noro      642: $B$K$h$j(B, icon $B$G5/F0(B, scrollbar $B$D$-(B, scrollbar $B$G;2>H$G$-$k9T?t(B
                    643: $B$,:GBg(B 1000 $B9T(B, $B$H$$$&;XDj$,$G$-$k(B.
1.2     ! noro      644: \E
        !           645:
        !           646: \BEG
        !           647: @item
        !           648: Function @code{ox_launch()} invokes a process to execute @var{command}
        !           649: on a host @var{host} and enables @b{Asir} to communicate with that
        !           650: process.
        !           651: If the number of arguments is 3, @samp{ox_launch} in @var{dir}
        !           652: is invoked on @var{host}. Then @samp{ox_launch} invokes @var{command}.
        !           653: If @var{host} is equal to 0, all the commands are invoked
        !           654: on the same machine as the @b{Asir} is running.
        !           655: If no arguments are specified, @var{host}, @var{dir} and @var{command}
        !           656: are regarded as 0, the value of @code{get_rootdir()} and @samp{ox_dir} in
        !           657: the same directory respectively.
        !           658:
        !           659: @item
        !           660: If @var{host} is equal to 0, then @var{dir} can be omitted.
        !           661: In such a case @var{dir} is regarded as the value of @code{get_rootdir()}.
        !           662:
        !           663: @item
        !           664: If @var{command} begins with @samp{/}, it is regarded as an absolute
        !           665: pathname. Otherwise it is regarded as a relative pathname from
        !           666: @var{dir}.
        !           667:
        !           668: @item
        !           669: On UNIX, @code{ox_launch()} invokes @samp{xterm} to display
        !           670: standard outputs from @var{command}.
        !           671: If @code{X11} is not available or one wants to invoke servers without
        !           672: @samp{xterm}, use @code{ox_launch_nox()}, where the outputs of
        !           673: @var{command} are redirected to @samp{/dev/null}.
        !           674: If the environment variable @code{DISPLAY} is not set,
        !           675: @code{ox_launch()} and @code{ox_launch_nox()} behave identically.
        !           676:
        !           677: @item
        !           678: The returned value is used as the identifier for communication.
        !           679:
        !           680: @item
        !           681: The peers communicating with @b{Asir} are not necessarily processes
        !           682: running on the same machine.
        !           683: The communication will be successful even if
        !           684: the byte order is different from those of the peer processes,
        !           685: because the byte order for the communication is determined
        !           686: by a negotiation between a client and a server.
        !           687:
        !           688: @item
        !           689: The following preparations are necessary.
        !           690: Here, Let @code{A} be the host on which @b{Asir} is running, and
        !           691: @code{B} the host on which the peer process will run.
        !           692:
        !           693: @enumerate
        !           694: @item
        !           695: Set the command search path of @code{csh} on the remote host @code{B}
        !           696: so that your program, say @code{P}, can run on @code{B}.
        !           697: This is done by putting the directory of @code{P} to the command search
        !           698: path of @code{csh} on @code{B}.
        !           699: The program @code{P} is invoked by @code{rsh} or @code{remsh}.
        !           700: Thus, invocation of
        !           701: the program @code{P} shall fail unless it is found within the search
        !           702: path on the host @code{B}.
        !           703: For such a case, you can run the program @code{P} by either giving
        !           704: the absolute path or adding the directory of the program @code{P} to
        !           705: the search path description in your @samp{~/.cshrc}.
        !           706: Note that the the `directory' means the directory on the remote host
        !           707: @code{B}.
        !           708:
        !           709: @item
        !           710: Register the hostname of the host @code{A} to the @samp{~/.rhosts} of
        !           711: the host @code{B}.
        !           712: That is, you should be allowed to access the host @code{B} from @code{A}
        !           713: without supplying a password.
        !           714:
        !           715: @item
        !           716: For cases where connection to @code{X} is also used,
        !           717: let @code{Xserver} authorize the relevant hosts.
        !           718: Adding the hosts can be done by command @code{xhost}.
        !           719:
        !           720: @item
        !           721: Some @var{command}'s consume much stack space.  You are recommended
        !           722: to set the stack size to about 16MB large in @samp{.cshrc} for safe.
        !           723: To specify the size, put @code{limit stacksize 16m} for an example.
        !           724: @end enumerate
        !           725:
        !           726: @item
        !           727: When @var{command} opens a window on @code{X},
        !           728: it uses the string specified for @var{display};
        !           729: if the specification is omitted, it uses the value set for the
        !           730: environment variable @code{DISPLAY}.
        !           731:
        !           732: @item
        !           733: @code{ox_shutdown()} terminates OpenXM servers whose identifier
        !           734: is @var{id}.
        !           735:
        !           736: @item
        !           737: When @b{Asir} is terminated successfully, all I/O streams are
        !           738: automatically closed, and all the processes invoked are also terminated.
        !           739: However, some remote processes may not terminated when @b{Asir}
        !           740: is terminated abnormally.
        !           741: If ever @b{Asir} is terminated abnormally, you have to kill all the
        !           742: unterminated process invoked by @b{Asir} on every remote host.
        !           743: Check by @code{ps} command on the remote hosts to see if such processed
        !           744: are alive.
        !           745:
        !           746: @item
        !           747: @samp{xterm} for displaying the outputs from @var{command} is
        !           748: invoked with @samp{-name ox_term} option. Thus, by
        !           749: specifying resources for the resource name @samp{ox_term},
        !           750: only the behaviour of the @samp{xterm} can be customized.
        !           751:
        !           752: @example
        !           753: /* iconify on start */
        !           754: ox_xterm*iconic:on
        !           755: /* activate the scroll bar */
        !           756: ox_xterm*scrollBar:on
        !           757: /* 1000 lines can be shown by the scrollbar */
        !           758: ox_xterm*saveLines:1000
        !           759: @end example
        !           760: \E
1.1       noro      761: @end itemize
                    762:
                    763: @example
                    764: [219] ox_launch();
                    765: 0
                    766: [220] ox_rpc(0,"fctr",x^10-y^10);
                    767: 0
                    768: [221] ox_pop_local(0);
                    769: [[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1],
                    770: [x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
                    771: [222] ox_shutdown(0);
                    772: 0
                    773: @end example
                    774:
                    775: @table @t
1.2     ! noro      776: \JP @item $B;2>H(B
        !           777: \EG @item References
        !           778: @fref{ox_rpc ox_cmo_rpc ox_execute_string},
        !           779: @fref{ox_pop_cmo ox_pop_local},
        !           780: @fref{ifplot conplot plot plotover}
1.1       noro      781: @end table
                    782:
1.2     ! noro      783: \JP @node ox_launch_generic,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !           784: \EG @node ox_launch_generic,,, Functions for distributed computation
1.1       noro      785: @subsection @code{ox_launch_generic}
                    786: @findex ox_launch_generic
                    787:
                    788: @table @t
                    789: @item ox_launch_generic(@var{host},@var{launch},@var{server},@var{use_unix},@var{use_ssh},@var{use_x},@var{conn_to_serv})
1.2     ! noro      790: \JP :: $B1s3V%W%m%;%9$N5/F0$*$h$SDL?.$r3+;O$9$k(B.
        !           791: \EG :: Initialize OpenXM servers.
1.1       noro      792: @end table
                    793:
                    794: @table @var
                    795: @item return
1.2     ! noro      796: \JP $B@0?t(B
        !           797: \EG integer
1.1       noro      798: @item host
1.2     ! noro      799: \JP $BJ8;zNs$^$?$O(B 0
        !           800: \EG string or 0
1.1       noro      801: @item launcher, server
1.2     ! noro      802: \JP $BJ8;zNs(B
        !           803: \EG string
1.1       noro      804: @item use_unix, use_ssh, use_x, conn_to_serv
1.2     ! noro      805: \JP $B@0?t(B
        !           806: \EG integer
1.1       noro      807: @end table
                    808:
                    809: @itemize @bullet
1.2     ! noro      810: \BJP
1.1       noro      811: @item
                    812: @code{ox_launch_generic()} $B$O(B,
                    813: $B%[%9%H(B @var{host} $B>e$G(B, $B%3%s%H%m!<%k%W%m%;%9(B @var{launch} $B$*$h$S(B
                    814: $B%5!<%P%W%m%;%9(B @var{server} $B$r5/F0$9$k(B. $B$=$NB>$N0z?t$O(B, $B;HMQ$9$k(B
                    815: protocol $B$N<oN`(B, X $B$N;HMQ(B/$BIT;HMQ(B, rsh/ssh $B$K$h$k%W%m%;%95/F0(B, connect
                    816: $BJ}K!$N;XDj$J$I$r9T$&%9%$%C%A$G$"$k(B.
1.2     ! noro      817:
1.1       noro      818: @item
                    819: @var{host} $B$,(B 0 $B$N>l9g(B, @b{Asir} $B$,F0:n$7$F$$$k%^%7%s>e$K(B, @var{launch},
                    820: @var{server} $B$rN)$A>e$2$k(B. $B$3$N>l9g(B, @var{use_unix} $B$NCM$K$+$+$o$i$:(B,
                    821: UNIX internal protocol $B$,MQ$$$i$l$k(B.
1.2     ! noro      822:
1.1       noro      823: @item
                    824: @var{use_unix} $B$,(B 1 $B$N>l9g(B, UNIX internal protocol $B$rMQ$$$k(B. 0 $B$N>l9g(B,
                    825: Internet protocol $B$rMQ$$$k(B.
1.2     ! noro      826:
1.1       noro      827: @item
                    828: @var{use_ssh} $B$,(B 1 $B$N>l9g(B, @samp{ssh} (Secure Shell) $B$K$h$j%3%s%H%m!<%k(B,
1.2     ! noro      829: $B%5!<%P%W%m%;%9$rN)$A>e$2$k(B. @samp{ssh-agent} $B$J$I$rMxMQ$7$F$$$J>l9g(B,
        !           830: $B%Q%9%o!<%I$NF~NO$,I,MW$H$J$k(B.
1.1       noro      831: $BAj<j@h$G(B @samp{sshd} $B$,F0$$$F$$$J$$>l9g(B, $B<+F0E*$K(B @samp{rsh} $B$,MQ$$$i$l$k$,(B,
                    832: $B%Q%9%o!<%I$,I,MW$H$J$k>l9g$K$O(B, $B$=$N>l$G5/F0$K<:GT$9$k(B.
1.2     ! noro      833:
1.1       noro      834: @item
                    835: @var{use_x} $B$,(B 1 $B$N>l9g(B, X $B>e$G$NF0:n$r2>Dj$7(B, $B@_Dj$5$l$F$$$k(B DISPLAY$BJQ(B
                    836: $B?t$rMQ$$$F(B, log $BI=<(MQ(B @samp{xterm} $B$N$b$H$G(B @var{server} $B$,5/F0$5$l(B
                    837: $B$k(B. DISPLAY $BJQ?t$,%;%C%H$5$l$F$$$J$$>l9g$K$O(B, $B<+F0E*$K(B X $B$J$7$N@_Dj$H$J(B
                    838: $B$k(B. DISPLAY $B$,ITE,@Z$K%;%C%H$5$l$F$$$k>l9g$K$O(B, $B%3%s%H%m!<%k(B, $B%5!<%P$,%O(B
                    839: $B%s%0$9$k$N$GMWCm0U$G$"$k(B.
1.2     ! noro      840:
1.1       noro      841: @item
                    842: @var{conn_to_serv} $B$,(B 1 $B$N>l9g(B, @b{Asir} (client) $B$,@8@.$7$?%]!<%H$K(B
                    843: $BBP$7(B, client $B$,(B bind,listen $B$7(B, $B5/F0$5$l$?%W%m%;%9$,(B connect $B$9$k(B.
                    844: @var{conn_to_serv} $B$,(B 0 $B$N>l9g(B, $B5/F0$5$l$?%W%m%;%9$,(B bind, listen $B$7(B,
                    845: client $B$,(B connect $B$9$k(B.
1.2     ! noro      846: \E
        !           847:
        !           848: \BEG
        !           849: @item
        !           850: @code{ox_launch_generic()} invokes a control process @var{launch}
        !           851: and a server process @var{server} on @var{host}. The other arguments
        !           852: are switches for protocol family selection, on/off of the X environment,
        !           853: method of process invocation and selection of connection type.
        !           854:
        !           855: @item
        !           856: If @var{host} is equal to 0, processes
        !           857: are invoked on the same machine as the @b{Asir} is running.
        !           858: In this case UNIX internal protocol is always used.
        !           859:
        !           860: @item
        !           861: If @var{use_unix} is equal to 1, UNIX internal protocol is used.
        !           862: If @var{use_unix} is equal to 0, Internet protocol is used.
        !           863:
        !           864: @item
        !           865: If @var{use_ssh} is equal to 1,@samp{ssh} (Secure Shell)
        !           866: is used to invoke processes. If one does not use @samp{ssh-agent},
        !           867: a password (passphrase) is required.
        !           868: If @samp{sshd} is not running on the target machine,
        !           869: @samp{rsh} is used instead. But it will immediately fail
        !           870: if a password is required.
        !           871:
        !           872: @item
        !           873: If @var{use_x} is equal to 1, it is assumed that X environment
        !           874: is available. In such a case @var{server} is invoked under
        !           875: @samp{xterm} by using the current @code{DISPLAY} variable.
        !           876: If @code{DISPLAY} is not set, it is invoked without X.
        !           877: Note that the processes will hang up if @code{DISPLAY} is incorrectly set.
        !           878:
        !           879: @item
        !           880: If @var{conn_to_serv} is equal to 1, @b{Asir} (client)
        !           881: executes @code{bind} and @code{listen}, and the invoked processes execute
        !           882: @code{connect}.
        !           883: If @var{conn_to_serv} is equal to 0, @b{Asir} (client)
        !           884: the invoked processes execute @code{bind} and @code{listen}, and
        !           885: the client executes @code{connect}.
        !           886: \E
1.1       noro      887: @end itemize
                    888:
                    889: @example
                    890: [342] LIB=get_rootdir();
                    891: /export/home/noro/ca/Kobe/build/OpenXM/lib/asir
                    892: [343] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",0,0,0,0);
                    893: 1
                    894: [344] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,0,0,0);
                    895: 2
                    896: [345] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,0);
                    897: 3
                    898: [346] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,0);
                    899: 4
                    900: [347] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,1);
                    901: 5
                    902: [348] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,1);
                    903: 6
                    904: @end example
                    905:
                    906: @table @t
1.2     ! noro      907: \JP @item $B;2>H(B
        !           908: \EG @item References
        !           909: @fref{ox_launch ox_launch_nox ox_shutdown}, @fref{ox_launch_generic}
1.1       noro      910: @end table
                    911:
1.2     ! noro      912: \JP @node generate_port try_bind_listen try_connect try_accept register_server,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !           913: \EG @node generate_port try_bind_listen try_connect try_accept register_server,,, Functions for distributed computation
1.1       noro      914: @subsection @code{generate_port}, @code{try_bind_listen}, @code{try_connect}, @code{try_accept}, @code{register_server}
                    915: @findex generate_port
                    916: @findex try_bind_listen
                    917: @findex try_connect
                    918: @findex try_accept
                    919: @findex register_server
                    920:
                    921: @table @t
                    922: @item generate_port([@var{use_unix}])
1.2     ! noro      923: \JP :: port $B$N@8@.(B
        !           924: \EG :: Generates a port number.
1.1       noro      925: @itemx try_bind_listen(@var{port})
1.2     ! noro      926: \JP :: port $B$KBP$7$F(B bind, listen
        !           927: \EG :: Binds and listens on a port.
1.1       noro      928: @itemx try_connect(@var{host},@var{port})
1.2     ! noro      929: \JP :: port $B$KBP$7$F(B connect
        !           930: \EG :: Connects to a port.
1.1       noro      931: @itemx try_accept(@var{socket},@var{port})
1.2     ! noro      932: \JP :: connect $BMW5a$r(B accept
        !           933: \EG :: Accepts a connection request.
1.1       noro      934: @itemx register_server(@var{control_socket},@var{control_port},@var{server_socket},@var{server_port})
1.2     ! noro      935: \JP :: connection $B$N@.N)$7$?(B control socket, server socket $B$NEPO?(B
        !           936: \EG :: Registers the sockets for which connections are established.
1.1       noro      937: @end table
                    938:
                    939: @table @var
                    940: @item return
1.2     ! noro      941: \JP @code{generate_port()} $B$N$_@0?t$^$?$OJ8;zNs(B. $B$=$NB>$O@0?t(B.
        !           942: \EG integer or string for @code{generate_port()}, integer for the others
1.1       noro      943: @item use_unix
1.2     ! noro      944: \JP 0 $B$^$?$O(B 1
        !           945: \EG 0 or 1
1.1       noro      946: @item host
1.2     ! noro      947: \JP $BJ8;zNs(B
        !           948: \EG string
1.1       noro      949: @item port,control_port,server_port
1.2     ! noro      950: \JP $B@0?t$^$?$OJ8;zNs(B
        !           951: \EG integer or string
1.1       noro      952: @item socket,control_socket,server_socket
1.2     ! noro      953: \JP $B@0?t(B
        !           954: \EG integer
1.1       noro      955: @end table
                    956:
                    957: @itemize @bullet
1.2     ! noro      958: \BJP
1.1       noro      959: @item
                    960: $B$3$l$i$N4X?t$O(B, $B1s3V%W%m%;%9$HDL?.$r@.N)$5$;$k$?$a$N%W%j%_%F%#%V$G$"$k(B.
1.2     ! noro      961:
1.1       noro      962: @item
                    963: @code{generate_port()} $B$ODL?.$N$?$a$N(B port $B$r@8@.$9$k(B. $BL50z?t$"$k$$$O(B
                    964: $B0z?t$,(B 0 $B$N>l9g(B, Internet domain $B$N(B socket $B$N$?$a$N(B port $BHV9f(B, $B$=$l(B
                    965: $B0J30$N>l9g$K$O(B, UNIX domain (host-internal protocol) $B$N$?$a$N(B, $B%U%!%$%kL>(B
                    966: $B$r@8@.$9$k(B. port $BHV9f$O(B random $B$K@8@.$5$l$k$,(B, $B$=$N(B port $B$,;HMQCf$G$J$$(B
                    967: $BJ]>Z$O$J$$(B.
1.2     ! noro      968:
1.1       noro      969: @item
                    970: @code{try_bind_listen()} $B$O(B, $BM?$($i$l$?(B port $B$KBP$7(B, $B$=$N(B protocol $B$K(B
1.2     ! noro      971: $BBP1~$7$?(B socket $B$r@8@.$7(B, bind, listen $B$9$k(B. $B@.8y$7$?>l9g(B,
        !           972: socket $B<1JL;R$rJV$9(B. $B<:GT$7$?>l9g(B, -1 $B$,JV$k(B.
        !           973:
1.1       noro      974: @item
                    975: @code{try_connect()} $B$O(B, $B%[%9%H(B @var{host} $B$N(B port @var{port} $B$KBP$7(B
1.2     ! noro      976: connect $B$r;n$_$k(B. $B@.8y$7$?>l9g(B, socket $B<1JL;R$rJV$9(B. $B<:GT$7$?>l9g(B -1 $B$,JV$k(B.
        !           977:
1.1       noro      978: @item
                    979: @code{try_accept()} $B$O(B, @var{socket} $B$KBP$9$k(B connect $BMW5a$r(B accept
                    980: $B$7(B, $B?7$?$K@8@.$5$l$?(B socket $B$rJV$9(B. $B<:GT$7$?>l9g(B -1 $B$,JV$k(B.
                    981: $B$$$:$l$N>l9g$K$b(B, @var{socket} $B$O<+F0E*$K(B close $B$5$l$k(B.
                    982: $B0z?t(B @var{port} $B$O(B, @var{socket} $B$N(B protocol $B$rH=JL$9$k$?$a$KM?$($k(B.
1.2     ! noro      983:
1.1       noro      984: @item
                    985: @code{register_server()} $B$O(B, control, server $B$=$l$>$l$N(B socket $B$r(B
                    986: $B0lAH$K$7$F(B, server list $B$KEPO?$7(B, @code{ox_push_cmo()} $B$J$I$GMQ$$$k(B
                    987: $B%W%m%;%9<1JL;R$rJV$9(B.
1.2     ! noro      988:
1.1       noro      989: @item
                    990: $B1s3V%W%m%;%9$N5/F0$O(B, @code{shell()} $B$^$?$O<jF0$G9T$&(B.
1.2     ! noro      991: \E
        !           992: \BEG
        !           993: @item
        !           994: These functions are primitives to establish communications between
        !           995: a client and servers.
        !           996:
        !           997: @item
        !           998: @code{generate_port()} generates a port name for communication.
        !           999: If the argument is not specified or equal to 0, a port number
        !          1000: for Internet domain socket is generated randomly. Otherwise
        !          1001: a file name for UNIX domain (host-internal protocol) is generated.
        !          1002: Note that it is not assured that the generated port is not in use.
        !          1003:
        !          1004: @item
        !          1005: @code{try_bind_listen()} creates a socket according to the protocol
        !          1006: family indicated by the given port and executes @code{bind} and @code{listen}.
        !          1007: It returns a socket identifier if it is successful. -1 indicates an error.
        !          1008:
        !          1009: @item
        !          1010: @code{try_connect()} tries to connect to a port @var{port} on
        !          1011: a host @var{host}.
        !          1012: It returns a socket identifier if it is successful. -1 indicates an error.
        !          1013:
        !          1014: @item
        !          1015: @code{try_accept()} accepts a connection request to a socket @var{socket}.
        !          1016: It returns a new socket identifier if it is successful. -1 indicates an error.
        !          1017: In any case @var{socket} is automatically closed.
        !          1018: @var{port} is specified to distinguish the protocol family of @var{socket}.
        !          1019:
        !          1020: @item
        !          1021: @code{register_server()} registers a pair of a control socket and a server
        !          1022: socket. A process identifier indicating the pair is returned.
        !          1023: The process identifier is used as an argument
        !          1024: of @code{ox} functions such as @code{ox_push_cmo()}.
        !          1025:
        !          1026: @item
        !          1027: Servers are invoked by using @code{shell()}, or manually.
        !          1028: \E
1.1       noro     1029: @end itemize
                   1030:
                   1031: @example
                   1032: [340] CPort=generate_port();
                   1033: 39896
                   1034: [341] SPort=generate_port();
                   1035: 37222
                   1036: [342] CSocket=try_bind_listen(CPort);
                   1037: 3
                   1038: [343] SSocket=try_bind_listen(SPort);
                   1039: 5
                   1040:
                   1041: /*
1.2     ! noro     1042: \JP $B$3$3$G(B, ox_launch $B$r5/F0(B :
        !          1043: \EG ox_launch is invoked here :
1.1       noro     1044: %  ox_launch "127.1" 0 39716 37043 ox_asir "shio:0"
                   1045: */
                   1046:
                   1047: [344] CSocket=try_accept(CSocket,CPort);
                   1048: 6
                   1049: [345] SSocket=try_accept(SSocket,SPort);
                   1050: 3
                   1051: [346] register_server(CSocket,CPort,SSocket,SPort);
                   1052: 0
                   1053: @end example
                   1054:
                   1055: @table @t
1.2     ! noro     1056: \JP @item $B;2>H(B
        !          1057: \EG @item References
        !          1058: @fref{ox_launch ox_launch_nox ox_shutdown},
        !          1059: @fref{ox_launch_generic}, @fref{shell}, @fref{ox_push_cmo ox_push_local}
1.1       noro     1060: @end table
                   1061:
1.2     ! noro     1062: \JP @node ox_asir,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1063: \EG @node ox_asir,,, Functions for distributed computation
1.1       noro     1064: @subsection @samp{ox_asir}
                   1065:
1.2     ! noro     1066: \BJP
        !          1067: @samp{ox_asir} $B$O(B, @b{Asir} $B$N$[$\A4$F$N5!G=$r(B @b{OpenXM} $B%5!<%P(B
        !          1068: $B$H$7$FDs6!$9$k(B.
        !          1069: @samp{ox_asir} $B$O(B, @code{ox_launch} $B$^$?$O(B @code{ox_launch_nox} $B$G(B
        !          1070: $B5/F0$9$k(B. $B8e<T$O(B X $B4D6-$rMQ$$$J$$>l9g$N$?$a$KMQ0U$5$l$F$$$k(B.
        !          1071: \E
        !          1072: \BEG
        !          1073: @samp{ox_asir} provides almost all the functionalities of @b{Asir} as
        !          1074: an @b{OpenXM} server.
        !          1075: @samp{ox_asir} is invoked by @code{ox_launch} or @code{ox_launch_nox}.
        !          1076: If X environment is not available or is not necessary, one can use
        !          1077: @code{ox_launch_nox}.
        !          1078: \E
1.1       noro     1079:
                   1080: @example
                   1081: [5] ox_launch();
                   1082: 0
                   1083: @end example
                   1084:
                   1085: @example
                   1086: [5] ox_launch_nox("127.0.0.1","/usr/local/lib/asir","/usr/local/lib/asir/ox_asir");
                   1087: 0
                   1088: @end example
                   1089:
                   1090: @example
                   1091: [7] RemoteLibDir = "/usr/local/lib/asir/"$
                   1092: [8] Machines = ["sumire","rokkaku","genkotsu","shinpuku"];
                   1093: [sumire,rokkaku,genkotsu,shinpuku]
                   1094: [9] Servers = map(ox_launch,Machines,RemoteLibDir,RemoteLibDir+"ox_asir");
                   1095: [0,1,2,3]
                   1096: @end example
                   1097:
                   1098: @table @t
1.2     ! noro     1099: \JP @item $B;2>H(B
        !          1100: \EG @item References
        !          1101: @fref{ox_launch ox_launch_nox ox_shutdown}
1.1       noro     1102: @end table
                   1103:
1.2     ! noro     1104: \JP @node ox_rpc ox_cmo_rpc ox_execute_string,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1105: \EG @node ox_rpc ox_cmo_rpc ox_execute_string,,, Functions for distributed computation
1.1       noro     1106: @subsection @code{ox_rpc}, @code{ox_cmo_rpc}, @code{ox_execute_string}
                   1107: @findex ox_rpc
                   1108: @findex ox_cmo_rpc
                   1109: @findex ox_execute_string
                   1110:
                   1111: @table @t
                   1112: @item ox_rpc(@var{number},@code{"@var{func}"},@var{arg0},...)
                   1113: @itemx ox_cmo_rpc(@var{number},@code{"@var{func}"},@var{arg0},...)
                   1114: @itemx ox_execute_string(@var{number},@code{"@var{command}"},...)
1.2     ! noro     1115: \JP :: $B%W%m%;%9$NH!?t8F$S=P$7(B
        !          1116: \EG :: Calls a function on an OpenXM server
1.1       noro     1117: @end table
                   1118:
                   1119: @table @var
                   1120: @item return
                   1121: 0
                   1122: @item number
1.2     ! noro     1123: \JP $B?t(B ($B%W%m%;%9<1JL;R(B)
        !          1124: \EG integer (process identifier)
1.1       noro     1125: @item func
1.2     ! noro     1126: \JP $BH!?tL>(B
        !          1127: \EG function name
1.1       noro     1128: @item command
1.2     ! noro     1129: \JP $BJ8;zNs(B
        !          1130: \EG string
1.1       noro     1131: @item arg0, arg1, ...
1.2     ! noro     1132: \JP $BG$0U(B ($B0z?t(B)
        !          1133: \EG arbitrary (arguments)
1.1       noro     1134: @end table
                   1135:
                   1136: @itemize @bullet
1.2     ! noro     1137: \BJP
1.1       noro     1138: @item
                   1139: $B<1JL;R(B @var{number} $B$N%W%m%;%9$NH!?t$r8F$S=P$9(B.
1.2     ! noro     1140:
1.1       noro     1141: @item
                   1142: $BH!?t$N7W;;=*N;$rBT$?$:(B, $BD>$A$K(B 0 $B$rJV$9(B.
1.2     ! noro     1143:
1.1       noro     1144: @item
                   1145: @code{ox_rpc()} $B$O(B, $B%5!<%P$,(B @samp{ox_asir} $B$N>l9g$N$_MQ$$$k$3$H$,$G$-$k(B.
                   1146: $B$=$l0J30$N>l9g$O(B, @code{ox_cmo_rpc()} $B$rMQ$$$k(B.
1.2     ! noro     1147:
1.1       noro     1148: @item
                   1149: $BH!?t$,JV$9CM$O(B @code{ox_pop_local()}, @code{ox_pop_cmo()} $B$K$h$j<h$j=P$9(B.
1.2     ! noro     1150:
1.1       noro     1151: @item
                   1152: $B%5!<%P$,(B @samp{ox_asir} $B0J30$N$b$N(B ($BNc$($P(B Kan $B%5!<%P(B @samp{ox_sm1}$B$J$I(B)
                   1153: $B$N>l9g$K$O(B, @b{Open_XM} $B%W%m%H%3%k$G%5%]!<%H$5$l$F$$$k%G!<%?$N$_$r(B
                   1154: $BAw$k$3$H$,$G$-$k(B.
1.2     ! noro     1155:
1.1       noro     1156: @item
                   1157: @code{ox_execute_string} $B$O(B, $BAw$C$?J8;zNs(B @var{command} $B$r%5!<%P$,<+$i$N(B
                   1158: $B%f!<%68@8l%Q!<%6$G2r@O$7(B, $BI>2A$7$?7k2L$r%5!<%P$N%9%?%C%/$KCV$/$h$&$K(B
                   1159: $B;X<($9$k(B.
1.2     ! noro     1160: \E
        !          1161:
        !          1162: \BEG
        !          1163: @item
        !          1164: Calls a function on an @b{OpenXM} server whose identifier is @var{number}.
        !          1165:
        !          1166: @item
        !          1167: It returns 0 immediately. It does not wait the termination of the function
        !          1168: call.
        !          1169:
        !          1170: @item
        !          1171: @code{ox_rpc()} can be used when the server is @samp{ox_asir}.
        !          1172: Otherwise @code{ox_cmo_rpc()} should be used.
        !          1173:
        !          1174: @item
        !          1175: The result of the function call is put on the stack of the server.
        !          1176: It can be received by @code{ox_pop_local()} or @code{ox_pop_cmo()}.
        !          1177:
        !          1178: @item
        !          1179: If the server is not @samp{ox_asir}, only data defined in
        !          1180: @b{OpenXM} can be sent.
        !          1181:
        !          1182: @item
        !          1183: @code{ox_execute_string} requests the server to parse and execute
        !          1184: @var{command} by the parser and the evaluater of the server.
        !          1185: The result is pushed to the stack.
        !          1186: \E
1.1       noro     1187: @end itemize
                   1188:
                   1189: @example
                   1190: [234] ox_cmo_rpc(0,"dp_ht",dp_ptod((x+y)^10,[x,y]));
                   1191: 0
                   1192: [235] ox_pop_cmo(0);
                   1193: (1)*<<10,0>>
                   1194: [236] ox_execute_string(0,"12345 % 678;");
                   1195: 0
                   1196: [237] ox_pop_cmo(0);
                   1197: 141
                   1198: @end example
                   1199:
                   1200: @table @t
1.2     ! noro     1201: \JP @item $B;2>H(B
        !          1202: \EG @item References
        !          1203: @fref{ox_pop_cmo ox_pop_local}
1.1       noro     1204: @end table
                   1205:
1.2     ! noro     1206: \JP @node ox_reset register_handler,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1207: \EG @node ox_reset register_handler,,, Functions for distributed computation
1.1       noro     1208: @subsection @code{ox_reset},@code{register_handler}
                   1209: @findex ox_reset
                   1210: @findex register_handler
                   1211:
                   1212: @table @t
                   1213: @item ox_reset(@var{number})
1.2     ! noro     1214: \JP :: $B%W%m%;%9$N%j%;%C%H(B
        !          1215: \EG :: Resets an OpenXM server
1.1       noro     1216: @item register_handler(@var{func})
1.2     ! noro     1217: \JP :: $B%W%m%;%9$N%j%;%C%H$N$?$a$N4X?tEPO?(B
        !          1218: \EG :: Registers a function callable on a keyboard interrupt.
1.1       noro     1219: @end table
                   1220:
                   1221: @table @var
                   1222: @item return
                   1223: 1
                   1224: @item number
1.2     ! noro     1225: \JP $B?t(B ($B%W%m%;%9<1JL;R(B)
        !          1226: \EG integer(process identifier)
1.1       noro     1227: @item func
1.2     ! noro     1228: \JP $B4X?t;R$^$?$O(B 0
        !          1229: \EG functor or 0
1.1       noro     1230: @end table
                   1231:
                   1232: @itemize @bullet
1.2     ! noro     1233: \BJP
1.1       noro     1234: @item
                   1235: @code{ox_reset()} $B$O(B, $B<1JL;R(B @var{number} $B$N%W%m%;%9$r%j%;%C%H$7(B, $B%3%^%s(B
                   1236: $B%I<u$1IU$1>uBV$K$9$k(B.
1.2     ! noro     1237:
1.1       noro     1238: @item
                   1239: $B$=$N%W%m%;%9$,4{$K=q$-=P$7$?(B, $B$"$k$$$O8=:_=q$-=P$7Cf$N%G!<%?$,$"$k>l9g(B,
                   1240: $B$=$l$rA4ItFI$_=P$7(B, $B=PNO%P%C%U%!$r6u$K$7$?;~E@$GLa$k(B.
1.2     ! noro     1241:
1.1       noro     1242: @item
                   1243: $B;R%W%m%;%9$,(B RUN $B>uBV$N>l9g$G$b(B, $B3d$j9~$_$K$h$j6/@)E*$K7W;;$r=*N;$5$;$k(B.
1.2     ! noro     1244:
1.1       noro     1245: @item
                   1246: $BJ,;67W;;$r9T$&H!?t$N@hF,$G(B, $B;HMQ$9$k%W%m%;%9$KBP$7$F<B9T$9$k(B. $B$"$k$$$O(B
                   1247: $B7W;;ESCf$G$N6/@)CfCG$KMQ$$$k(B.
1.2     ! noro     1248:
1.1       noro     1249: @item
                   1250: @code{register_handler()} $B$O(B, @kbd{C-c} $B$J$I$K$h$k3d$j9~$_$N:]$K(B,
                   1251: @kbd{u} $B$r;XDj$9$k$3$H$G(B, $BL50z?t%f!<%6Dj5A4X?t(B @var{func()} $B$,8F$S=P$5$l$k(B
                   1252: $B$h$&$K@_Dj$9$k(B. $B$3$N4X?t$K(B, @code{ox_reset()} $B$r8F$S=P$5$;$k$3$H$G(B,
1.2     ! noro     1253: $B3d$j9~$_$N:]$K<+F0E*$K(B @b{OpenXM} server $B$N%j%;%C%H$r9T$&$3$H$,$G$-$k(B.
        !          1254:
1.1       noro     1255: @item
                   1256: @var{func} $B$K(B 0 $B$r;XDj$9$k$3$H$G(B, $B@_Dj$r2r=|$G$-$k(B.
1.2     ! noro     1257: \E
        !          1258:
        !          1259: \BEG
        !          1260: @item
        !          1261: @code{ox_reset()} resets a process whose identifier is @var{number}.
        !          1262: After its execution the process is ready for receiving data.
        !          1263:
        !          1264: @item
        !          1265: After executing @code{ox_reset()}, sending/receiving buffers and
        !          1266: stream buffers are assured to be empty.
        !          1267:
        !          1268: @item
        !          1269: Even if a process is running, the execution is safely stopped.
        !          1270:
        !          1271: @item
        !          1272: @code{ox_reset()} may be used prior to a distirbuted computation.
        !          1273: It can be also used to interrupt a distributed computation.
        !          1274:
        !          1275: @item
        !          1276: @code{register_handler()} registers a function @var{func()}.
        !          1277: If @kbd{u} is specified on a keybord interrupt, @var{func()}
        !          1278: is executed before returning the toplevel.
        !          1279: If @code{ox_reset()} calls are included in @var{func()},
        !          1280: one can automatically reset @b{OpenXM} servers on a keyboard interrupt.
        !          1281:
        !          1282: @item
        !          1283: If @var{func} is equal to 0, the setting is reset.
        !          1284: \E
1.1       noro     1285: @end itemize
                   1286:
                   1287: @example
                   1288: [10] ox_launch();
                   1289: 0
                   1290: [11] ox_rpc(0,"fctr",x^100-y^100);
                   1291: 0
1.2     ! noro     1292: \BJP
        !          1293: [12] ox_reset(0); /* xterm $B$N%&%#%s%I%&$K$O(B                             */
        !          1294: 1                 /* usr1 : return to toplevel by SIGUSR1 $B$,I=<($5$l$k(B. */
        !          1295: \E
        !          1296: \BEG
        !          1297: [12] ox_reset(0); /* usr1 : return to toplevel by SIGUSR1 */
        !          1298: 1                 /* is displayed on the xterm.           */
        !          1299: \E
1.1       noro     1300: @end example
                   1301:
                   1302: @example
                   1303: [340] Procs=[ox_launch(),ox_launch()];
                   1304: [0,1]
                   1305: [341] def reset() @{ extern Procs; map(ox_reset,Procs);@}
                   1306: [342] map(ox_rpc,Procs,"fctr",x^100-y^100);
                   1307: [0,0]
                   1308: [343] register_handler(reset);
                   1309: 1
                   1310: [344] interrupt ?(q/t/c/d/u/w/?) u
                   1311: Abort this computation? (y or n) y
                   1312: Calling the registered exception handler...done.
                   1313: return to toplevel
                   1314: @end example
                   1315: @table @t
1.2     ! noro     1316: \JP @item $B;2>H(B
        !          1317: \EG @item References
        !          1318: @fref{ox_rpc ox_cmo_rpc ox_execute_string}
1.1       noro     1319: @end table
                   1320:
1.2     ! noro     1321: \JP @node ox_push_cmo ox_push_local,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1322: \EG @node ox_push_cmo ox_push_local,,, Functions for distributed computation
1.1       noro     1323: @subsection @code{ox_push_cmo}, @code{ox_push_local}
                   1324: @findex ox_push_cmo
                   1325: @findex ox_push_local
                   1326:
                   1327: @table @t
                   1328: @item ox_push_cmo(@var{number},@var{obj})
                   1329: @itemx ox_push_local(@var{number},@var{obj})
1.2     ! noro     1330: \JP :: @var{obj} $B$r<1JL;R(B @var{number} $B$N%W%m%;%9$KAw?.(B
        !          1331: \EG :: Sends @var{obj} to a process whose identifier is @var{number}.
1.1       noro     1332: @end table
                   1333:
                   1334: @table @var
                   1335: @item return
                   1336: 0
                   1337: @item number
1.2     ! noro     1338: \JP $B?t(B($B%W%m%;%9<1JL;R(B)
        !          1339: \EG integer(process identifier)
1.1       noro     1340: @item obj
1.2     ! noro     1341: \JP $B%*%V%8%'%/%H(B
        !          1342: \EG object
1.1       noro     1343: @end table
                   1344:
                   1345: @itemize @bullet
1.2     ! noro     1346: \BJP
1.1       noro     1347: @item $B<1JL;R(B @var{number} $B$N%W%m%;%9$K(B @var{obj} $B$rAw?.$9$k(B.
                   1348: @item @code{ox_push_cmo} $B$O(B, Asir $B0J30$N(B @b{Open_XM} $B%5!<%P$KAw?.(B
                   1349: $B$9$k:]$KMQ$$$k(B.
                   1350: @item @code{ox_push_local} $B$O(B, @samp{ox_asir}, @samp{ox_plot} $B$K(B
                   1351: $B%G!<%?$rAw$k>l9g$KMQ$$$k$3$H$,$G$-$k(B.
                   1352: @item $B%P%C%U%!$,$$$C$Q$$$K$J$i$J$$8B$j(B, $B$?$@$A$KI|5"$9$k(B.
1.2     ! noro     1353: \E
        !          1354: \BEG
        !          1355: @item
        !          1356: Sends @var{obj} to a process whose identifier is @var{number}.
        !          1357:
        !          1358: @item
        !          1359: @code{ox_push_cmo} is used to send data to an @b{Open_XM} other
        !          1360: than @samp{ox_asir} and @samp{ox_plot}.
        !          1361:
        !          1362: @item
        !          1363: @code{ox_push_local} is used to send data to @samp{ox_asir} and @samp{ox_plot}.
        !          1364:
        !          1365: @item
        !          1366: The call immediately returns unless the stream buffer is full.
        !          1367: \E
1.1       noro     1368: @end itemize
                   1369:
                   1370: @table @t
1.2     ! noro     1371: \JP @item $B;2>H(B
        !          1372: \EG @item References
        !          1373: @fref{ox_rpc ox_cmo_rpc ox_execute_string},
        !          1374: @fref{ox_pop_cmo ox_pop_local}
1.1       noro     1375: @end table
                   1376:
1.2     ! noro     1377: \JP @node ox_pop_cmo ox_pop_local,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1378: \EG @node ox_pop_cmo ox_pop_local,,, Functions for distributed computation
1.1       noro     1379: @subsection @code{ox_pop_cmo}, @code{ox_pop_local}
                   1380: @findex ox_pop_local
                   1381: @findex ox_pop_cmo
                   1382:
                   1383: @table @t
                   1384: @item ox_pop_local(@var{number})
1.2     ! noro     1385: \JP :: $B%W%m%;%9<1JL;R(B @var{number} $B$+$i%G!<%?$r<u?.$9$k(B.
        !          1386: \EG :: Receives data from a process whose identifier is @var{number}.
1.1       noro     1387: @end table
                   1388:
                   1389: @table @var
                   1390: @item return
1.2     ! noro     1391: \JP $B<u?.%G!<%?(B
        !          1392: \EG received data
1.1       noro     1393: @item number
1.2     ! noro     1394: \JP $B?t(B ($B%W%m%;%9<1JL;R(B)
        !          1395: \EG integer(process identifier)
1.1       noro     1396: @end table
                   1397:
                   1398: @itemize @bullet
1.2     ! noro     1399: \BJP
1.1       noro     1400: @item
                   1401: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$+$i%G!<%?$r<u?.$9$k(B.
                   1402: @item @code{ox_pop_cmo} $B$O(B, Asir $B0J30$N(B @b{Open_XM} $B%5!<%P$+$i<u?.(B
                   1403: $B$9$k:]$KMQ$$$k(B.
                   1404: @item @code{ox_pop_local} $B$O(B, @samp{ox_asir}, @samp{ox_plot} $B$+$i(B
                   1405: $B%G!<%?$r<u$1<h$k>l9g$KMQ$$$k$3$H$,$G$-$k(B.
                   1406: @item $B%5!<%P$,7W;;Cf$N>l9g%V%m%C%/$9$k(B. $B$3$l$rHr$1$k$?$a$K$O(B,
                   1407: @code{ox_push_cmd} $B$G(B @code{SM_popCMO} (262) $B$^$?$O(B @code{SM_popSerializedLocalObject} (258) $B$rAw$C$F$*$-(B, @code{ox_select} $B$G%W%m%;%9$,(B ready
                   1408: $B$K$J$C$F$$$k$3$H$r3N$+$a$F$+$i(B @code{ox_get} $B$9$l$P$h$$(B.
1.2     ! noro     1409: \E
        !          1410: \BEG
1.1       noro     1411: @item
1.2     ! noro     1412: Receives data from a process whose identifier is @var{number}.
        !          1413: @item
        !          1414: @code{ox_pop_cmo} can be used to receive data form an @b{OpenXM} server
        !          1415: other than @samp{ox_asir} and @samp{ox_plot}.
        !          1416: @item
        !          1417: @code{ox_pop_local} can be used to receive data from
        !          1418: @samp{ox_asir}, @samp{ox_plot}.
        !          1419: @item
        !          1420: If no data is available, these functions block.
        !          1421: To avoid it, send @code{SM_popCMO} (262) or
        !          1422: @code{SM_popSerializedLocalObject} (258).
        !          1423: Then check the process status by @code{ox_select}.
        !          1424: Finally call @code{ox_get} for a ready process.
        !          1425: \E
1.1       noro     1426: @end itemize
                   1427:
                   1428: @example
                   1429: [3] ox_rpc(0,"fctr",x^100-y^100);
                   1430: 0
                   1431: [4] ox_push_cmd(0,258);
                   1432: 0
                   1433: [5] ox_select([0]);
                   1434: [0]
                   1435: [6] ox_get(0);
                   1436: [[1,1],[x^2+y^2,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],...]
                   1437: @end example
                   1438:
                   1439: @table @t
1.2     ! noro     1440: \JP @item $B;2>H(B
        !          1441: \EG @item References
        !          1442: @fref{ox_rpc ox_cmo_rpc ox_execute_string},
        !          1443: @fref{ox_push_cmd ox_sync}, @fref{ox_select}, @fref{ox_get}
1.1       noro     1444: @end table
                   1445:
1.2     ! noro     1446: \JP @node ox_push_cmd ox_sync,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1447: \EG @node ox_push_cmd ox_sync,,, Functions for distributed computation
1.1       noro     1448: @subsection @code{ox_push_cmd}, @code{ox_sync}
                   1449: @findex ox_push_cmd
                   1450: @findex ox_sync
                   1451:
                   1452: @table @t
                   1453: @item ox_push_cmd(@var{number},@var{command})
1.2     ! noro     1454: \JP :: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$K%3%^%s%I(B @var{command} $B$rAw?.$9$k(B.
        !          1455: \EG :: Sends a command @var{command} to a process whose identifier is @var{number}.
1.1       noro     1456: @item ox_sync(@var{number})
1.2     ! noro     1457: \JP :: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$K(B @b{OX_SYNC_BALL} $B$rAw?.$9$k(B.
        !          1458: \EG :: Sends @b{OX_SYNC_BALL} to a process whose identifier is @var{number}.
1.1       noro     1459: @end table
                   1460:
                   1461: @table @var
                   1462: @item return
                   1463: 0
                   1464: @item number
1.2     ! noro     1465: \JP $B?t(B ($B%W%m%;%9<1JL;R(B)
        !          1466: \EG integer(process identifier)
1.1       noro     1467: @item command
1.2     ! noro     1468: \JP $B?t(B ($B%3%^%s%I<1JL;R(B)
        !          1469: \EG integer(command identifier)
1.1       noro     1470: @end table
                   1471:
                   1472: @itemize @bullet
1.2     ! noro     1473: \BJP
1.1       noro     1474: @item
                   1475: $B<1JL;R(B @var{number} $B$N%W%m%;%9$K%3%^%s%I$^$?$O(B @b{OX_SYNC_BALL} $B$rAw?.$9$k(B.
1.2     ! noro     1476:
1.1       noro     1477: @item
                   1478: @b{Open_XM} $B$K$*$$$FAw<u?.%G!<%?$O(B @b{OX_DATA}, @b{OX_COMMAND},
                   1479: @b{OX_SYNC_BALL}$B$N(B 3 $B<oN`$KJ,$+$l$k(B. $BDL>o(B, $B%3%^%s%I$O2?$i$+$NA`:n$K(B
                   1480: $BIU?o$7$F0EL[$N$&$A$KAw?.$5$l$k$,(B, $B$3$l$r%f!<%6$,8DJL$KAw$j$?$$>l9g$K(B
                   1481: $BMQ$$$i$l$k(B.
1.2     ! noro     1482:
1.1       noro     1483: @item
                   1484: @b{OX_SYNC_BALL} $B$O(B @code{ox_reset} $B$K$h$k7W;;CfCG(B, $BI|5"$N:]$KAw<u?.$5$l$k(B
                   1485: $B$,(B, $B$3$l$r8DJL$KAw$j$?$$>l9g$KMQ$$$k(B. $B$J$*(B, $BDL>o>uBV$G$O(B @b{OX_SYNC_BALL}
                   1486: $B$OL5;k$5$l$k(B.
1.2     ! noro     1487: \E
        !          1488:
        !          1489: \BEG
        !          1490: @item
        !          1491: Sends a command or @b{OX_SYNC_BALL} to a process whose identifier is
        !          1492: @var{number}.
        !          1493:
        !          1494: @item
        !          1495: Data in @b{OpenXM} are categorized into three types:
        !          1496: @b{OX_DATA}, @b{OX_COMMAND}, @b{OX_SYNC_BALL}.
        !          1497: Usually @b{OX_COMMAND} and @b{OX_SYNC_BALL} are
        !          1498: sent implicitly with high level operations, but
        !          1499: these functions are prepared to send these data explicitly.
        !          1500:
        !          1501: @item
        !          1502: @b{OX_SYNC_BALL} is used on the reseting operation by @code{ox_reset}.
        !          1503: Usually @b{OX_SYNC_BALL} will be ignored by the peer.
        !          1504: \E
1.1       noro     1505: @end itemize
                   1506:
                   1507: @table @t
1.2     ! noro     1508: \JP @item $B;2>H(B
        !          1509: \EG @item References
        !          1510: @fref{ox_rpc ox_cmo_rpc ox_execute_string}, @fref{ox_reset register_handler}
1.1       noro     1511: @end table
                   1512:
1.2     ! noro     1513: \JP @node ox_get,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1514: \EG @node ox_get,,, Functions for distributed computation
1.1       noro     1515: @subsection @code{ox_get}
                   1516: @findex ox_get
                   1517:
                   1518: @table @t
                   1519: @item ox_get(@var{number})
1.2     ! noro     1520: \JP :: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$+$i%G!<%?$r<u?.$9$k(B.
        !          1521: \EG :: Receives data form a process whose identifer is @var{number}.
1.1       noro     1522: @end table
                   1523:
                   1524: @table @var
                   1525: @item return
1.2     ! noro     1526: \JP $B<u?.%G!<%?(B
1.1       noro     1527: @item number
1.2     ! noro     1528: \JP $B?t(B($B%W%m%;%9<1JL;R(B)
        !          1529: \EG integer(process identifier)
1.1       noro     1530: @end table
                   1531:
                   1532: @itemize @bullet
1.2     ! noro     1533: \BJP
1.1       noro     1534: @item
                   1535: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$+$i%G!<%?$r<u?.$9$k(B. $B4{$K(B
                   1536: $B%9%H%j!<%`>e$K%G!<%?$,$"$k$3$H$r2>Dj$7$F$$$k(B.
1.2     ! noro     1537:
1.1       noro     1538: @item
                   1539: @code{ox_push_cmd} $B$HAH$_9g$o$;$FMQ$$$k(B.
1.2     ! noro     1540:
1.1       noro     1541: @item
                   1542: @code{ox_pop_cmo}, @code{ox_pop_local} $B$O(B, @code{ox_push_cmd} $B$H(B
                   1543: @code{ox_get} $B$NAH$_9g$o$;$G<B8=$5$l$F$$$k(B.
1.2     ! noro     1544: \E
        !          1545: \BEG
        !          1546: @item
        !          1547: Receives data form a process whose identifer is @var{number}.
        !          1548:
        !          1549: @item
        !          1550: One may use this function with @code{ox_push_cmd}.
        !          1551:
        !          1552: @item
        !          1553: @code{ox_pop_cmo} and @code{ox_pop_local}
        !          1554: is realized as combinations of @code{ox_push_cmd} and @code{ox_get}.
        !          1555: \E
1.1       noro     1556: @end itemize
                   1557:
                   1558: @example
                   1559: [11] ox_push_cmo(0,123);
                   1560: 0
                   1561: [12] ox_push_cmd(0,262); /* 262=OX_popCMO */
                   1562: 0
                   1563: [13] ox_get(0);
                   1564: 123
                   1565: @end example
                   1566:
                   1567: @table @t
1.2     ! noro     1568: \JP @item $B;2>H(B
        !          1569: \EG @item References
        !          1570: @fref{ox_pop_cmo ox_pop_local}, @fref{ox_push_cmd ox_sync}
1.1       noro     1571: @end table
                   1572:
1.2     ! noro     1573: \JP @node ox_pops,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1574: \EG @node ox_pops,,, Functions for distributed computation
1.1       noro     1575: @subsection @code{ox_pops}
                   1576: @findex ox_pops
                   1577:
                   1578: @table @t
                   1579: @item ox_pops(@var{number}[,@var{nitem})
1.2     ! noro     1580: \JP :: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$N%9%?%C%/$+$i%G!<%?$r<h$j=|$/(B.
        !          1581: \EG :: Removes data form the stack of a process whose identifier is @var{number}.
1.1       noro     1582: @end table
                   1583:
                   1584: @table @var
                   1585: @item return
                   1586: 0
                   1587: @item number
1.2     ! noro     1588: \JP $B?t(B ($B%W%m%;%9<1JL;R(B)
        !          1589: \EG integer(process identifier)
1.1       noro     1590: @item nitem
1.2     ! noro     1591: \JP $B<+A3?t(B
        !          1592: \EG non-negative integer
1.1       noro     1593: @end table
                   1594:
                   1595: @itemize @bullet
1.2     ! noro     1596: \BJP
        !          1597: @item
        !          1598: $B%W%m%;%9<1JL;R(B @var{number} $B$N%W%m%;%9$N%9%?%C%/$+$i%G!<%?$r<h$j=|$/(B.
1.1       noro     1599: @var{nitem} $B$,;XDj$5$l$F$$$k>l9g$O(B @var{nitem} $B8D(B, $B;XDj$N$J$$>l9g$O(B
                   1600: 1 $B8D<h$j=|$/(B.
1.2     ! noro     1601: \E
        !          1602: \BEG
        !          1603: @item
        !          1604: Removes data form the stack of a process whose identifier is @var{number}.
        !          1605: If @var{nitem} is specified, @var{nitem} items are removed.
        !          1606: If @var{nitem} is not specified, 1 item is removed.
        !          1607: \E
1.1       noro     1608: @end itemize
                   1609:
                   1610: @example
                   1611: [69] for(I=1;I<=10;I++)ox_push_cmo(0,I);
                   1612: [70] ox_pops(0,4);
                   1613: 0
                   1614: [71] ox_pop_cmo(0);
                   1615: 6
                   1616: @end example
                   1617:
                   1618: @table @t
1.2     ! noro     1619: \JP @item $B;2>H(B
        !          1620: \EG @item References
        !          1621: @fref{ox_pop_cmo ox_pop_local}
1.1       noro     1622: @end table
                   1623:
1.2     ! noro     1624: \JP @node ox_select,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1625: \EG @node ox_select,,, Functions for distributed computation
1.1       noro     1626: @subsection @code{ox_select}
                   1627: @findex ox_select
                   1628:
                   1629: @table @t
                   1630: @item ox_select(@var{nlist}[,@var{timeout}])
1.2     ! noro     1631: \JP :: $BFI$_=P$72DG=$J%W%m%;%9$N<1JL;R$rJV$9(B.
        !          1632: \EG :: Returns the list of process identifiers on which data is available.
1.1       noro     1633: @end table
                   1634:
                   1635: @table @var
                   1636: @item return
1.2     ! noro     1637: \JP $B%j%9%H(B
        !          1638: \EG list
1.1       noro     1639: @item nlist
1.2     ! noro     1640: \JP $B?t(B ($B;R%W%m%;%9<1JL;R(B) $B$N%j%9%H(B
        !          1641: \EG list of integers (process identifier)
1.1       noro     1642: @item timeout
1.2     ! noro     1643: \JP $B?t(B
        !          1644: \EG number
1.1       noro     1645: @end table
                   1646:
                   1647: @itemize @bullet
1.2     ! noro     1648: \BJP
1.1       noro     1649: @item
                   1650: $B<1JL;R%j%9%H(B @var{nlist} $B$N%W%m%;%9$N$&$A4{$K=PNO$rJV$7$F$$$k(B
                   1651: $B%W%m%;%9$N<1JL;R%j%9%H$rJV$9(B.
1.2     ! noro     1652:
1.1       noro     1653: @item
                   1654: $BA4$F$N%W%m%;%9$,(B RUN $B>uBV$N$H$-(B, $B$$$:$l$+$N%W%m%;%9$N=*N;$rBT$D(B.
                   1655: $BC"$7(B, @var{timeout} $B$,;XDj$5$l$F$$$k>l9g(B, @var{timeout} $BIC$@$1BT$D(B.
1.2     ! noro     1656:
1.1       noro     1657: @item
                   1658: @code{ox_push_cmd()} $B$G(B @code{SM_popCMO} $B$"$k$$$O(B
                   1659: @code{SM_popSerializedLocalObject} $B$rAw$C$F$*$-(B, @code{ox_select()} $B$G(B
                   1660: ready $B>uBV$N%W%m%;%9$rD4$Y$F(B@code{ox_get()} $B$9$k$3$H$G(B,
                   1661: @code{ox_pop_local()}, @code{ox_pop_cmo()}$B$GBT$A>uBV$KF~$k$N$rKI$0$3$H$,(B
                   1662: $B$G$-$k(B.
1.2     ! noro     1663: \E
        !          1664: \BEG
        !          1665: @item
        !          1666: Returns the list of process identifiers on which data is available.
        !          1667:
        !          1668: @item
        !          1669: If all the processes in @var{nlist} are running, it blocks until
        !          1670: one of the processes returns data. If @var{timeout} is specified,
        !          1671: it waits for only @var{timeout} seconds.
        !          1672:
        !          1673: @item
        !          1674: By sending @code{SM_popCMO} or @code{SM_popSerializedLocalObject} with
        !          1675: @code{ox_push_cmd()} in advance and by examining the process status with
        !          1676: @code{ox_select()}, one can avoid a hanging up caused by @code{ox_pop_local()}
        !          1677: or @code{ox_pop_cmo()}. In such a case, data can be received by
        !          1678: @code{ox_get()}.
        !          1679: \E
1.1       noro     1680: @end itemize
                   1681:
                   1682: @example
                   1683: ox_launch();
                   1684: 0
                   1685: [220] ox_launch();
                   1686: 1
                   1687: [221] ox_launch();
                   1688: 2
                   1689: [222] ox_rpc(2,"fctr",x^500-y^500);
                   1690: 0
                   1691: [223] ox_rpc(1,"fctr",x^100-y^100);
                   1692: 0
                   1693: [224] ox_rpc(0,"fctr",x^10-y^10);
                   1694: 0
                   1695: [225] P=[0,1,2];
                   1696: [0,1,2]
                   1697: [226] map(ox_push_cmd,P,258);
                   1698: [0,0,0]
                   1699: [227] ox_select(P);
                   1700: [0]
                   1701: [228] ox_get(0);
                   1702: [[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1],
                   1703: [x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
                   1704: @end example
                   1705:
                   1706: @table @t
1.2     ! noro     1707: \JP @item $B;2>H(B
        !          1708: \EG @item References
        !          1709: @fref{ox_pop_cmo ox_pop_local}, @fref{ox_push_cmd ox_sync}, @fref{ox_get}
1.1       noro     1710: @end table
                   1711:
1.2     ! noro     1712: \JP @node ox_flush ,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1713: \EG @node ox_flush ,,, Functions for distributed computation
1.1       noro     1714: @subsection @code{ox_flush}
                   1715: @findex ox_flush
                   1716:
                   1717: @table @t
                   1718: @item ox_flush(@var{id})
1.2     ! noro     1719: \JP :: $BAw?.%P%C%U%!$N6/@)(B flush
        !          1720: \EG :: Flushes the sending buffer.
1.1       noro     1721: @end table
                   1722:
                   1723: @table @var
                   1724: @item return
                   1725: 1
                   1726: @item id
1.2     ! noro     1727: \JP $B;R%W%m%;%9<1JL;R(B
        !          1728: \EG process identifier
1.1       noro     1729: @end table
                   1730:
                   1731: @itemize @bullet
1.2     ! noro     1732: \BJP
1.1       noro     1733: @item $BDL>o$O%P%C%A%b!<%I$O(B off $B$G$"$j(B, $B%G!<%?(B, $B%3%^%s%IAw?.$4$H$K(B
                   1734: $BAw?.%P%C%U%!$O(B flush $B$5$l$k(B.
1.2     ! noro     1735:
1.1       noro     1736: @item $B%P%C%A%b!<%I$O(B @code{"ctrl"} $B%3%^%s%I$N(B @code{"ox_batch"} $B%9%$%C%A(B
                   1737: $B$G(B on/off $B$G$-$k(B.
1.2     ! noro     1738:
1.1       noro     1739: @item $B:Y$+$$%G!<%?$rB??tAw$k>l9g$K(B, @code{ctrl("ox_batch",1)}
                   1740: $B$G%P%C%A%b!<%I$r(B on $B$K$9$k$H(B, $B%P%C%U%!$,$$$C$Q$$$K$J$C$?>l9g$K$N$_(B flush
                   1741: $B$5$l$k$?$a(B, overhead $B$,>.$5$/$J$k>l9g$,$"$k(B. $B$?$@$7$3$N>l9g$K$O(B, $B:G8e$K(B
                   1742: @code{ox_flush(@var{id})} $B$r<B9T$7$F(B, $B%P%C%U%!$r6/@)E*$K(B flush $B$9$kI,MW$,(B
                   1743: $B$"$k(B.
1.2     ! noro     1744:
1.1       noro     1745: @item @code{ox_pop_cmo}, @code{ox_pop_local} $B$N$h$&$K(B, $B%3%^%s%IAw?.8e(B
                   1746: $B$?$@$A$K%G!<%?BT$A$KF~$k4X?t$,%O%s%0$7$J$$$h$&(B, $B$3$l$i$N4X?t$NFbIt$G$O(B
                   1747: $B6/@)(B flush $B$,<B9T$5$l$F$$$k(B.
1.2     ! noro     1748: \E
        !          1749:
        !          1750: \BEG
        !          1751: @item
        !          1752: By default the batch mode is off and the sending buffer is flushed
        !          1753: at every sending operation of data and command.
        !          1754:
        !          1755: @item
        !          1756: The batch mode is set by @code{"ox_batch"} switch of @code{"ctrl"}.
        !          1757:
        !          1758: @item
        !          1759: If one wants to send many pieces of small data,
        !          1760: @code{ctrl("ox_batch",1)} may decrease the overhead of flush operations.
        !          1761: Of course, one has to call @code{ox_flush(@var{id})} at the end of
        !          1762: the sending operations.
        !          1763:
        !          1764: @item
        !          1765: Functions such as @code{ox_pop_cmo} and @code{ox_pop_local}
        !          1766: enter a waiting mode immediately after sending a command.
        !          1767: These functions always flush the sending buffer.
        !          1768: \E
1.1       noro     1769: @end itemize
                   1770:
                   1771: @example
                   1772: [340] ox_launch_nox();
                   1773: 0
                   1774: [341] cputime(1);
                   1775: 0
                   1776: 7e-05sec + gc : 4.8e-05sec(0.000119sec)
                   1777: [342] for(I=0;I<10000;I++)ox_push_cmo(0,I);
                   1778: 0.232sec + gc : 0.006821sec(0.6878sec)
                   1779: [343] ctrl("ox_batch",1);
                   1780: 1
                   1781: 4.5e-05sec(3.302e-05sec)
                   1782: [344] for(I=0;I<10000;I++)ox_push_cmo(0,I); ox_flush(0);
                   1783: 0.08063sec + gc : 0.06388sec(0.4408sec)
                   1784: [345] 1
                   1785: 9.6e-05sec(0.01317sec)
                   1786: @end example
                   1787:
                   1788: @table @t
1.2     ! noro     1789: \JP @item $B;2>H(B
        !          1790: \EG @item References
        !          1791: @fref{ox_pop_cmo ox_pop_local}, @fref{ctrl}
1.1       noro     1792: @end table
                   1793:
1.2     ! noro     1794: \JP @node ox_get_serverinfo ,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1795: \EG @node ox_get_serverinfo ,,, Functions for distributed computation
1.1       noro     1796: @subsection @code{ox_get_serverinfo}
                   1797: @findex ox_get_serverinfo
                   1798:
                   1799: @table @t
                   1800: @item ox_get_serverinfo([@var{id}])
1.2     ! noro     1801: \JP :: server $B$N(B Mathcap, $BF0:nCf$N%W%m%;%9<1JL;R$N<hF@(B
        !          1802: \EG :: Gets server's mathcap and proess id.
1.1       noro     1803: @end table
                   1804:
                   1805: @table @var
                   1806: @item return
1.2     ! noro     1807: \JP $B%j%9%H(B
        !          1808: \EG list
1.1       noro     1809: @item id
1.2     ! noro     1810: \JP $B;R%W%m%;%9<1JL;R(B
        !          1811: \EG process identifier
1.1       noro     1812: @end table
                   1813:
                   1814: @itemize @bullet
1.2     ! noro     1815: \BJP
1.1       noro     1816: @item $B0z?t(B @var{id} $B$,$"$k$H$-(B, $B%W%m%;%9<1JL;R(B @var{id} $B$N%W%m%;%9$N(B
                   1817: Mathcap $B$r%j%9%H$H$7$FJV$9(B.
                   1818: @item $B0z?t$J$7$N$H$-(B, $B8=:_F0:nCf$N%W%m%;%9<1JL;R$*$h$S$=$N(B Mathcap $B$+$i(B
                   1819: $B$J$k%Z%"$r(B, $B%j%9%H$H$7$FJV$9(B.
1.2     ! noro     1820: \E
        !          1821: \BEG
        !          1822: @item If @var{id} is specified, the mathcap of the process whose
        !          1823: identifier is @var{id} is returned.
        !          1824: @item If @var{id} is not specified, the list of @var{[id,Mathcap]}
        !          1825: is returned, where @var{id} is the identifier of a currently active process,
        !          1826: and @var{Mathcap} is the mathcap of the process.
        !          1827: identifier @var{id} is returned.
        !          1828: \E
1.1       noro     1829: @end itemize
                   1830:
                   1831: @example
                   1832: [343] ox_get_serverinfo(0);
                   1833: [[199909080,Ox_system=ox_sm1.plain,Version=2.991118,HOSTTYPE=FreeBSD],
                   1834: [262,263,264,265,266,268,269,272,273,275,276],
                   1835: [[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27,33,40,16,34]]]
                   1836: [344] ox_get_serverinfo();
                   1837: [[0,[[199909080,Ox_system=ox_sm1.plain,Version=2.991118,HOSTTYPE=FreeBSD],
                   1838: [262,263,264,265,266,268,269,272,273,275,276],
                   1839: [[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27,33,40,16,34]]]],
                   1840: [1,[[199901160,ox_asir],
                   1841: [276,275,258,262,263,266,267,268,274,269,272,265,264,273,300,270,271],
                   1842: [[514,2144202544],
                   1843: [1,2,3,4,5,2130706433,2130706434,17,19,20,21,22,24,25,26,31,27,33,60],[0,1]]]]]
                   1844: @end example
                   1845:
                   1846: @table @t
1.2     ! noro     1847: \JP @item $B;2>H(B
        !          1848: \EG @item References
        !          1849: @fref{Mathcap}.
1.1       noro     1850: @end table
                   1851:
1.2     ! noro     1852: \JP @node ifplot conplot plot plotover,,, $BJ,;67W;;$K4X$9$k4X?t(B
        !          1853: \EG @node ifplot conplot plot plotover,,, Functions for distributed computation
1.1       noro     1854: @subsection @code{ifplot}, @code{conplot}, @code{plot}, @code{plotover}
                   1855: @findex ifplot
                   1856: @findex conplot
                   1857: @findex plot
                   1858: @findex plotover
                   1859:
                   1860: @table @t
                   1861: @item ifplot(@var{func} [,@var{geometry}] [,@var{xrange}] [,@var{yrange}] [,@var{id}] [,@var{name}])
1.2     ! noro     1862: \JP :: 2 $BJQ?t4X?t$N<B?t>e$G$NNmE@$rI=<($9$k(B.
        !          1863: \EG :: Displays real zeros of a bi-variate function.
1.1       noro     1864: @item conplot(@var{func} [,@var{geometry}] [,@var{xrange}] [,@var{yrange}] [,@var{zrange}] [,@var{id}] [,@var{name}])
1.2     ! noro     1865: \JP :: 2 $BJQ?t4X?t$N<B?t>e$G$NEy9b@~$rI=<($9$k(B.
        !          1866: \EG :: Displays real contour lines of a bi-variate function.
1.1       noro     1867: @item plot(@var{func} [,@var{geometry}] [,@var{xrange}] [,@var{id}] [,@var{name}])
1.2     ! noro     1868: \JP :: 1 $BJQ?t4X?t$N%0%i%U$rI=<($9$k(B.
        !          1869: \EG :: Displays the graph of a univariate function.
1.1       noro     1870: @item plotover(@var{func},@var{id},@var{number})
1.2     ! noro     1871: \JP :: $B$9$G$KB8:_$7$F$$$k%&%#%s%I%&$XIA2h$9$k(B.
        !          1872: \EG Plots on the existing window real zeros of a bivariate function.
1.1       noro     1873: @end table
                   1874:
                   1875: @table @var
                   1876: @item return
1.2     ! noro     1877: \JP $B@0?t(B
        !          1878: \EG integer
1.1       noro     1879: @item func
1.2     ! noro     1880: \JP $BB?9`<0(B
        !          1881: \EG polynomial
1.1       noro     1882: @item geometry, xrange, yrange, zrange
1.2     ! noro     1883: \JP $B%j%9%H(B
        !          1884: \EG list
1.1       noro     1885: @item id, number
1.2     ! noro     1886: \JP $B@0?t(B
        !          1887: \EG integer
1.1       noro     1888: @item name
1.2     ! noro     1889: \JP $BJ8;zNs(B
        !          1890: \EG string
1.1       noro     1891: @end table
                   1892:
                   1893: @itemize @bullet
1.2     ! noro     1894: \BJP
1.1       noro     1895: @item
                   1896: @code{ifplot()} $B$O(B, 2 $BJQ?t4X?t(B @var{func} $B$N<B?t>e$G$NNmE@$N(B
                   1897: $B%0%i%U$NI=<($r9T$&(B. @code{conplot()} $B$O(B, $BF1MM$N0z?t$KBP$7(B,
                   1898: $BEy9b@~$NI=<($r9T$&(B. @code{plot()} $B$O(B 1 $BJQ?t4X?t$N(B
                   1899: $B%0%i%U$NI=<($r9T$&(B. Windows $BHG$O8=>u$G$OL$%5%]!<%H$G$"$k(B.
1.2     ! noro     1900:
1.1       noro     1901: @item
                   1902: UNIX $BHG$O(B, $B1s3V%W%m%;%9$K$h$j<B8=$5$l$F$$$k(B. $B%3%^%s%I$O(B @samp{ox_plot}
                   1903: $B$G(B, @code{ox_launch()} $B$K$h$j5/F0$7$F$*$/I,MW$,$"$k(B. @samp{ox_plot}
                   1904: $B$O(B, @b{Asir} $B$NI8=`%i%$%V%i%j%G%#%l%/%H%j$K$"$k(B.
1.2     ! noro     1905:
1.1       noro     1906: @item
                   1907: $B0z?t$NFb(B, @var{func} $B$OI,?\$G$"$k(B. $B$=$NB>$N0z?t$O%*%W%7%g%s$G$"$k(B.
                   1908: $B%*%W%7%g%s$N7A<0$*$h$S$=$N%G%U%)%k%HCM(B ($B%+%C%3Fb(B) $B$O<!$NDL$j(B.
1.2     ! noro     1909:
1.1       noro     1910: @table @var
                   1911: @item geometry
                   1912: $B%&%#%s%I%&$N%5%$%:$r%I%C%HC10L$G(B @var{[x,y]} $B$G;XDj$9$k(B.
                   1913: (UNIX $BHG$G$O(B @var{[}@code{300},@code{300}@var{]}. )
1.2     ! noro     1914:
1.1       noro     1915: @item xrange, yrange
                   1916: $BJQ?t$NHO0O$N;XDj$G(B, @var{[v,vmin,vmax]} $B$G;XDj$9$k(B.
                   1917: ($B$$$:$l$NJQ?t$b(B @var{[v},@code{-2},@code{2}@var{]}.)
                   1918: $B$3$N;XDj$,$J$$>l9g(B, @var{func} $B$K4^$^$l$kJQ?t$NFbJQ?t=g=x$N>e$NJQ?t(B
                   1919: $B$,(B @samp{x}, $B2<$NJQ?t$,(B @samp{y} $B$H$7$F07$o$l$k(B. $B$3$l$rHr$1$k$?$a$K$O(B
                   1920: @var{xrange}, @var{yrange} $B$r;XDj$9$k(B. $B$^$?(B, @var{func} $B$,(B 1 $BJQ?t$N(B
                   1921: $B>l9g(B, $B$3$l$i$N;XDj$OI,?\$H$J$k(B.
1.2     ! noro     1922:
1.1       noro     1923: @item zrange
                   1924: @code{conplot()} $B$N>l9g$N$_;XDj$G$-$k(B. $B7A<0$O(B
                   1925: @var{[v,vmin,vmax} @code{[},@var{step} @code{]}@var{]} $B$G(B, @var{step} $B$,;XDj$5$l(B
                   1926: $B$?>l9g$K$O(B, $BEy9b@~$N4V3V$,(B @var{(vmax-vmin)/step} $B$H$J$k(B.
                   1927: (@var{[z},@code{-2},@code{2},@code{16}@var{]}.)
1.2     ! noro     1928:
1.1       noro     1929: @item id
                   1930: $B1s3V%W%m%;%9$NHV9f(B, $B$9$J$o$A(B @code{ox_launch()} $B$,JV$7$?HV9f$r;XDj$9$k(B.
                   1931: ($B0lHV:G6a$K:n$i$l(B, $B$+$D%"%/%F%#%V$J%W%m%;%9$KBP1~$9$kHV9f(B.)
1.2     ! noro     1932:
1.1       noro     1933: @item name
                   1934: $B%&%#%s%I%&$NL>A0(B. (@code{Plot}.)
                   1935: $B@8@.$5$l$?%&%#%s%I%&$N%?%$%H%k$O(B @var{name:n/m} $B$H$J$k(B.
                   1936: $B$3$l$O(B, $B%W%m%;%9HV9f(B @var{n} $B$N%W%m%;%9$N(B, @var{m} $BHV$N%&%#%s%I%&$r0UL#$9$k(B.
                   1937: $B$3$NHV9f$O(B, @code{plotover()} $B$GMQ$$$i$l$k(B.
                   1938: @end table
1.2     ! noro     1939:
1.1       noro     1940: @item
                   1941: $B0l$D$N%W%m%;%9>e$GIA2h$G$-$k%&%#%s%I%&$N?t$O:GBg(B 128 $B8D$G$"$k(B.
1.2     ! noro     1942:
1.1       noro     1943: @item
                   1944: @code{plotover()} $B$O(B, $B;XDj$7$?%&%#%s%I%&>e$K(B, $B0z?t$G$"$k(B 2 $BJQ?tB?9`<0$N(B
                   1945: $BNmE@$r>e=q$-$9$k(B.
                   1946:
                   1947: @item
                   1948: $BIA2h=*N;8e$N%&%#%s%I%&>e$G(B, $B%^%&%9$N:8%\%?%s$r2!$7$J$,$i$N%I%i%C%0(B
                   1949: $B$GHO0O$r;XDj$7%\%?%s$rN%$9$H?7$?$J%&%#%s%I%&$,@8@.$5$l(B, $B;XDj$7$?(B
                   1950: $BHO0O$,3HBg$7$FI=<($5$l$k(B. $B%I%i%C%0$O:8>e$+$i1&2<$X$H9T$&(B.
                   1951: $B%I%i%C%0$r;O$a$?8e%-%c%s%;%k$9$k>l9g$O(B, $B%^%&%9%]%$%s%?$r;OE@$N>e$+(B
                   1952: $B:8$K;}$C$F$$$C$F%\%?%s$rN%$;$P$h$$(B. $B?7$7$$%&%$%s%I%&$N7A$O(B, $B;XDj(B
                   1953: $BNN0h$HAj;w$G(B, $B:GBgJU$,(B, $B85$N%&%#%s%I%&$N:GBgJU$H0lCW$9$k$h$&$K(B
                   1954: $BDj$a$i$l$k(B. $B0J2<$G@bL@$9$k(B @code{precise} $B$,(B on $B$N>l9g(B,
                   1955: $BA*Br$7$?NN0h$,F10l(B window $B>e$G=q$-D>$5$l$k(B.
                   1956:
                   1957: @item
                   1958: $B%&%#%s%I%&Fb$G1&%\%?%s$r2!$9$H(B, $B$=$NE@$N:BI8$,%&%#%s%I%&$N2<It$KI=<($5$l$k(B.
                   1959:
                   1960: @item
                   1961: @code{conplot()} $B$G@8@.$7$?%&%#%s%I%&$K$*$$$F(B, $B%&%#%s%I%&$N1&B&$N%^!<%+$r(B
                   1962: $BCf%\%?%s$G%I%i%C%0$9$k$H(B, $BBP1~$9$kEy9b@~$N?'$,JQ$o$j(B, $B1&>e$N(B
                   1963: $B%&%#%s%I%&$KBP1~$9$k%l%Y%k$,I=<($5$l$k(B.
                   1964:
                   1965: @item
1.2     ! noro     1966: UNIX $BHG$G$O$$$/$D$+$N%\%?%s$K$h$j(B
1.1       noro     1967: $B$$$/$D$+$N@_DjJQ99(B, $BA`:n$,$G$-$k(B. UNIX $BHG$G$O<!$N%\%?%s$,$"$k(B.
                   1968:
                   1969: @table @code
                   1970: @item quit
                   1971: window $B$rGK2u$9$k(B. $B7W;;$rCfCG$9$k>l9g(B, @code{ox_reset()} $B$rMQ$$$k(B.
1.2     ! noro     1972:
1.1       noro     1973: @item wide ($B%H%0%k(B)
                   1974: $B8=:_$NI=<(ItJ,$r=D2#3F(B 10 $BG\$7$?NN0h$rI=<($9$k(B. $B8=:_I=<($5$l$F$$$kHO0O$O(B
                   1975: $B$3$NI=<($K$*$$$FCf1{It$KD9J}7A$G<($5$l$k(B. $B$3$NI=<($GHO0O;XDj$r9T$&$H(B,
                   1976: $B$=$NHO0O$,?7$7$$%&%#%s%I%&$KIA2h$5$l$k(B.
1.2     ! noro     1977:
1.1       noro     1978: @item precise ($B%H%0%k(B)
                   1979: $BA*BrNN0h$r(B, $B@0?t1i;;$K$h$j(B, $B$h$j@53N$K:FIA2h$9$k(B. $B$3$l$O(B, @var{func} $B$,(B
                   1980: $BM-M}?t78?t$N(B 2 $BJQ?tB?9`<0$N>l9g$K$N$_M-8z$G$"$k(B. $B$3$N%b!<%I$G$O(B Sturm $BNs(B
                   1981: $B$HFsJ,K!$K$h$j(B, $B6h4VFb$NNmE@$N8D?t$r@53N$K5a$a$F$$$/$b$N$G(B, $B%G%U%)%k%H$N(B
                   1982: $B7W;;K!$h$j$b@53N$JIA2h$,4|BT$G$-$k(B. $B$?$@$7(B, $BIA2h;~4V$OM>7W$K$+$+$k>l9g$,(B
                   1983: $BB?$$(B. $B$3$N@bL@$+$iL@$i$+$J$h$&$K(B, $B$3$N5!G=$OM-M}?t78?t$NB?9`<0$NIA2h$KBP(B
                   1984: $B$7$F$N$_M-8z$G$"$k(B. ((x^2+y^2-1)^2 $B$NIA2h$G;n$7$F$_$h(B.)
                   1985:
                   1986: @item formula
                   1987: $BBP1~$9$k<0$rI=<($9$k(B.
1.2     ! noro     1988:
1.1       noro     1989: @item noaxis ($B%H%0%k(B)
                   1990: $B:BI8<4$r>C$9(B.
                   1991: @end table
                   1992:
                   1993: @item
                   1994: @samp{ox_plot} $B$,5/F0$5$l$k%^%7%s$K$h$C$F$O(B, $B%9%?%C%/$rBgNL$K;HMQ$9$k(B
                   1995: $B$b$N$b$"$k$?$a(B, @samp{.cshrc} $B$G%9%?%C%/%5%$%:$rBg$-$a(B (16MB $BDxEY(B) $B$K(B
                   1996: $B;XDj$7$F$*$/$N$,0BA4$G$"$k(B. $B%9%?%C%/%5%$%:$O(B @code{limit stacksize 16m}
                   1997: $B$J$I$H;XDj$9$k(B.
                   1998:
                   1999: @item
                   2000: @code{X} $B$G$O!"%&%$%s%I%&$N3FItJ,$K$D$$$F(B resource $B$K$h$j(B
                   2001: $B?'IU$1$d!"%\%?%s$N7A$rJQ$($k$3$H$,$G$-$k!#(B
                   2002: resource $B$N;XDj$N;EJ}$O0J2<$NDL$j!#!J%G%U%)%k%H$r<($7$F$*$/!K(B
                   2003: @code{plot*form*shapeStyle} $B$O!"(B@t{rectangle, oval, ellipse, roundedRectangle}
                   2004: $B$,!";XDj$G$-$k!#(B
1.2     ! noro     2005: \E
        !          2006: \BEG
        !          2007: @item
        !          2008: Function @code{ifplot()} draws a graph of real zeros of a bi-variate
        !          2009: function.
        !          2010: Function @code{conplot()} plots the contour lines for a same argument.
        !          2011: Function @code{plot()} draws the graph of a uninivariate function.
        !          2012: These functions are available on UNIX version (on @code{X11}).
        !          2013:
        !          2014: @item
        !          2015: The plotting functions for UNIX version are realized on remote process
        !          2016: facilities described previously.
        !          2017: The command for this is  @samp{ox_plot} in @b{Asir} root directory.
        !          2018: Of course, it must be activated by @code{ox_launch()}.
        !          2019:
        !          2020: @item
        !          2021: Argument @var{func} is indispensable. Other arguments are optional.
        !          2022: The format of optional arguments and their default values (parenthesized)
        !          2023: are listed below.
        !          2024:
        !          2025: @table @var
        !          2026: @item geometry
        !          2027: Window size is specified by @var{[x,y]} in unit `dot.'
        !          2028: (@var{[}@code{300},@code{300}@var{]} for UNIX version;
        !          2029:
        !          2030: @item xrange, yrange
        !          2031: Value ranges of the variables are specified by @var{[v,vmin,vmax]}.
        !          2032: (@var{[v},@code{-2},@code{2}@var{]} for each variable.)
        !          2033: If this specification is omitted, the indeterminate having the higher
        !          2034: order in @var{func} is taken for @samp{x} and the one with lower order
        !          2035: is taken for @samp{y}.  To change this selection, specify explicitly
        !          2036: by @var{xrange} and/or @var{yrange}.
        !          2037: For an uni-variate function, the specification is mandatory.
        !          2038:
        !          2039: @item zrange
        !          2040: This specification applies only to @code{conplot()}.  The format is
        !          2041: @var{[v,vmin,vmax} @code{[},@var{step} @code{]}@var{]}.
        !          2042: If @var{step} is specified, the height difference of contours is set to
        !          2043: @var{(vmax-vmin)/step}.
        !          2044: (@var{[z},@code{-2},@code{2},@code{16}@var{]}.)
        !          2045:
        !          2046: @item id
        !          2047: This specifies the number of the remote process by which you wish
        !          2048: to draw a graph.
        !          2049: (The number for the newest active process.)
        !          2050:
        !          2051: @item name
        !          2052: The name of the window.
        !          2053: (@code{Plot}.)
        !          2054: The created window is titled @var{name:n/m} which means the @var{m}-th
        !          2055: window of the process with process number @var{n}.
        !          2056: These numbers are used for @code{plotover()}.
        !          2057: @end table
        !          2058:
        !          2059: @item
        !          2060: The maximum number of the windows that can be created on a process is
        !          2061: 128.
        !          2062:
        !          2063: @item
        !          2064: Function @code{plotover()} superposes reals zeros of its argument
        !          2065: bi-variate function onto the specified window.
        !          2066:
        !          2067: @item
        !          2068: Enlarged plot can be obtained for rectangular area which is specified,
        !          2069: on an already existing window with a graph,
        !          2070: by dragging cursor with the left button of mouse
        !          2071: from the upper-left corner to lower-right corner
        !          2072: and then releasing it.
        !          2073: Then, a new window is created whose shape is similar to the specified
        !          2074: area and whose size is determined so that the largest
        !          2075: side of the new window has the same size of the largest side of
        !          2076: the original window.
        !          2077: If you wish to cancel the action, drag the cursor to any point
        !          2078: above or left of the starting point.
        !          2079:
        !          2080: This facility is effective when @code{precise} button switch is
        !          2081: inactive.  If @code{precise} is selected and active, the area specified
        !          2082: by the cursor dragging will be rewritten on the same window. This
        !          2083: will be explained later.
        !          2084: @item
        !          2085: A click of the right button will display the current coordinates of
        !          2086: the cursor at the bottom area of the window.
        !          2087:
        !          2088: @item
        !          2089: Place the cursor at any point in the right marker area on
        !          2090: a window created by @code{conplot()},
        !          2091: and drag the cursor with the middle mutton.  Then you will find the contour lines changing
        !          2092: their colors depending on the movement of the cursor and the
        !          2093: corresponding height level displayed on the upper right corner of
        !          2094: the window.
        !          2095:
        !          2096: @item
        !          2097: Several operations are available on the window: by button operations
        !          2098: for UNIX version, and pull-down menus for Macintosh version.
        !          2099:
        !          2100: @table @code
        !          2101: @item quit
        !          2102: Destroys (kills) the window.  While computing, quit the current
        !          2103: computation.
        !          2104: If one wants to interrupt the computation, use @code{ox_reset()}.
        !          2105:
        !          2106: @item wide (toggle)
        !          2107: Will display, on the same window, a new area enlarged by 10 times
        !          2108: as large as the current area for both width-direction and
        !          2109: height-direction.  The current area will be indicated by a rectangle
        !          2110: placed at the center.  Area specification by dragging the cursor will
        !          2111: create a new window with a plot of the graph in the specified area.
        !          2112: @item precise (toggle)
        !          2113: When selected and active,
        !          2114: @code{ox_plot} redraws the specified area more precisely by integer
        !          2115: arithmetic.
        !          2116: This mode uses bisection method based on Sturm sequence computation to
        !          2117: locate real zeros precisely.  More precise plotting can be expected
        !          2118: by this technique than by the default plotting technique, at the expense
        !          2119: of significant increase of computing time.  As you see by above
        !          2120: explanation, this function is only effective to polynomials with
        !          2121: rational coefficients.
        !          2122: (Check how they differ for (x^2+y^2-1)^2.)
        !          2123:
        !          2124: @item formula
        !          2125: Displays the expression for the graph.
        !          2126:
        !          2127: @item noaxis (toggle)
        !          2128: Erase the coordinates.
        !          2129: @end table
        !          2130:
        !          2131: @item
        !          2132: Program @samp{ox_plot} may consume much stack space depending on
        !          2133: which machine it is running.
        !          2134: You are recommended to set the stack size to about 16MB as large
        !          2135: in @samp{.cshrc} for safe.
        !          2136: To specify the size, put @code{limit stacksize 16m} for an example.
        !          2137:
        !          2138: @item
        !          2139: You can customize various resources of a window on @code{X}, e.g.,
        !          2140: coloring, shape of buttons etc.
        !          2141: The default setting of resources is shown below.
        !          2142: For @code{plot*form*shapeStyle} you can select among
        !          2143: @t{rectangle}, @t{oval}, @t{ellipse}, and @t{roundedRectangle}.
        !          2144: \E
        !          2145:
1.1       noro     2146: @example
                   2147: plot*background:white
                   2148: plot*form*shapeStyle:rectangle
                   2149: plot*form*background:white
                   2150: plot*form*quit*background:white
                   2151: plot*form*wide*background:white
                   2152: plot*form*precise*background:white
                   2153: plot*form*formula*background:white
                   2154: plot*form*noaxis*background:white
                   2155: plot*form*xcoord*background:white
                   2156: plot*form*ycoord*background:white
                   2157: plot*form*level*background:white
                   2158: plot*form*xdone*background:white
                   2159: plot*form*ydone*background:white
                   2160: @end example
                   2161: @end itemize
                   2162:
                   2163: @example
                   2164: @end example
                   2165:
                   2166: @table @t
1.2     ! noro     2167: \JP @item $B;2>H(B
        !          2168: \EG @item References
        !          2169: @fref{ox_launch ox_launch_nox ox_shutdown}, @fref{ox_reset register_handler}
1.1       noro     2170: @end table

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