=================================================================== RCS file: /home/cvs/OpenXM/doc/ascm2001p/homogeneous-network.tex,v retrieving revision 1.2 retrieving revision 1.7 diff -u -p -r1.2 -r1.7 --- OpenXM/doc/ascm2001p/homogeneous-network.tex 2001/06/20 01:43:12 1.2 +++ OpenXM/doc/ascm2001p/homogeneous-network.tex 2001/06/20 05:42:47 1.7 @@ -1,16 +1,57 @@ -% $OpenXM: OpenXM/doc/ascm2001p/homogeneous-network.tex,v 1.1 2001/06/19 07:32:58 noro Exp $ +% $OpenXM: OpenXM/doc/ascm2001p/homogeneous-network.tex,v 1.6 2001/06/20 03:18:21 noro Exp $ \subsection{Distributed computation with homogeneous servers} \label{section:homog} One of the aims of OpenXM is a parallel speedup by a distributed computation -with homogeneous servers. As the current specification of OpenXM does -not include communication between servers, one cannot expect -the maximal parallel speedup. However it is possible to execute -several types of distributed computation as follows. +with homogeneous servers. Let us see some examples. +%As the current specification of OpenXM does +%not include communication between servers, one cannot expect +%the maximal parallel speedup. However it is possible to execute +%several types of distributed computation as follows. +\subsubsection{Competitive distributed computation by various strategies} + +SINGULAR \cite{Singular} implements {\it MP} interface for distributed +computation and a competitive Gr\"obner basis computation is +illustrated as an example of distributed computation by the MP interface. +Such a distributed computation is also possible on OpenXM. + +\begin{verbatim} +extern Proc1,Proc2$ Proc1 = -1$ Proc2 = -1$ +/* G:set of polys; V:list of variables */ +/* Mod: the Ground field GF(Mod); O:type of order */ +def dgr(G,V,Mod,O) +{ + /* invoke servers if necessary */ + if ( Proc1 == -1 ) Proc1 = ox_launch(); + if ( Proc2 == -1 ) Proc2 = ox_launch(); + P = [Proc1,Proc2]; + map(ox_reset,P); /* reset servers */ + /* P0 executes Buchberger algorithm over GF(Mod) */ + ox_cmo_rpc(P[0],"dp_gr_mod_main",G,V,0,Mod,O); + /* P1 executes F4 algorithm over GF(Mod) */ + ox_cmo_rpc(P[1],"dp_f4_mod_main",G,V,Mod,O); + map(ox_push_cmd,P,262); /* 262 = OX_popCMO */ + F = ox_select(P); /* wait for data */ + /* F[0] is a server's id which is ready */ + R = ox_get(F[0]); + if ( F[0] == P[0] ) { Win = "Buchberger"; Lose = P[1]; } + else { Win = "F4"; Lose = P[0]; } + ox_reset(Lose); /* reset the loser */ + return [Win,R]; +} +\end{verbatim} +In the above Asir program, the client creates two servers and it requests +Gr\"obner basis computations by the Buchberger algorithm +and the $F_4$ algorithm to the servers for the same input. +The client watches the streams by {\tt ox\_select()} +and the result which is returned first is taken. Then the remaining +server is reset. + \subsubsection{Nesting of client-server communication} +%%Prog: load ("dfff"); df_demo(); enter 100. Under OpenXM-RFC 100 an OpenXM server can be a client of other servers. Figure \ref{tree} illustrates a tree-like structure of an OpenXM client-server communication. @@ -90,9 +131,9 @@ algorithms whose task can be divided into subtasks rec % } %} %\end{verbatim} - +% A typical example is a parallelization of the Cantor-Zassenhaus -algorithm for polynomial factorization over finite fields. +algorithm for polynomial factorization over finite fields, which is a recursive algorithm. At each level of the recursion, a given polynomial can be divided into two non-trivial factors with some probability by using @@ -110,7 +151,7 @@ itself. % if ( N == E ) return [F]; % M = field_order_ff(); K = idiv(N,E); L = [F]; % while ( 1 ) { -% /* gererate a random polynomial */ +% /* generate a random polynomial */ % W = monic_randpoly_ff(2*E,V); % /* compute a power of the random polynomial */ % T = generic_pwrmod_ff(W,F,idiv(M^E-1,2)); @@ -209,7 +250,7 @@ work well on OpenXM. %Such a distributed computation is also possible on OpenXM as follows: % %The client creates two servers and it requests -%Gr\"obner basis comutations from the homogenized input and the input itself +%Gr\"obner basis computations from the homogenized input and the input itself %to the servers. %The client watches the streams by {\tt ox\_select()} %and the result which is returned first is taken. Then the remaining