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