Annotation of OpenXM/doc/Papers/rims-2003-12-16-ja-ohp.tex, Revision 1.9
1.9 ! noro 1: % $OpenXM: OpenXM/doc/Papers/rims-2003-12-16-ja-ohp.tex,v 1.8 2003/12/12 06:07:02 noro Exp $
1.1 takayama 2: %% xdvi -paper a4r rims-2003-12-16-ja-ohp
3: %% dvips -f -t landscape rims-2003-12-16-ja-ohp| psnup -8 -r | lpr -Pxerox6
1.4 takayama 4: %% dvipdfm -l rims-2003-12-16-ja-ohp
1.1 takayama 5: \documentclass{slides}
6: \usepackage{color}
7: \usepackage{rgb}
8: \usepackage{epsfig}
9: %\def\color#1{ }
10: %\def\epsffile#1{ Picture File: #1 }
11: %\def\epsfxsize{ }
12: %% Sample:
13: %% \epsfxsize=17cm
14: %% \epsffile{cz.ps}
15:
16: \textwidth 9.2in
17: \textheight 7.2in
18: \columnsep 0.33in
19: \topmargin -1in
20:
21: \def\nnn{ {\color{red} $\bullet$}\ } %% $B;v<B(B
22: \def\eee{ {\color{magenta} Example}:\ } %% $BNc(B
23: \def\ttt{ {\color{red} $\bullet$}\ } %% $BDjM}(B
24:
25: \def\pagetitle#1{ \fbox{{\color{magenta} #1 }}}
26:
27: \newenvironment{FRAME}{\begin{trivlist}\item[]
28: \hrule
29: \hbox to \linewidth\bgroup
30: \advance\linewidth by -30pt
31: \hsize=\linewidth
32: \vrule\hfill
33: \vbox\bgroup
34: \vskip15pt
35: \def\thempfootnote{\arabic{mpfootnote}}
36: \begin{minipage}{\linewidth}}{%
37: \end{minipage}\vskip15pt
38: \egroup\hfill\vrule
39: \egroup\hrule
40: \end{trivlist}}
41:
42: \begin{document}
43: \noindent
44: \begin{center}
45: {\color{magenta} OpenXM $B$N?7%5!<%P(B, $B?7%W%m%H%3%k(B}
46: \end{center}
47: %% 2003, 12/16 (Tue),
48: \begin{center}
49: {\color{SlateGray} OpenXM $B3+H/%0%k!<%W(B (committers): http://www.openxm.org }
50: \end{center}
51: \begin{enumerate}
52: \item $B?7$7$$%5!<%P(B ntl
53: \item $B?7$7$$%5!<%P(B polymake $B$H(B oxshell.
54: \item OX-RFC 103 ( 100, 101 $BJd0d(B)
55: \item OX-RFC 102 --- $BK\3JE*$J%5!<%P4VDL?.(B
56: \end{enumerate}
57: \newpage
58:
59: \noindent \quad \\
60: \nnn $B?t3X$G$NJBNs7W;;(B, \\
61: \nnn $B?t3X%=%U%H%&%(%"$NE}9g2=(B $B$^$?$O(B Conglomerate $B2=(B (A.Solomon) \\
62: \nnn $B?t3XE*CN<1$N%^%M!<%8%a%s%H(B (Mathematical Knowledge Management) \\
63: \nnn $B<B:]$K?t3X$N8&5f$d?t3X$N1~MQ$K;H$($k%Q%C%1!<%8$N3+H/(B
64:
65: \noindent \quad \\
66: \nnn OpenXM 1.1.1 (January 24, 2000): $B:G=i$N<B83HG(B. \\
67: \nnn OpenXM 1.1.2 (March 20, 2000): $B$H$j$"$($:;H$($kHG(B. \\
68: \nnn OpenXM 1.1.3 (September 26, 2000): 1.1 $B7O$N:G=*HG(B. OpenXM RFC 100 $B7A<0(B
69: $B$N%W%m%;%9LZ(B. 1077 $B8D$N?t3X4X?t$rDs6!(B.
70: $BDs6!$7$F$$$k%5!<%P$O(B {\tt ox\_asir}, {\tt ox\_sm1},
71: {\tt ox\_phc}, {\tt ox\_gnuplot}, {\tt ox\_m2}, {\tt ox\_tigers},
72: {\tt ox\_math}(ematica), {\tt OMproxy}. \\
73: \nnn OpenXM 1.2.1 (March 2, 2002): Cygwin (Windows) $B$X$NBP1~3+;O(B.
74: $B%^%K%e%"%k<+F0@8@.(B(gentexi)$B$J$I(B. \\
75: \nnn OpenXM 1.2.2 (May 13, 2003): RFC 103 ($BItJ,E*(B), autoconf\\
76: (\nnn) Digital formula book, OpenMath, tfb, CD (hypergeo*, weylalgebra*, intpath*),
77: $B?tCM7W;;(B.
78:
79: \newpage
80:
81: \noindent
82: \pagetitle{ 1. {\color{blue} $B?7$7$$%5!<%P(B ntl}}
83: http://www.shoup.net/ntl,
84: {\footnotesize
85: NTL is a high-performance, portable C++ library providing data structures and algorithms for manipulating signed, arbitrary length integers, and for vectors,
86: matrices, and polynomials over the integers and over finite fields.
87: }
88:
89: {\color{blue} ox\_toolkit $+$ NTL $B%i%$%V%i%j(B}
90: $\Rightarrow$ {\color{red} ox\_ntl}
91: {\footnotesize
92: \begin{verbatim}
93: [1145]= ox_launch_nox(0,"/home/taka/OX4/OpenXM/bin/ox_ntl");
94: [1028] F=ntl.ex_data(4)$
95: [1029] F = F * subst(F, x, x + 1)$
96: [1030] ntl.factor(PID, F); /* NTL $B$N(B knapsac factorizer */
97: [[1,1],
98: [x^16+16*x^15-16*x^14-1344*x^13-4080*x^12+32576*x^11+157376*x^10-255232*x^9-2062624*x^8-249088*x^7+10702080*x^6+9126912*x^5-18643712*x^4-24167424*x^3+2712576*x^2+10653696*x+2324736,1],
99: [x^16-136*x^14+6476*x^12-141912*x^10+1513334*x^8-7453176*x^6+13950764*x^4-5596840*x^2+46225,1]]
100: \end{verbatim}
101: }
102:
103: $B<BAu$K$h$jL@$i$+$K$J$C$?$3$H(B: \\
104: ox\_toolkit $B$NLdBjE@$N2~A1(B, LLL $B$r$h$V$?$a$K(B CMO array $B$bI,MW(B.
105:
106: \rightline{$B3+H/(B: $B4d:,(B ($B>.86(B)}
107: \newpage
108:
109:
110: \noindent
111: \pagetitle{2. {\color{blue} $B?7$7$$%5!<%P(B polymake $B$H(B oxshell}}
112:
113: {\color{red} Polymake } : $BB?LLBNMQ%=%U%H%&%(%"(B. \\
114: {\tt http://www.math.tu-berlin.de/polymake},
115: by Ewgenji Gawrilow, Michael Joswig. \\
116: % polemake logo
117: Facets, Convex hull, Triangulation, $B9=@.(B, polytope data,
118: Visualization by JavaView and Povray.
119:
120: \newpage
121: \eee
122: $BE@(B $(1,0,0)$, $(1,1,0)$, $(1,0,1)$, $(1,1,1)$ $B>e$N(B cone $B$N(B facet $B$r5a$a$h(B. \\
123: {\tt polymake} $B$G$O$D$.$h$&$JF~NO%U%!%$%k(B {\tt square.poly} $B$r$^$::n@.$9$k(B.
124:
1.4 takayama 125: \begin{minipage}{10cm}
126: {\footnotesize \color{blue}
127: \begin{verbatim}
128: POINTS
129: 1 0 0
130: 1 1 0
131: 1 0 1
132: 1 1 1
133: \end{verbatim}
134: }
135: \end{minipage}
136: \epsfxsize=8cm
137: \epsffile{rims-2003-12-16-sq.eps}
1.1 takayama 138:
139: {\color{red} \verb@ polymake square.poly FACETS @ } \\
140: $B7k2L(B:
141: {\footnotesize \begin{verbatim}
142: FACETS
143: 0 0 1
144: 0 1 0
145: 1 0 -1
146: 1 -1 0
147: \end{verbatim} }
148:
149: \newpage
150:
151: \pagetitle{ Polymake $B$N(B OX 100, 101 $B%5!<%P2=$G2?$,LdBj$G$"$C$?$+(B?}
152: %todo OX 100 $B$N35N,$,I,MW$+(B?
153:
154: $B?7$7$$(B OX RFC 100 $B=`5r$N%5!<%P$r:n$k>l9g$K$O(B
155: $B%?!<%2%C%H$H$9$k?t3X%=%U%H%&%(%"%7%9%F%`$N%=!<%9%3!<%I$K(B OX RFC 100 $BBP1~ItJ,(B
156: $B$r2C$($k:n6H$r$7$J$$$H$$$1$J$$(B.
157: $B$3$N:n6H$O%=!<%9%3!<%I$NM}2r$H$+$J$j$N<j4V$rMW$9$k(B.
158: C++ $B$G=q$+$l$?(B polymake $B$N%=!<%9$O@hC<E*$J(B C++ $B$N5!G=$r(B
159: $BMxMQ$7$F$*$j%3%s%Q%$%k$,MF0W$G$J$$(B.
160:
161:
162: Polymake $B$O$"$i$+$8$a%U%!%$%k$K%3%^%s%I$d%G!<%?$r=q$-=P$7$F$*$/$3$H$K$h$j(B
163: unix $B$N(B shell ($B$d(B Windows $B$N%3%^%s%I%W%m%s%W%H(B)
164: $B$+$iMxMQ2DG=$J$h$&$K:n$i$l$F$$$k(B: {\color{red} $B%P%C%A=hM}BP1~%"%W%j%1!<%7%g%s(B}.
165: $B%5!<%P$H$NDL?.$NIQEY$OLdBj$K$h$k$,$"$kDxEYBg$-$$7W;;$N>l9g$ODL?.;~4V$OL5;k$G$-$k(B.
166: Polymake $B$OBPOCE*MxMQ$OA[Dj$7$F$*$i$:%5!<%P$N7W;;$rCfCG$7$F(B, $B:FEY3+;O$9$k$J$I$NI,MW$,$J$$(B.
167: $\Rightarrow$ {\tt system} $B$N6/2=HG(B {\color{blue} oxshell}
168: \newpage
169:
170: \pagetitle{ Oxshell $B$H$O(B }
171: Oxshell $B$O>e5-$N$h$&$J%P%C%A=hM}BP1~%"%W%j%1!<%7%g%s$r%=!<%9%3!<%I$N2~JQ$J$/(B
172: OX RFC 100 $B=`5r$K$9$k$?$a$N$$$o$f$k%i%C%Q!<7?$N(B OX $B%5!<%P$r=q$/$?$a$NJd=u5!G=$r(B
173: $BDs6!$9$k(B sm1 $B$X$NAH$_9~$_4X?t$G$"$k(B.
174:
175: Oxshell $B$rMQ$$$F(B OX $B%5!<%P$r<B8=$9$k$N$,E,@Z$J?t3X%=%U%H%&%(%"$O0J2<$N$h$&$JFCD'$r$b$D$b$N$G$"$m$&(B. \\
176: \nnn $B%P%C%A=hM}BP1~%"%W%j%1!<%7%g%s$G$"$k(B. \\
177: \nnn $B%=!<%9%3!<%I$NJQ99$,$G$-$J$$$+:$Fq(B. \\
178: \nnn $B%5!<%P$H$NDL?.$,IQHK$K$*$-$J$$(B. \\
179: \nnn $B%5!<%P$N7W;;$rCfCG$7$F(B, $B:FEY3+;O$9$k$J$I$NI,MW$,$J$$(B. \\
180: \nnn Windows $B$G$b(B unix $B$G$bF0$+$7$?$$(B. \\
181:
182: \pagetitle{ OX RFC 100 $B$NI|=,(B}
183:
184: $B%/%i%$%"%s%H(B-$B%5!<%P%b%G%k(B.
185: $B%5!<%P$O(B stackmachine.
186: (1) $B%9%?%C%/%^%7%s$X$N%a%C%;!<%8$rAw$k$3$H$K$h$j7W;;$,?J9T$9$k(B.
187: (2) $B7W;;$NCfCG$J$I$N%a%C%;!<%8$b$"$k(B.
188: (3) $B%5!<%P$O%(%s%8%s$H%3%s%H%m!<%k%W%m%;%9$h$j$J$k(B.
189:
190: \newpage
191:
192: \noindent OX RFC 100 $B$K$O(B\underline{$B%U%!%$%k$N35G0$,$J$$(B}. $B$7$?$,$C$F(B, \\
193: \verb@ polymake $B%U%!%$%kL>(B $BF0:n(B @ \\
194: $B$_$?$$$J%W%m%0%i%`$O(B OX $B%9%?%C%/%^%7%s$N>e$N%G!<%?$r%U%!%$%k$K=q$-=P$7$F$+$i(B
195: $B<B9T$7$F(B, $B$=$l$+$i$^$?%9%?%C%/%^%7%s$N>e$N%G!<%?$KJQ49$7$J$$$H$$$1$J$$(B.
196: ($BC1=c;E;v(B, $B$7$+$7(B, ZPG $B$N6KCW(B; unix $B$H(B windows $B0c$$(B,
197: /bin/sh $B$NB8:_(B, $B%W%m%0%i%`$,BgJQFI$_$K$/$/J]<i$b$7$K$/$$(B)
198:
199: {\tt oxshell} $B$G$O$3$N;E;v$O<!$N(B 1 $B9T$G=q$/(B. \\
200: {\color{red} \verb@[(polymake) (stringInOut://$B%9%?%C%/%^%7%sJQ?tL>(B.poly) $BF0:n(B] oxshell@}\\
201: $B%9%?%C%/%^%7%s$NJQ?t$r%U%!%$%k$r$_$J$7$F$$$k(B.
202:
203: $B$3$N$h$&$J9M$(J}$O(B, $B$J$K$b?7$7$$$b$N$G$O$J$$(B. \\
204: $BNc(B: Java $B$N(B io.StringReader ( io.InputStreamReader $B$NBe$o$j(B). \\
205: $BNc(B: $B%9%/%j%W%H8@8l$G$"$k(B Python
206: \verb@ x=os.popen("abc","r").read(); @
207:
208: \noindent
209: {\color{blue} $B?7$7$$ItJ,(B}:
210: $B$3$N9M$($r?t3X%=%U%H%&%(%"$NE}9g2=$N$?$a$K;H$&$?$a$N<BAu$OB8:_$7$F$$$J$+$C$?(B.
211: $B$3$l$,(B oxshell $B%3%^%s%I$NF3F~$K$h$C$F2r7h$5$l$kE@$N0l$D$G$"$k(B.
212: $B9M$(J}$,@0M}$5$l%W%m%0%i%`$NJ]<i@-$,BgJQ$h$/$J$j(B, $B$^$??7$7$$%P%C%A7?%"%W%j%1!<%7%g%s$N(BOX $B%5!<%P2=$,3Z$K$J$C$?(B.
213:
214: \newpage
215:
216: \eee
217: $BJ8;zNs(B {\tt S} $B$K3JG<$5$l$?C18l(B dog, cat, lion $B$r(B unix $B$N%D!<%k(B sort $B$G(B
218: $BJB$YJQ$($k$K$O<!$N$h$&$K=q$/(B.
219: $BF~NO$O(B oxshell $B$r<B9T$7$F$$$k%9%?%C%/%^%7%s$NJQ?t(B {\tt S} $B$K3JG<$5$l$F$$$k(B.
220:
221: \begin{verbatim}
222: [1163]:= S="dog\ncat\nlion\n";
223: [1164]:= oxshell.set_value("S",S);
224: [1165]:= T=oxshell.oxshell(["sort","stringIn://S"]);
225: [cat
226: dog
227: lion
228: ,]
229: \end{verbatim}
230: \newpage
231:
232: \pagetitle{ oxshell.facets() $B$N<BAu(B, $B?t3X4X?t$N<BAuNc(B }
233:
234: \nnn $B%G!<%?JQ49$K$O(B tfb/2 ($BEDB<(B)format $B$rMxMQ(B, OpenMath $B%"!<%-%F%/%A%c$rMxMQ(B.
235: {\color{blue}$B@.2L(B}: $B$=$NM-8z@-$r<B>Z$G$-$?(B.)
236: %% $B$3$l$b?7$7$$E@$G$"$m$&(B.
237: {\footnotesize \begin{verbatim}
238: [ $polymake.data(polymake.POINTS([[1,0,0],[1,1,0],[1,0,1],[1,1,1]]),
239: polymake.FACETS([[0,0,1],[0,1,0],[1,0,-1],[1,-1,0]]),
240: polymake.AFFINE_HULL())$
241: CMO tree expression of the data above
242: Outputs to stdout and stderr ]
243: \end{verbatim} }
244:
245:
246: {\color{red} taka\_ahg.b(A,Idx)}(OpenXM/src/asir-contrib/packages/src/taka\_ahg.rr)
247: oxshell $B$K$h$k(B polymake $B8F$S=P$75!G=$rMQ$$$??t3X4X?t(B.
248: $B$3$N4X?t$O(B $B9TNs(B {\tt A} $B$KIU?o$7$?(B $BJ}8~(B {\tt Idx} $B$N$"$k(B $b$ $B4X?t$r7W;;$9$k(B.
249: $B$3$l$O(B {\tt A} $B$NDj5A$9$k(B cone $B$N%U%!%;%C%H$r$"$i$o$90l<!<0$N@Q$GI=8=$5$l$k$3$H$,(B,
250: $BCN$i$l$F$$$k(B
251: (Saito, Mutsumi; Sturmfels, Bernd; Takayama, Nobuki; Hypergeometric polynomials and integer programming. Compositio Math. 115 (1999), no. 2, 185--204
252: $B$*$h$S(B
253: Saito, Mutsumi; Parameter shift in normal generalized hypergeometric systems. Tohoku Math. J. (2) 44 (1992), no. 4, 523--534
254: $B$r$_$h(B.)
255:
256: \newpage
257:
1.5 takayama 258: \begin{minipage}{13cm}
1.1 takayama 259: {\footnotesize
260: \begin{verbatim}
261: [1163]:= load("oxshell.rr");
262: [1164]:= load("taka_ahg.rr");
263: [1165]:= A=[[1,0,0],[1,1,0],[1,0,1],[1,1,1],[1,2,0]];
1.2 takayama 264: [1166]:= fctr(taka_ahg.b(A,0,[s1,s2,s3]));
265: [[1,1],[s1-s3,1],[2*s1-s2-s3,1],[2*s1-s2-s3-1,1]]
1.1 takayama 266: \end{verbatim}
267:
268: \begin{verbatim}
269: def b(A,Idx,V) {
270: F = oxshell.facets(A); /* Computing all the facets by polymake server.*/
271: F = F[1]; /* F is the set of the facets */
272: P = A[Idx];
273: Nfacets = length(F);
274: F = toPrimitive2(P,F); /* Translate into primitive supporting function */
275: Bf = 1;
276: for (I=0; I<Nfacets; I++) {
277: H = matrix_inner_product(P,F[I]);
278: if (H != 0) {
279: B = matrix_inner_product(P,V);
280: for (J=0; J<H; J++) {
281: Bf = Bf*(B-J); /* See the papers above. */
282: }
283: }
284: }
285: return(Bf);
286: }
287: \end{verbatim}
288: }
1.5 takayama 289: \end{minipage}
290: \epsfxsize=12cm
291: \epsffile{rims-2003-12-16-sq2.eps}
1.1 takayama 292:
293: \rightline{$B3+H/(B: $B9b;3(B}
294: \newpage
295:
296:
297: \noindent
298: \pagetitle{3. {\color{blue} OX-RFC 103 ( 100, 101 $BJd0d(B)}}
299:
300: $B$3$N(B RFC $B$O(B OpenXM RFC 100 ($B$*$h$S(B 101) $B$N<BAu$K$h$jL@$i$+$K$J$C$?<o!9$NLdBjE@$r$b$H$K(B
301: RFC 100 $B%W%m%H%3%k$X$N4v$D$+$NDI2C$rDs0F$9$k(B.
302:
303: \nnn $B%U%!%$%k$X$NFI$_=q$-(B \\
304: \nnn $B?7$7$$(B CMO \\
305: \nnn $B%(%s%8%sG'>Z<jB3$-(B \\
306: \nnn $BCfCG$*$h$SJQ?t$NEAGE(B \\
307: 1. $B<+J,$N;R6!%W%m%;%9$r$9$Y$F%j%9%H$9$k(B
308: (asir$B$N>l9g(B:{\tt ox\_get\_serverinfo()}) \\
309: 2. $B;R6!%W%m%;%9$K=gHV$K(B OpenXM-RFC 100 $B$NCfCG%a%C%;!<%8$rAw$k(B.
310:
311: \noindent
312: {\color{red} ox103\_set\_shared\_variable(} CMO string {\tt Name}, CMO object {\tt
313: value}{\tt )}
314: $B%(%s%8%s%9%?%C%/%^%7%s$NJQ?t(B {\tt Name} $B$KCM(B
315: {\tt value} $B$,@_Dj(B,
316: $B$5$i$K;R$I$b$N%W%m%;%9$9$Y$F$N%(%s%8%s4X?t(B
317: {\tt ox103\_set\_shared\_variable}
318: $B$r$h$V(B.
319:
320: \rightline{$B3+H/(B: $B9b;3(B}
321: \newpage
322:
323: \noindent
324: \pagetitle{4. {\color{blue} OX-RFC 102 --- $BK\3JE*$J%5!<%P4VDL?.$rMQ$$$?J,;67W;;(B}}
1.3 noro 325: \parskip 5pt
326:
327: OX-RFC-100, 101 : master-server $B4VDL?.$rMQ$$$?J,;67W;;(B
328:
329: OX-RFC-102 : server-server $B4VDL?.(B
330:
331: \underline{$BL\I8(B} : $BK\3JE*J,;6JBNs7W;;$r2DG=$K$9$k$3$H(B
332:
333: \underline{$B1~MQNc(B}
334: \begin{itemize}
335: \item broadcast $B$r8zN(2=$9$k(B
336:
337: N $B8D$N(B server $B$X$N(B broadcast $B$,(B $O(\log_2 N)$ $B$G$G$-$k(B
338:
339: \item LU $BJ,2r$NJ,;6JBNs7W;;(B
340:
341: ScaLAPACK $BIw$K(B, $B9TNs$rJ,;6J];}$7$FJBNs7W;;(B
342: \end{itemize}
343:
344: \underline{$B;EMM(B}
345:
346: MPI-2 $B$N(B, $BF0E*%W%m%;%9@8@.(B, $B%W%m%;%9%0%k!<%W4V(B broadcast $B$N;EMM$r(B
347: $B;29M$K$9$k(B
348: \newpage
349:
350: \noindent
351: \pagetitle{server $B$N5/F0(B, server $B4VDL?.O)$N3+@_(B}
352:
353: server $B$O(B OX RFC-100, 101 $B$K$h$j5/F0$9$k(B. $B$3$NDL?.O)$K0J2<$N(B SM
354: $B%3%^%s%I$rAw$k(B.
355:
356: \begin{itemize}
357: \item {\tt SM\_set\_rank\_102} $nserver$ $rank$
358:
359: server $B$K(B, $B%0%k!<%WFb$N(B server $B$NAm?t(B $nserver$ $B$H(B, $B$=$NCf$G$N(B
360: $B<1JL;R(B $rank$ ($0 \le rank \le nserver$) $B$rDLCN$9$k(B.
361:
362: \item {\tt SM\_tcp\_accept\_102} $port$ $peer$
363:
364: $B%]!<%HHV9f(B $port$ $B$N(B TCP $B%]!<%H$G(B, bind, listen, accept $B$r<B9T(B
365: $B$7$F(B connect $B$rBT$D(B. $BDL?.$,@.N)$7$?$i(B, byte order negotiation
366: $B$r9T$$(B, $BAj<j@h%F!<%V%k$KEPO?$9$k(B.
367:
368: \item {\tt SM\_tcp\_connect\_102} $peerhost$ $port$ $peer$
369:
370: $B%[%9%H(B $peerhost$ $B$N%]!<%HHV9f(B $port$ $B$N(B TCP $B%]!<%H$K(B connect $B$9$k(B.
371: $BDL?.$,@.N)$7$?$i(B, byte order negotiation $B$r9T$$(B, $BAj<j@h%F!<%V%k$KEPO?(B
372: $B$9$k(B.
373:
374: \end{itemize}
375:
376: \newpage
377:
378: \noindent
379: \pagetitle{server $B4VDL?.(B, broadcast, reduction}
380:
381: server $B4VDL?.$O(B, $BAj8_$N?.Mj$K4p$E$-9T$&(B --- $BAw$j<j$,Aw?.$7$?$i(B, $B<u$1<j$O(B
382: $B$A$c$s$H<u?.F0:n$KF~$k$3$H(B
383:
384: $B%G!<%?$O(B OX $B%?%0IU$-$G(B --- {\tt OX\_SYNC\_BALL} $B$K$h$kDL?.O)%j%;%C%H$KI,MW(B
385:
386: $B0J2<$N(B SM $B%3%^%s%I$O(B collective $BA`:n$G$"$k(B. $B$9$J$o$A(B, $BF10l0z?t$G(B
387: $B%0%k!<%WFb$NA4$F$N(B server $B$G<B9T$5$l$J$1$l$P$$$1$J$$(B.
388:
389: \begin{itemize}
390: \item {\tt SM\_bcast\_102} $root$
391:
392: $B<1JL;R(B $root$ $B$N(B server $B$N%9%?%C%/>e$N%G!<%?$r(B pop $B$7(B, $B%0%k!<%WFb$K(B
393: broadcast $B$9$k(B. $B3F(B server $B$N%9%?%C%/$K(B broadcast $B$5$l$?%G!<%?$,(B push
394: $B$5$l$k(B.
395:
396: \item {\tt SM\_reduce\_102} $root$ $opname$
397:
398: $B3F(B server $B$N%9%?%C%/>e$N%G!<%?$,(B pop $B$5$l(B, $opname$ $B$G;XDj$5$l$k(B
399: $BFs9`1i;;(B($B7k9gB'$,I,MW(B) $B$r=g$K9T$$(B, $B7k2L$r(B $root$ $B$G;XDj$5$l$k(B server
400: $B$N%9%?%C%/$K(B push $B$9$k(B. $BB>$N(B server $B$K$O(B $0$ $B$,(B push
401: $B$5$l$k(B.
402: \end{itemize}
403:
404: \newpage
405:
406: \noindent
407: \pagetitle{broadcast $B$N<jB3$-(B}
408:
1.6 noro 409: {SM\_bcast\_102} $B$N<B9T(B
1.3 noro 410:
1.6 noro 411: $root=0$ $B$G(B, $B<1JL;R$,(B $b2^k$ ($b$ $B$O4q?t(B) $B$N(B server $B$NF0:n(B
1.3 noro 412:
1.6 noro 413: \vskip\baselineskip
414: \begin{tabbing}
415: $data \leftarrow$ $B<1JL;R$,(B $(b-1)2^k$ $B$N(B server $B$+$i$N%G!<%?(B\\
416: for \= $i=k-1$ down to $0$\\
417: \> $B<1JL;R$,(B $b2^k+2^i$ $B$N(B server $B$K(B $data$ $B$rAw?.(B\\
418: end for
419: \end{tabbing}
420: \vskip\baselineskip
1.3 noro 421: 2 $B$G3d$j@Z$l$k2s?t$,B?$$<1JL;R$r;}$D(B server $B$,@h$K%G!<%?Aw?.(B
422:
423: $\Rightarrow$ $B%G%C%I%m%C%/$K$J$i$J$$(B
424:
425: $BFHN)$J%Z%"$I$&$7$NDL?.$,F1;~$K9T$($k$J$i!"9b!9(B $\lceil \log_2 N\rceil$ $B%9%F%C%W(B
426: ($N$ $B$O(B server $B$NAm?t(B) $B$G(B broadcast $B40N;(B.
1.6 noro 427:
428: \newpage
429:
430: \noindent
431: \pagetitle{reduction $B$N<jB3$-(B}
432:
433: {SM\_reduce\_102} $B$N<B9T(B
434:
435: server $B?t(B $N$, $root=0$ $B$G(B, $B<1JL;R$,(B $b$ $B$N(B server $B$NF0:n(B
436:
437: $B<j;}$A$N%G!<%?$r(B $data$ $B$H$9$k(B
438:
439: \vskip\baselineskip
440: \begin{tabbing}
441: for \= $i=0$ to $\lfloor \log_2 N \rfloor$\\
442: \> if \= ( $b$ $B$K(B $2^i$ $B$N(B bit $B$,$"$k(B) then\\
443: \> \> $B<1JL;R(B $b-2^i$ $B$N(B server $B$K(B $data$ $B$rAw?.$7$F=*N;(B\\
444: \> else if ( $b+2^i < N$ ) then \\
445: \> \> $data_0 \leftarrow$ $B<1JL;R(B $b+2^i$ $B$N(B server $B$+$i$N%G!<%?(B\\
446: \> \> $data \leftarrow data$ $B$H(B $data_0$ $B$NFs9`1i;;7k2L(B \\
447: \> end if\\
448: end for
449: \end{tabbing}
450: \vskip\baselineskip
451:
452: $B$3$N>l9g$b(B, $BFHN)$J%Z%"$I$&$7$NDL?.$,F1;~$K9T$($k$J$i!"9b!9(B $\lceil \log_2 N\rceil$ $B%9%F%C%W(B
453: ($N$ $B$O(B server $B$NAm?t(B) $B$G(B reduction $B40N;(B. $B7k2L$O(B root $B$K;D$k(B.
454: \newpage
455:
456: \noindent
457: \pagetitle{broadcast $B;~$N%G!<%?$NN.$l(B}
458:
459:
460: $N=16$, $root=0$ $B$N>l9g(B
461:
462: \begin{center}
463: \begin{tabular}{|c|c|c|c|}
464: step 1 & step 2 & step 3 & step 4 \\ \hline
465: $0\rightarrow 8$&$0\rightarrow 4$ &$0\rightarrow 2$ &$0\rightarrow 1$ \\
466: &$8\rightarrow 12$&$8\rightarrow 10$ &$8\rightarrow 9$ \\
467: & &$4\rightarrow 6$ &$4\rightarrow 5$ \\
468: & &$12\rightarrow 14$&$12\rightarrow 13$ \\
469: & & &$2\rightarrow 3$ \\
470: & & &$10\rightarrow 11$ \\
471: & & &$6\rightarrow 7$ \\
472: & & &$14\rightarrow 15$
473: \end{tabular}
474: \end{center}
475:
476: reduction $B$N>l9g(B, $B%G!<%?$NN.$l$O5U$K$J$k(B (step 4 $\rightarrow$ step 1,
477: $BLp0u$,5U(B)
1.3 noro 478: \newpage
479:
480: \noindent
481: \pagetitle{$B%(%i!<=hM}(B}
482:
483: master-server $B4VDL?.O)$O(B, OX RFC-100 $B$G5,Dj$5$l$F$$$k(B.
484:
485: server-server $B4VDL?.O)$r6u$K$9$k$?$a$N(B, $B<1JL;R(B $i$ $B$N(B server $B$G$NA`:n(B
486:
487: \begin{tabbing}
488: for \= $j = 0$ \= to $i-1$ do\\
489: \> do\\
490: \> \>$data$ $\leftarrow$ $B<1JL;R(B $j$ $B$N(B server $B$+$i$N(B OX $B%G!<%?(B\\
491: \> while $data \neq$ {\tt OX\_SYNC\_BALL}\\
492: end for\\
493: for $j = i+1$ to $nserver-1$ do\\
494: \> {\tt OX\_SYNC\_BALL} $B$r(B $B<1JL;R(B $j$ $B$N(B server $B$KAw?.(B\\
495: end for
496: \end{tabbing}
497:
498: master-server $B%j%;%C%H8e(B : $B3F(B server $B$O%3%^%s%IBT$A>uBV(B
499:
500: $\Rightarrow$ $B<!$N(B SM $B%3%^%s%I$r3F(B server $B$KAw?.$9$l$P$h$$(B
501:
502: \begin{itemize}
503: \item {\tt SM\_reset\_102} ($B0z?t$J$7(B, collective)
504: \end{itemize}
505:
506: \newpage
507:
508: \noindent
509: \pagetitle{Asir (master) $B>e$G$N(B API}
510:
511: \begin{itemize}
512: \item {\tt ox\_set\_rank\_102($Server$,$Nserver$,$Rank$)}
513:
514: $Server$ $B$K(B {\tt SM\_set\_rank\_102} $B$rAw$k(B.
515:
516: \item {\tt ox\_tcp\_accept\_102($Server$,$Port$,$Rank$)}
517:
518: $Server$ $B$K(B {\tt SM\_tcp\_accept\_102} $B$rAw$k(B.
519:
520: \item {\tt ox\_tcp\_connect\_102($Server$,$Host$,$Port$,$Rank$)}
521:
522: $Server$ $B$K(B {\tt SM\_tcp\_connect\_102} $B$rAw$k(B.
523:
524: \item {\tt ox\_reset\_102($Server$)} (collective)
525:
526: $Server$ $B$K(B {\tt SM\_reset\_102} $B$rAw$k(B
527:
528: \end{itemize}
529:
530: \newpage
531:
532: \noindent
533: \pagetitle{Asir (server) $B>e$G$N(B API}
534:
535: \begin{itemize}
536: \item {\tt ox\_send\_102($Rank$,$Data$)}
537:
538: $B<1JL;R(B $Rank$ $B$N(B server $B$K(B $Data$ $B$r(B OX $B%G!<%?$H$7$FAw?.$9$k(B.
539: $B<1JL;R(B $Rank$ $B$N(B server $B$OBP1~$9$k<u?.$r3+;O$7$J$1$l$P$J$i$J$$(B.
540:
541: \item {\tt ox\_recv\_102($Rank$)}
542:
543: $B<1JL;R(B $Rank$ $B$N(B server $B$+$i(B OX $B%G!<%?$r<u?.$9$k(B.
544: $B<1JL;R(B $Rank$ $B$N(B server $B$OBP1~$9$kAw?.$r3+;O$7$J$1$l$P$J$i$J$$(B.
545:
546: \item {\tt ox\_bcast\_102($Root$[,$Data$])} (collective)
547:
548: $B<1JL;R(B $Root$ $B$N(B server $B$r(B root $B$H$7$F(B, $B%0%k!<%WFb$G(B broadcast $B$9$k(B.
549: $Data$ $B$,;XDj$5$l$?>l9g(B, $B%9%?%C%/$K%W%C%7%e$5$l$k(B.
1.9 ! noro 550: $B<1JL;R$,(B $Root$ $B$KEy$7$$(B server $B$G(B, $B%9%?%C%/(B
1.3 noro 551: $B$+$i%G!<%?$,%]%C%W$5$l(B, $B$=$N%G!<%?$,(B, $B3F8F$S=P$7$NLa$jCM$H$J$k(B.
552:
553: \item {\tt ox\_reduce\_102($Root$,$Operation$[,$Data$])} (collective)
554:
555: $B%0%k!<%WFb$N3F(B server $B$N%9%?%C%/$+$i%]%C%W$7$?%G!<%?$KBP$7(B
556: $Operation$ $B$G;XDj$5$l$kFs9`1i;;$r9T$$(B,
557: $B7k2L$r(B $Root$ $B$G;XDj$5$l$k(B server $B$G$N4X?t8F$S=P$7$NLa$jCM$H$7$F(B
558: $BJV$9(B.
559: $Data$ $B$,;XDj$5$l$?>l9g(B, $B%9%?%C%/$K%W%C%7%e$7$F$+$i>e5-$NA`:n$r(B
560: $B<B9T$9$k(B. $Root$ $B0J30$N(B server $B$G$NLa$jCM$O(B 0 $B$G$"$k(B.
561: \end{itemize}
1.1 takayama 562:
563:
564: \newpage
565:
1.3 noro 566: \noindent
1.7 noro 567: \pagetitle{$B<B9TNc(B : $B0lJQ?tB?9`<0$N@Q(B (master $BB&(B)}
568:
569: \begin{verbatim}
570: def d_mul(F1,F2)
571: {
572: Procs = getopt(proc);
1.8 noro 573: /* process $B;XDj$,$J$$>l9g$K$O(B, $B<+J,$G7W;;(B */
574: if ( type(Procs) == -1 ) return umul(F1,F2);
1.7 noro 575: if ( !var(F1) || !var(F2) ) return F1*F2;
576: NP = length(Procs);
577: /* $B0z?t$r(B server 0 $B$KAw$k(B */
578: ox_push_cmo(0,[F1,F2]);
579: /* $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 */
580: for ( I = 0; I < NP; I++ )
581: ox_cmo_rpc(I,"d_mul_main",0);
582: /* server 0 $B$+$i7k2L$r<u$1<h$k(B */
583: R = ox_pop_cmo(0);
584: return R;
585: }
586: \end{verbatim}
587:
588: \newpage
589:
590: \noindent
591: \pagetitle{$B<B9TNc(B : $B0lJQ?tB?9`<0$N@Q(B (server $BB&(B; collective)}
592: \begin{verbatim}
593: def d_mul_main(Root)
594: {
595: /* server $B$NAm?t(B, $B<+J,$N(B id $B$rCN$k(B */
596: Id = ox_get_rank_102(); NP = Id[0]; Rank = Id[1];
597: /* Root $B$K$"$k0z?t$r(B broadcast $B$G6&M-(B */
598: Arg = ox_bcast_102(Root); F1 = Arg[0]; F2 = Arg[1];
599: L = setup_modarrays(F1,F2,NP);
600: Marray = L[0]; MIarray = L[1]; M = L[2];
601: R = umul_chrem(F1,F2,MIarray[Rank],Marray[Rank],M);
602: Arg = 0; F1 = 0; F2 = 0;
603: /* $B3F(B server $B$N7k2L$rB-$79g$o$;$F(B, Root $B$KCV$/(B */
604: R = ox_reduce_102(Root,"+",R);
605: /* Root $B$N$_(B, $B7k2L$r(B normalize $B$9$k(B */
606: if ( Rank == Root )
607: R = uadj_coef(R%M,M,ishift(M,1));
608: return R;
609: }
610: \end{verbatim}
1.6 noro 611:
612: \rightline{$B3+H/(B: $BLnO$(B}
1.3 noro 613:
1.1 takayama 614: \end{document}
615:
1.3 noro 616: %%$Id: rims-2003-12-16-ja-ohp.tex,v 1.4 2003/12/11 05:40:59 taka Exp $ at misc-2003/12/RIMS
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>