version 1.6, 2003/12/12 01:54:05 |
version 1.7, 2003/12/12 06:05:21 |
|
|
% $OpenXM: OpenXM/doc/Papers/rims-2003-12-16-ja-ohp.tex,v 1.5 2003/12/12 01:30:45 takayama Exp $ |
% $OpenXM: OpenXM/doc/Papers/rims-2003-12-16-ja-ohp.tex,v 1.6 2003/12/12 01:54:05 noro Exp $ |
%% xdvi -paper a4r rims-2003-12-16-ja-ohp |
%% xdvi -paper a4r rims-2003-12-16-ja-ohp |
%% dvips -f -t landscape rims-2003-12-16-ja-ohp| psnup -8 -r | lpr -Pxerox6 |
%% dvips -f -t landscape rims-2003-12-16-ja-ohp| psnup -8 -r | lpr -Pxerox6 |
%% dvipdfm -l rims-2003-12-16-ja-ohp |
%% dvipdfm -l rims-2003-12-16-ja-ohp |
Line 564 $Data$ $B$,;XDj$5$l$?>l9g(B, $B%9%?%C%/$K%W%C%7%e$7 |
|
Line 564 $Data$ $B$,;XDj$5$l$?>l9g(B, $B%9%?%C%/$K%W%C%7%e$7 |
|
\newpage |
\newpage |
|
|
\noindent |
\noindent |
\pagetitle{$B%Q%U%)!<%^%s%9(B} |
\pagetitle{$B<B9TNc(B : $B0lJQ?tB?9`<0$N@Q(B (master $BB&(B)} |
|
|
|
\begin{verbatim} |
|
def d_mul(F1,F2) |
|
{ |
|
Procs = getopt(proc); |
|
if ( !var(F1) || !var(F2) ) return F1*F2; |
|
NP = length(Procs); |
|
/* $B0z?t$r(B server 0 $B$KAw$k(B */ |
|
ox_push_cmo(0,[F1,F2]); |
|
/* $B3F(B server $B$K(B, server 0 $B$r(B root $B$H$7$F;E;v$r;O$a$k$h$&0MMj(B */ |
|
for ( I = 0; I < NP; I++ ) |
|
ox_cmo_rpc(I,"d_mul_main",0); |
|
/* server 0 $B$+$i7k2L$r<u$1<h$k(B */ |
|
R = ox_pop_cmo(0); |
|
return R; |
|
} |
|
\end{verbatim} |
|
|
|
\newpage |
|
|
|
\noindent |
|
\pagetitle{$B<B9TNc(B : $B0lJQ?tB?9`<0$N@Q(B (server $BB&(B; collective)} |
|
\begin{verbatim} |
|
def d_mul_main(Root) |
|
{ |
|
/* server $B$NAm?t(B, $B<+J,$N(B id $B$rCN$k(B */ |
|
Id = ox_get_rank_102(); NP = Id[0]; Rank = Id[1]; |
|
/* Root $B$K$"$k0z?t$r(B broadcast $B$G6&M-(B */ |
|
Arg = ox_bcast_102(Root); F1 = Arg[0]; F2 = Arg[1]; |
|
L = setup_modarrays(F1,F2,NP); |
|
Marray = L[0]; MIarray = L[1]; M = L[2]; |
|
R = umul_chrem(F1,F2,MIarray[Rank],Marray[Rank],M); |
|
Arg = 0; F1 = 0; F2 = 0; |
|
/* $B3F(B server $B$N7k2L$rB-$79g$o$;$F(B, Root $B$KCV$/(B */ |
|
R = ox_reduce_102(Root,"+",R); |
|
/* Root $B$N$_(B, $B7k2L$r(B normalize $B$9$k(B */ |
|
if ( Rank == Root ) |
|
R = uadj_coef(R%M,M,ishift(M,1)); |
|
return R; |
|
} |
|
\end{verbatim} |
|
|
\rightline{$B3+H/(B: $BLnO$(B} |
\rightline{$B3+H/(B: $BLnO$(B} |
|
|