Mercurial > hg > Papers > 2018 > suruga-thesis
changeset 29:a7dbce3eeaa3
fix
author | suruga |
---|---|
date | Tue, 20 Feb 2018 16:55:34 +0900 |
parents | b02a8d6a4e9c |
children | 158d4710627e |
files | .DS_Store paper/.DS_Store paper/final_main/chapter3.tex paper/final_main/main.aux paper/final_main/main.dvi paper/final_main/main.log paper/final_main/main.lol paper/final_main/main.pdf paper/final_main/main.tex paper/final_main/main.toc |
diffstat | 10 files changed, 403 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/paper/final_main/chapter3.tex Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/chapter3.tex Tue Feb 20 16:55:34 2018 +0900 @@ -276,5 +276,336 @@ ここではAliceに実装した時間計測プログラムについて解説する。 以下のソースコード \ref{src:alipro}は、実装したテストプログラムの起動部分である。 -\lstinputlisting[frame=lrbt, label=alipro, caption=Aliceに実装した時間計測プログラムのプログラムの起動部分,numbers=left]{./alitopo.txt} +\lstinputlisting[frame=lrbt, label=src:alipro, caption=Aliceに実装した時間計測プログラムのプログラムの起動部分,numbers=left]{./alitopo.txt} + +%また、実際のプログラムをソースコード \ref{src:ConfigWaiter.java}のように記述した。 +%\lstinputlisting[frame=lrbt, label=src:ConfigWaiter.java, caption=Aliceに実装した時間計測プログラムのプログラムの起動部分,numbers=left]{./ConfigWaiter.txt} + + +%ソースコード \ref{src:StartTopologyManager.java}。 +%\lstinputlisting[frame=lrbt, label=src:StartTopologyManager.java, caption=Aliceに実装した時間計測プログラムのプログラムの起動部分,numbers=left]{./StartTopologyManager.txt} + +ソースコード \ref{src:StartTopologyManager.java} +\begin{lstlisting}[frame=lrbt,label=src:StartTopologyManager.java,caption=Aliceに実装したtimestamp部分,numbers=left] +package alice.topology.manager; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; + +import org.apache.log4j.Logger; + +import alice.codesegment.CodeSegment; +import alice.topology.HostMessage; +import alice.topology.fix.ReceiveDisconnectMessage; + +import com.alexmerz.graphviz.ParseException; +import com.alexmerz.graphviz.Parser; +import com.alexmerz.graphviz.objects.Edge; +import com.alexmerz.graphviz.objects.Graph; +import com.alexmerz.graphviz.objects.Node; + +public class StartTopologyManager extends CodeSegment { + + TopologyManagerConfig conf; + Logger logger = Logger.getLogger(StartTopologyManager.class); + + public StartTopologyManager(TopologyManagerConfig conf) { + this.conf = conf; + } + + @Override + + public void run() { + + new CheckComingHost(); + + ods.put("absCookieTable", new HashMap<String, String>()); + + ods.put("config", conf ); + + + + if (!conf.dynamic) { + + LinkedList<String> nodeNames = new LinkedList<String>(); + + HashMap<String, LinkedList<NodeInfo>> topology = new HashMap<String, + + LinkedList<NodeInfo>>(); + + int nodeNum = 0; + + try { + + FileReader reader = new FileReader(new File(conf.confFilePath)); + + Parser parser = new Parser(); + + parser.parse(reader); + + ArrayList<Graph> graphs = parser.getGraphs(); + + for (Graph graph : graphs) { + + ArrayList<Node> nodes = graph.getNodes(false); + + nodeNum = nodes.size(); + + for (Node node : nodes) { + + String nodeName = node.getId().getId(); + + nodeNames.add(nodeName); + + topology.put(nodeName, new LinkedList<NodeInfo>()); + + } + + ArrayList<Edge> edges = graph.getEdges(); + + HashMap<String, NodeInfo> hash = new HashMap<String, NodeInfo>(); + + for (Edge edge : edges) { + + String connection = edge.getAttribute("label"); + + String source = edge.getSource().getNode().getId().getId(); + + String target = edge.getTarget().getNode().getId().getId(); + + LinkedList<NodeInfo> sources = topology.get(target); + + NodeInfo nodeInfo = new NodeInfo(source, connection); + + sources.add(nodeInfo); + + hash.put(source + "," + target, nodeInfo); + + } + + for (Edge edge : edges) { + + String connection = edge.getAttribute("label"); + + String source = edge.getSource().getNode().getId().getId(); + + String target = edge.getTarget().getNode().getId().getId(); + + NodeInfo nodeInfo = hash.get(target + "," + source); + + if (nodeInfo != null) { + + nodeInfo.reverseName = connection; + + } + + } + + } + + + + } catch (FileNotFoundException e) { + + logger.error("File not found: " + conf.confFilePath); + + e.printStackTrace(); + + } catch (ParseException e) { + + logger.error("File format error: " + conf.confFilePath); + + e.printStackTrace(); + + } + + + // for recode topology information + + // cookie List + + + ods.put("running", false); + + ods.put("resultParse", topology); + + ods.put("nodeNames", nodeNames); + + + + new IncomingHosts(); + + + + ConfigWaiter cs3 = new ConfigWaiter(nodeNum); + cs3.done.setKey("local", "done"); + + + + } else { + + ods.put("running", true); + + + + HashMap<String, HostMessage> nameTable = new HashMap<String, HostMessage>(); + + + + if (conf.type == TopologyType.Tree) { + + int cominghostCount = 0; + + ParentManager manager = new ParentManager(conf.hasChild); + + ods.put("parentManager", manager); + + ods.put("nameTable", nameTable); + + ods.put("hostCount", cominghostCount); + + new ComingServiceHosts(); + + new ReceiveDisconnectMessage(); + + } + + } + + + + ods.put("topology", new HashMap<String, LinkedList<HostMessage>>()); + + ods.put("createdList", new LinkedList<String>()); + + new CreateHash(); + + + + TopologyFinish cs2 = new TopologyFinish(); + + cs2.finish.setKey("local", "finish"); + + cs2.config.setKey("config"); + + cs2.startTime.setKey("startTime"); + + } + + + +} +\end{lstlisting} + +ソースコード\ref{src:TopologyFinish.java} +\begin{lstlisting}[frame=lrbt,label=src:TopologyFinish.java,caption=Aliceに実装したtimestamp部分,numbers=left] +package alice.topology.manager; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class TopologyFinish extends CodeSegment { + public Receiver finish = ids.create(CommandType.TAKE); + public Receiver config = ids.create(CommandType.PEEK); + public Receiver startTime = ids.create(CommandType.TAKE); + @Override + public void run() { + TopologyManagerConfig conf = config.asClass(TopologyManagerConfig.class); + long start = startTime.asClass(Long.class); + if (conf.showTime) { + System.out.println("TopologymanagerTime = "+ (System.currentTimeMillis()-start)); + } + System.exit(0); + } + +} +\end{lstlisting} + +ソースコード \ref{src:StartTopologyManager.java}はTopologyManagerを開始するコードであり、ソースコード\ref{src:TopologyFinish.java}はTopologyManagerの終了部分のコードである。 +本実験において、子ノードのJungleからrootノードのJungleへデータのmergeが終了する時間を計るために、TopologyManagerの開始時、終了時の時間を取得している。ソースコード\ref{src:TopologyFinish.java}の最後では、取得した終了時の時間から、開始時の時間を差し引いた時間を出力している。 +前の説で解説した、データ書き込みプログラム()が投入されると、TopologyManagerが起動し、Jungleへのデータの書き込みが始まる。そしてrootノードのJungleへデータが書き込み終わると共にTopologyManagerが終了するので、TopologyManagerの終了時から開始時を差し引いた時間が、今回の測定範囲となる。 + +ソースコード\ref{src:TopologyFinish.java}の最後にある、currentTimeMillis()はTopologyManagerが終了した現時点の時間である。TopologyManagerの開始時の時間は、以下のソースコード \ref{src:ConfigWaiter.java}で示す。 + +\begin{lstlisting}[frame=lrbt,label=src:ConfigWaiter.java,caption=Aliceに実装したtimestamp部分,numbers=left] +package alice.topology.manager; + +import org.msgpack.type.ValueFactory; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class ConfigWaiter extends CodeSegment { + + public Receiver done = ids.create(CommandType.TAKE); + public int count; + + public ConfigWaiter(int nodeNum) { + this.count = nodeNum; + } + + @Override + public void run() { + count--; + if (count == 0) { + ods.put("local", "start", ValueFactory.createNilValue()); + ods.put("startTime",System.currentTimeMillis()); + ods.update("running", true); + return; + } + ConfigWaiter cs3 = new ConfigWaiter(count); + cs3.done.setKey("local", "done"); + } + +} +\end{lstlisting} +ソースコード \ref{src:ConfigWaiter.java}では、Jungleの起動時につけた-count オプションの引数を取得している。 +ここでは、DataSegmentであるstartTimeに、現在の時間を入れている。この時間が、TopologyManagerの開始時のデータとなる。 + +\begin{lstlisting}[frame=lrbt,label=src:TopologyManagerConfig.java,caption=Aliceに実装したtimestamp部分,numbers=left] +package alice.topology.manager; + +import alice.daemon.Config; + +public class TopologyManagerConfig extends Config { + + public boolean showTime = false; + public String confFilePath; + public boolean dynamic = false; + public TopologyType type = TopologyType.Tree; + public int hasChild = 2; + + public TopologyManagerConfig(String[] args) { + super(args); + for (int i = 0; i < args.length; i++) { + if ("-conf".equals(args[i])) { + confFilePath = args[++i]; + } else if ("--Topology".equals(args[i])) { + String typeName = args[++i]; + if ("tree".equals(typeName)) { + type = TopologyType.Tree; + } + } else if ("--Child".equals(args[i])) { + hasChild = Integer.parseInt(args[++i]); + } else if ("--showTime".equals(args[i])) { + showTime = true; + } + } + + if (confFilePath == null) + dynamic = true; + } + +} +\end{lstlisting} +ソースコード\ref{src:TopologyManagerConfig.java}では、データ書き込みプログラムを投入時、TopologyManagerの起動部分でつけた -showTime オプションの有無を判断している。オプションが存在していれば、実行結果にrootのJungleに書き込まれた時間が表示される。 + + +
--- a/paper/final_main/main.aux Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/main.aux Tue Feb 20 16:55:34 2018 +0900 @@ -50,18 +50,26 @@ \newlabel{Logupdate}{{3.5}{17}} \@writefile{lol}{\contentsline {lstlisting}{\numberline {3.5}測定用プログラムの起動部分}{17}} \@writefile{toc}{\contentsline {section}{\numberline {3.7}時間計測プログラムの実装}{18}} -\newlabel{alipro}{{3.6}{18}} +\newlabel{src:alipro}{{3.6}{18}} \@writefile{lol}{\contentsline {lstlisting}{\numberline {3.6}Aliceに実装した時間計測プログラムのプログラムの起動部分}{18}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第4章}性能評価}{19}} +\newlabel{src:StartTopologyManager.java}{{3.7}{18}} +\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.7}Aliceに実装したtimestamp部分}{18}} +\newlabel{src:TopologyFinish.java}{{3.8}{20}} +\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.8}Aliceに実装したtimestamp部分}{20}} +\newlabel{src:ConfigWaiter.java}{{3.9}{20}} +\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.9}Aliceに実装したtimestamp部分}{20}} +\newlabel{src:TopologyManagerConfig.java}{{3.10}{21}} +\@writefile{lol}{\contentsline {lstlisting}{\numberline {3.10}Aliceに実装したtimestamp部分}{21}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第4章}性能評価}{23}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {4.1}java版jungleの分散性能の評価}{19}} -\@writefile{toc}{\contentsline {section}{\numberline {4.2}性能測定方法の評価}{19}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第5章}結論}{20}} +\@writefile{toc}{\contentsline {section}{\numberline {4.1}java版jungleの分散性能の評価}{23}} +\@writefile{toc}{\contentsline {section}{\numberline {4.2}性能測定方法の評価}{23}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第5章}結論}{24}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {5.1}まとめ}{20}} -\@writefile{toc}{\contentsline {section}{\numberline {5.2}今後の課題}{20}} +\@writefile{toc}{\contentsline {section}{\numberline {5.1}まとめ}{24}} +\@writefile{toc}{\contentsline {section}{\numberline {5.2}今後の課題}{24}} \bibcite{1}{1} \bibcite{2}{2} \bibcite{3}{3}
--- a/paper/final_main/main.log Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/main.log Tue Feb 20 16:55:34 2018 +0900 @@ -1,4 +1,4 @@ -This is e-pTeX, Version 3.14159265-p3.7.1-161114-2.6 (utf8.euc) (TeX Live 2017) (preloaded format=platex 2018.2.19) 19 FEB 2018 17:38 +This is e-pTeX, Version 3.14159265-p3.7.1-161114-2.6 (utf8.euc) (TeX Live 2017) (preloaded format=platex 2018.2.19) 20 FEB 2018 16:52 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -536,22 +536,22 @@ ) \openout1 = `main.aux'. -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for JY1/mc/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. -LaTeX Font Info: Checking defaults for JT1/mc/m/n on input line 78. -LaTeX Font Info: ... okay on input line 78. +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for JY1/mc/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. +LaTeX Font Info: Checking defaults for JT1/mc/m/n on input line 79. +LaTeX Font Info: ... okay on input line 79. \c@lstlisting=\count117 File: fig/ryukyu.pdf Graphic file (type pdf) <fig/ryukyu.pdf> @@ -559,9 +559,9 @@ ] LaTeX Font Info: Font shape `JT1/mc/bx/n' in size <24.88> not available -(Font) Font shape `JT1/gt/m/n' tried instead on input line 87. +(Font) Font shape `JT1/gt/m/n' tried instead on input line 88. LaTeX Font Info: Font shape `JY1/mc/bx/n' in size <24.88> not available -(Font) Font shape `JY1/gt/m/n' tried instead on input line 87. +(Font) Font shape `JY1/gt/m/n' tried instead on input line 88. (./main.toc LaTeX Font Info: Font shape `JT1/mc/bx/n' in size <12> not available (Font) Font shape `JT1/gt/m/n' tried instead on input line 1. @@ -631,36 +631,42 @@ File: pic/LogupdateTree.pdf Graphic file (type pdf) <pic/LogupdateTree.pdf> [14] [15] [16] (./plsource.txt) [17] - -LaTeX Warning: Reference `src:alipro' on page 18 undefined on input line 278. +(./alitopo.txt) [18] +Overfull \hbox (9.35614pt too wide) in paragraph at lines 320--503 +\OT1/cmtt/m/n/12 "finish");cs2.config.setKey("config");cs2.startTime.setKey("st +artTime"); + [] -(./alitopo.txt)) (./chapter4.tex [18] +[19] [20] +Overfull \hbox (182.25623pt too wide) in paragraph at lines 554--568 +\OT1/cmtt/m/n/12 ValueFactory.createNilValue());ods.put("startTime",System.curr +entTimeMillis());ods.update("running", + [] + +[21]) (./chapter4.tex [22] 第 4 章 -[19 +[23 ]) (./chapter5.tex 第 5 章 -) (./bibliography.tex [20 +) (./bibliography.tex [24 -]) (./thanks.tex [21 +]) (./thanks.tex [25 -]) [22 +]) [26 ] (./main.aux) -LaTeX Warning: There were undefined references. - - LaTeX Warning: There were multiply-defined labels. ) Here is how much of TeX's memory you used: - 4050 strings out of 493640 - 49219 string characters out of 6148698 - 237760 words of memory out of 5000000 - 7560 multiletter control sequences out of 15000+600000 + 4053 strings out of 493640 + 49322 string characters out of 6148698 + 379808 words of memory out of 5000000 + 7563 multiletter control sequences out of 15000+600000 16433 words of font info for 66 fonts, out of 8000000 for 9000 929 hyphenation exceptions out of 8191 - 27i,9n,32p,795b,1701s stack positions out of 5000i,500n,10000p,200000b,80000s + 27i,9n,32p,795b,1699s stack positions out of 5000i,500n,10000p,200000b,80000s -Output written on main.dvi (26 pages, 75112 bytes). +Output written on main.dvi (30 pages, 118408 bytes).
--- a/paper/final_main/main.lol Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/main.lol Tue Feb 20 16:55:34 2018 +0900 @@ -4,3 +4,7 @@ \contentsline {lstlisting}{\numberline {3.4}本実験で使用するトポロジーファイルを生成するプログラム}{12} \contentsline {lstlisting}{\numberline {3.5}測定用プログラムの起動部分}{17} \contentsline {lstlisting}{\numberline {3.6}Aliceに実装した時間計測プログラムのプログラムの起動部分}{18} +\contentsline {lstlisting}{\numberline {3.7}Aliceに実装したtimestamp部分}{18} +\contentsline {lstlisting}{\numberline {3.8}Aliceに実装したtimestamp部分}{20} +\contentsline {lstlisting}{\numberline {3.9}Aliceに実装したtimestamp部分}{20} +\contentsline {lstlisting}{\numberline {3.10}Aliceに実装したtimestamp部分}{21}
--- a/paper/final_main/main.tex Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/main.tex Tue Feb 20 16:55:34 2018 +0900 @@ -15,22 +15,22 @@ \lstset{ basicstyle={\ttfamily}, - breaklines=true, + breaklines=true,%自動で折り返す。 columns=[l]{fullflexible}, - commentstyle={\ttfamily}, + commentstyle={\footnotesize\ttfamily}, escapechar={@}, frame=single, framerule=.5pt, identifierstyle={\ttfamily}, keepspaces=true, - keywordstyle={\ttfamily}, + keywordstyle={\footnotesize\ttfamily}, language={}, lineskip=-0.1zw, numbers=left, numbersep=1em, numberstyle={\scriptsize}, stepnumber=1, - stringstyle={\ttfamily}, + stringstyle={\footnotesize\ttfamily}, tabsize=4, xleftmargin=0zw, xrightmargin=0zw, @@ -72,6 +72,7 @@ \makeatletter \newcommand{\figcaption}[1]{\def\@captype{figure}\caption{#1}} \newcommand{\tblcaption}[1]{\def\@captype{table}\caption{#1}} +\def\lst@lettertrue{\let\lst@ifletter\iffalse} % \makeatother \setlength\abovecaptionskip{0pt}
--- a/paper/final_main/main.toc Mon Feb 19 17:39:46 2018 +0900 +++ b/paper/final_main/main.toc Tue Feb 20 16:55:34 2018 +0900 @@ -12,9 +12,9 @@ \contentsline {section}{\numberline {3.5}分散フレームワーク Alice による分散環境の構築}{11} \contentsline {section}{\numberline {3.6}データ書き込みプログラムの実装}{17} \contentsline {section}{\numberline {3.7}時間計測プログラムの実装}{18} -\contentsline {chapter}{\numberline {第4章}性能評価}{19} -\contentsline {section}{\numberline {4.1}java版jungleの分散性能の評価}{19} -\contentsline {section}{\numberline {4.2}性能測定方法の評価}{19} -\contentsline {chapter}{\numberline {第5章}結論}{20} -\contentsline {section}{\numberline {5.1}まとめ}{20} -\contentsline {section}{\numberline {5.2}今後の課題}{20} +\contentsline {chapter}{\numberline {第4章}性能評価}{23} +\contentsline {section}{\numberline {4.1}java版jungleの分散性能の評価}{23} +\contentsline {section}{\numberline {4.2}性能測定方法の評価}{23} +\contentsline {chapter}{\numberline {第5章}結論}{24} +\contentsline {section}{\numberline {5.1}まとめ}{24} +\contentsline {section}{\numberline {5.2}今後の課題}{24}