[BACK]Return to ox_math_interruption.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / Papers

Diff for /OpenXM/doc/Papers/ox_math_interruption.tex between version 1.2 and 1.3

version 1.2, 2003/02/13 01:47:23 version 1.3, 2003/03/16 20:16:12
Line 1 
Line 1 
 % $OpenXM$  % $OpenXM: OpenXM/doc/Papers/ox_math_interruption.tex,v 1.2 2003/02/13 01:47:23 ohara Exp $
 % 第二回 OpenXM committers meeting 講演原稿  % 第二回 OpenXM committers meeting 講演原稿
   % 第11回 Risa Consortium 研究集会講演原稿
 % pdfファイルの生成法  % pdfファイルの生成法
 % > platex ox_math_interruption.tex  % > platex ox_math_interruption.tex
 % > dvips  ox_math_interruption.dvi > ox_math_interruption.ps  % > dvips  ox_math_interruption.dvi > ox_math_interruption.ps
Line 17 
Line 18 
   
 \maketitle  \maketitle
   
 \overlays{4}{  \overlays{3}{
 \begin{slide}{ox\_math とは}  \begin{slide}{ox\_math とは}
 \begin{itemstep}  \begin{itemize}
 \item OpenXM プロトコルをサポートするための  \item OpenXM プロトコルをサポートするための
 Mathematica Kernel の wrapper  Mathematica Kernel の wrapper
 \item MathLink (Mathematicaの通信ライブラリ)と  \item MathLink (Mathematicaの通信ライブラリ)と
 OpenXM プロトコルの両方を扱う  OpenXM プロトコルの両方を扱う
 \item 今回、ox\_math に計算中断機能を実装した \\  \item 今回、ox\_math に計算中断機能を実装した \\
 {\yellow (MathLink の非公開機能を用いる)}  \fromSlide*{2}{
 \item Linux, Windows の Mathematica 4.x で動作する  \item[] {\yellow (MathLink の非公開機能を用いる)}
 \end{itemstep}  }
   \fromSlide*{3}{
   \item テスト環境\\
   Mathematica 4.x (Linux, Windows), \\
   Mathematica 3.x (Solaris)
   }
   \end{itemize}
 \end{slide}  \end{slide}
 }  }
   
 \overlays{3}{  \overlays{2}{
 \begin{slide}{OpenXM と MathLink の比較}  \begin{slide}{OpenXM と MathLink の比較}
 \begin{itemstep}  \begin{itemize}
 \item OpenXM\\  \item OpenXM\\
 プロトコルを公開。仕組みが明らかだが自分で実装しなければならない。  プロトコルを公開。仕組みが明らかだが自分で実装しなければならない。
 \item MathLink\\  \item MathLink\\
 ライブラリを公開。実装しなくてよいが中身が分からない。  ライブラリを公開。実装しなくてよいが中身が分からない。
 またソースが公開されていない。  またソースが公開されていない。
 \item[] $\Rightarrow${\yellow 文書化されていないことをしようとすると困る。}  \fromSlide*{2}{
 \end{itemstep}  \item[] {\yellow 文書化されていないことをするときに困る}
   }
   \end{itemize}
 \end{slide}  \end{slide}
 }  }
   
Line 49  OpenXM プロトコルの両方を扱う
Line 58  OpenXM プロトコルの両方を扱う
 \psset{linecolor=white}  \psset{linecolor=white}
 \rput[r](2.0,1.2){\rnode{Client}{\psovalbox{client}}}  \rput[r](2.0,1.2){\rnode{Client}{\psovalbox{client}}}
 \psframe[framearc=0.3](4.5,0)(11.5,5.4)  \psframe[framearc=0.3](4.5,0)(11.5,5.4)
 \rput[B](8,5.5){同一マシン}  \rput[B](8,5.5){同一マシン(親・子・孫)}
 \rput[l](5.0,1.2){\rnode{Engine}{\psovalbox{ox\_math}}}  \rput[l](5.0,1.2){\rnode{Engine}{\psovalbox{ox\_math}}}
 \rput[l](9.4,1.2){\rnode{Kernel}{\psovalbox{math}}}  \rput[l](9.4,1.2){\rnode{Kernel}{\psovalbox{math}}}
 \rput[l](4.8,4.2){\rnode{Control}{\psovalbox{controller}}}  \rput[l](4.8,4.2){\rnode{Control}{\psovalbox{controller}}}
 \ncline[linewidth=2pt]{<->}{Client}{Engine}  \ncline[linewidth=2pt]{<->}{Client}{Engine}
 \ncline[linewidth=2pt]{<->}{Client}{Control}  \ncline[linewidth=2pt]{<->}{Client}{Control}
   \ncline[linewidth=2pt,linestyle=dotted]{->}{Control}{Engine}
 \ncline[linewidth=2pt,linecolor=yellow]{<->}{Engine}{Kernel}  \ncline[linewidth=2pt,linecolor=yellow]{<->}{Engine}{Kernel}
 \end{pspicture}  \end{pspicture}
 \end{slide}  \end{slide}
   
 \overlays{5}{  
 \begin{slide}{OpenXM の仕組み}  \begin{slide}{OpenXM の仕組み}
 \begin{itemstep}  \begin{itemize}
 \item サーバ・クライアント方式  \item サーバ・クライアント方式
 \item ネットワーク透過性がある  \item ネットワーク透過性がある
 \item サーバはコントローラとエンジンの 2 プロセスからなる  \item サーバはコントローラとエンジンの 2 プロセスからなる
 \item エンジンはスタックマシン  \item エンジンはスタックマシン
 \item 計算を途中で中断できる  \item 計算を途中で中断できる
 \end{itemstep}  \end{itemize}
 \end{slide}  \end{slide}
 }  
   
 \overlays{5}{  \overlays{5}{
 \begin{slide}{OpenXM の計算中断機能}  \begin{slide}{OpenXM の計算中断機能}
Line 82  OpenXM プロトコルの両方を扱う
Line 90  OpenXM プロトコルの両方を扱う
 \rput[l](7.8,4.2){\rnode{Control}{\psovalbox{controller}}}  \rput[l](7.8,4.2){\rnode{Control}{\psovalbox{controller}}}
 \ncline[linewidth=2pt]{<->}{Client}{Control}  \ncline[linewidth=2pt]{<->}{Client}{Control}
 \onlySlide*{2}{\Aput{\yellow reset}}  \onlySlide*{2}{\Aput{\yellow reset}}
 \ncline[linestyle=dotted]{->}{Control}{Engine}  \ncline[linewidth=2pt,linestyle=dotted]{->}{Control}{Engine}
 \onlySlide*{3}{\Aput{\yellow SIGUSR1}}  \onlySlide*{3}{\Aput{\yellow SIGUSR1}}
 \ncline[linewidth=2pt]{<->}{Client}{Engine}  \ncline[linewidth=2pt]{<->}{Client}{Engine}
 \onlySlide*{4}{\Bput{\yellow OX\_SYNC\_BALL}}  \onlySlide*{4}{\Bput{\yellow OX\_SYNC\_BALL}}
Line 90  OpenXM プロトコルの両方を扱う
Line 98  OpenXM プロトコルの両方を扱う
 \end{slide}  \end{slide}
 }  }
   
 \overlays{3}{  \overlays{4}{
 \begin{slide}{MathLink の仕組み}  \begin{slide}{MathLink の仕組み}
 \begin{itemize}  \begin{itemize}
 \fromSlide*{1}{\item (ほとんど)ネットワーク透過性がある。}  \item (ほとんど)ネットワーク透過性がある
 \fromSlide*{2}{\item 通信路で送られるのは{\yellow Mathematicaの式}}  \fromSlide*{2}{\item 通信路で送られるのは{\yellow Mathematicaの式}}
 \fromSlide*{3}{\item[]  \fromSlide*{3}{\item[]
 \begin{itemize}  \begin{itemize}
Line 134  MLNewPacket(link);
Line 142  MLNewPacket(link);
 \end{slide}  \end{slide}
   
 \overlays{4}{  \overlays{4}{
 \begin{slide}{参考文献}  \begin{slide}{Mathematica の割り込み}
 \begin{itemstep}  \begin{pspicture}(12,6)
 \item[{[1]}] Mathematica Book, Wolfram Research  \psset{linecolor=white}
 \item[{[2]}] MathArchive にあった Todd Gayley のメール([mg17015], 1999/Apr)  \rput[r](2.0,3.0){\rnode{Engine}{\psovalbox{ox\_math}}}
 \item[{[3]}] 昔の MathLink にあった MLSignal(\ ) の解説  \rput[l](7.0,3.0){\rnode{Kernel}{\psovalbox{MathKernel}}}
 (Google のキャッシュにあった)  \onlySlide*{1}{
 \item[{[4]}] mathlink.h, nm libMLa の出力, mprep の生成するソース  \ncline[linewidth=2pt]{->}{Engine}{Kernel}
 \end{itemstep}  \Aput{\yellow EvaluatePacket[...]}
   }
   \onlySlide*{2}{
   \ncline[linewidth=2pt,linestyle=dotted]{->}{Engine}{Kernel}
   \Aput{\yellow SIGINT}
   }
   \onlySlide*{3}{
   \ncline[linewidth=2pt]{<->}{Engine}{Kernel}
   \Aput{\yellow 割り込みの後始末}
   }
   \onlySlide*{4}{
   \ncline[linewidth=2pt]{<-}{Engine}{Kernel}
   \Aput{\yellow ReturnPacket[\$Aborted]}
   }
   \end{pspicture}
 \end{slide}  \end{slide}
 }  }
   
 \overlays{6}{  \overlays{3}{
 \begin{slide}{MLPutMessage}  \begin{slide}{MLPutMessage}
 \begin{itemstep}  \begin{itemize}
 \item MathLink の非公開関数  \item MathLink の非公開関数
 \item ネットワーク透過性はない。  \item ネットワーク透過性はない
   \fromSlide*{2}{
 \item MLPutMessage(link, MLInterruptMessage)\\  \item MLPutMessage(link, MLInterruptMessage)\\
 で link の指すプロセスに {\yellow SIGINT} を送る。\\  で link の指すプロセスに {\yellow SIGINT} を送る。\\
 (Linux の場合)  (Unix の場合)
 \item シグナルを送る前に計算が終了する場合もありうるので注意が必要  }
 \item 割り込んだあとの後始末は?  \fromSlide*{3}{
 \item[] $\Rightarrow${\yellow 相手方のプログラムの作りに依存する}  \item 割り込んだあとの後始末は、{\yellow 相手方のプログラムの作りに依存する}
 \end{itemstep}  }
   \end{itemize}
 \end{slide}  \end{slide}
 }  }
   
 \overlays{6}{  \overlays{5}{
 \begin{slide}{割り込みの後始末(4.xの場合)}  \begin{slide}{割り込みの後始末}
 \begin{itemstep}  \begin{itemstep}
 \item MenuPacket[1,"Interrupt> "] を受け取れば計算が中断されている  \item MenuPacket[1,"Interrupt> "] を受け取れば計算が中断されている
 \item MLPutString("$\backslash$n")  \item MLPutString("$\backslash$n")
 \item MenuPacket[0,"Interrupt> "] を受け取る  \item MenuPacket[0,"Interrupt> "] を受け取る
 \item MLPutString("a")  \item MLPutString("a")
 \item TextPacket["..."] を受け取っておしまい。  \item TextPacket["..."] を受け取る
 \item 計算結果(ReturnPacket[\$Aborted])は受け取れない  
 \end{itemstep}  \end{itemstep}
 \end{slide}  \end{slide}
 }  }
   
   \overlays{3}{
   \begin{slide}{計算結果 \$Aborted}
   \begin{itemize}
   \item ReturnPacket[\$Aborted] が返ってくるか? \\
   3.x $\Rightarrow$ ○, $\quad$ 4.x $\Rightarrow$ ×
   \fromSlide*{2}{
   \item 4.x では、{\yellow 次の計算}を行うと、\$Aborted が返ってくる!!
   }
   \fromSlide*{3}{
   \item ``割り込みの後始末''のあと、EvaluatePacket[0] を送って、
   ReturnPacket[...] をふたつ受け取るとよい。最初のものが \$Aborted
   }
   \end{itemize}
   \end{slide}
   }
   
   \begin{slide}{参考文献}
   \begin{itemize}
   \item[{[1]}] Mathematica Book, Wolfram Research
   \item[{[2]}] MathArchive にあった Todd Gayley のメール([mg17015], 1999/Apr)
   \item[{[3]}] 昔の MathLink にあった MLSignal(\ ) の解説
   (Google のキャッシュにあった)
   \item[{[4]}] mathlink.h, nm libMLa の出力, mprep の生成するソース
   \end{itemize}
   \end{slide}
   
 \end{document}  \end{document}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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