function kod($kod) { global $code; $kod = $code['SS'] . $code['BT'] . gen_binary($kod) . $code['SS']; $i = imagecreate(strlen($kod), 40); $w = imagecolorallocate($i, 255, 255, 255); $b = imagecolorallocate($i, 0, 0, 0); print_code($kod, $i, $b, $w); ob_start(); imagegif($i); $img = ob_get_contents(); ob_end_clean(); return $img; }
function kod($kod) { global $code; if (trim($kod, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $') != '') { error::add('Znaki inne niż cyfry, litery, pauza, kropka, spacja, ukośnik'); } $kod = $code['SS'] . $code['BT'] . gen_binary($kod) . $code['SS']; $i = imagecreate(strlen($kod), 40); $w = imagecolorallocate($i, 255, 255, 255); $b = imagecolorallocate($i, 0, 0, 0); print_code($kod, $i, $b, $w); ob_start(); imagegif($i); $img = ob_get_contents(); ob_end_clean(); return $img; }
<P> Although it should probably be assumed, you'll also need a C/C++ compiler. You'll also need a Fortran compiler if you want to build the Fortran MPI bindings, and a Java compiler if you want to build the (unofficial) Java MPI bindings.</P> <P> The <?php print "<a href=\"https://github.com/open-mpi/ompi/blob/master/HACKING\">"; ?> HACKING file</a> in the top-level directory of the Open MPI checkout details how to install the tools listed above and the steps required to build a developer checkout of Open MPI. It always contains the most current information on how to build a developer's copy of Open MPI.</p> <?php print_code("<strong>shell\$</strong> ./configure --prefix=\$HOME/openmpi-install\n[...lots of output...]"); ?> <p>This configures Open MPI and tells it to install under <code>$HOME/openmpi-install</code>.</p> <!- ------------------------------------------------------------------ --> <P><strong>NOTE:</strong> by default, when configuring and building Open MPI from a developer checkout, <strong><font color="red">all debugging code is enabled.</font></strong> This results in a <strong>significant</strong> run-time performance penalty. There are several options for building an optimzed Open MPI; see the HACKING file for more details.</p> <p><strong>NOTE:</strong> Most Linux distributions and OS X install
{<br/> Console.WriteLine(<span style="color:green">"Hello World"</span>);<br/> }<br/> }<br/> </p> </div> <p> This C# program is first compiled to a .NET executable and then fed into our toolchain to yield the following XMLVM<sub>CLR</sub>: </p> <div class="code_block"> <p> <?php print_code("<vm:xmlvm xmlns:vm=\"http://xmlvm.org\" xmlns:clr=\"http://xmlvm.org/clr\">\n" . " <vm:class name=\"HelloWorld\" extends=\"System.Object\">\n" . " <vm:method name=\"Main\" isStatic=\"true\" isPublic=\"true\" stack=\"8\" locals=\"0\">\n" . " <vm:signature>\n" . " <vm:return type=\"void\" />\n" . " </vm:signature>\n" . " <vm:code>\n" . " <clr:ldc type=\"System.String\" value=\"Hello World\" />\n" . " <clr:call has-this=\"false\" class-type=\"System.Console\" method=\"WriteLine\">\n" . " <vm:signature>\n" . " <vm:return type=\"void\" />\n" . " <vm:parameter type=\"System.String\" />\n" . " </vm:signature>\n" . " </clr:call>\n" . " <clr:return />\n" . " </vm:code>\n" . " </vm:method>\n" . " </vm:class>\n" . "</vm:xmlvm>"); ?> </p> </div> <p> The general structure of XMLVM<sub>CLR</sub> is identical to XMLVM<sub>JVM</sub>. The main difference is that XMLVM<sub>CLR</sub> features byte code instructions supported by the .NET virtual machine. The <tt><clr:ldc></tt> instruction pushes the string "Hello World" onto the stack. The <tt><clr:call></tt> instruction calls the static method <tt>System.Console.WriteLine</tt> with the string "Hello World" as the actual parameter. </p> <?php
print_code("23 4 * * * {$rsync_command}"); ?> <p> Alternatively, a slightly more elegant mechanism to update and mail someone only if there are errors would be to use essentially the same script that is listed in the Git method (above) but replace the "<code>svn up</code>" command with the "<code>rsync ...</code>" command: <?php $rsync_script = $base_script; $rsync_script = preg_replace("/@METHOD@/", "rsync synchronization", $base_script); $rsync_script = preg_replace("/@COMMAND@/", $rsync_command, $rsync_script); $rsync_script = preg_replace("/@SHORT_COMMAND@/", "rsync", $rsync_script); $rsync_script = preg_replace("@/your/local/docroot@", "\"\$docroot\"", $rsync_script); print_code($rsync_script); ?> </li> <p> <li> <strong> Using Subversion </strong> <p> <font color="red">This method is no longer supported.</font> The Open MPI web site is now maintained in Git, not Subversion.</p> <p>If you were previously using subversion, please switch to using Git.</p> </li> </ol>
<p>If the fingerprint shown by your Subversion client matches what is displayed above, it is easiest to (p)ermanently accept the certificate (Subversion will warn you if the fingerprint ever changes).</p> <p>Next, you'll be prompted for your password:</p> <?php print_code("Authentication realm: <https://svn.open-mpi.org:443> PLPA Subversion Access\nPassword for 'your_username':"******"Authentication realm: <https://svn.open-mpi.org:443> PLPA Subversion Access\nPassword for 'your_username':\nAuthentication realm: <https://svn.open-mpi.org:443> PLPA Subversion Access\nUsername:"******"<a href=\"http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.serverconfig.netmodel.credcache\">"; ?> consult the Subversion documentation</a>. <?php
<li> <a href="https://github.com/open-mpi/ompi-release">ompi-release</a>: This repo contains all the Open MPI release branches (i.e., from which official distribution tarballs are made). There are Git tags on the branches in this repo that indicate where official tarballs were made (e.g., "v1.8.3" is the tag corresponding to the Open MPI v1.8.3 release).</li> </ol> </ul> <li>Clone either of these repositories. For example (as of October 2014), to clone the main development repository via HTTPS: <?php print_code("<strong>shell\$</strong> git clone https://github.com/open-mpi/ompi.git\nCloning into 'ompi'...\nremote: Counting objects: 256644, done.\nremote: Total 256644 (delta 0), reused 0 (delta 0)\nReceiving objects: 100% (256644/256644), 61.98 MiB | 2.15 MiB/s, done.\nResolving deltas: 100% (213377/213377), done.\nChecking connectivity... done.\n<strong>shell\$</strong>"); ?> </li> <li>The web interface available by clicking on the above URL shows a nice summary of recent activity and allows navigating into individual commits.</li> <li><font color=red>Once you have successfully cloned the repository, continue on to the <a href="building.php">instructions on how to build from a developer checkout</a>.</font></li> </ol> <p>Note that Git is natively capable of using many forms of web proxies. If your network setup requires the user of a web proxy,
<ol> <li>First, you will need a Git client. We recommend getting the latest version available. If you do not have the command "<code>git</code>" in your path, you will likely need to download and install Git.</li> <li> <a href="https://github.com/open-mpi/otpo">OTPO is hosted at GitHub</a>. <li>Clone this repository. For example (as of October 2014), to clone the main development repository via HTTPS: <?php print_code("<strong>shell\$</strong> git clone https://github.com/open-mpi/otpo.git\nCloning into 'otpo'...\nremote: Counting objects: 1101, done.\nremote: Total 1101 (delta 0), reused 0 (delta 0)\nReceiving objects: 100% (1101/1101), 3.51 MiB | 758.00 KiB/s, done.\nResolving deltas: 100% (557/557), done.\nChecking connectivity... done.\n<strong>shell\$</strong>"); ?> </li> <li>The web interface available by clicking on the above URL shows a nice summary of recent activity and allows navigating into individual commits.</li> </ol> <p>Note that Git is natively capable of using many forms of web proxies. If your network setup requires the user of a web proxy, <?php print "<a href=\"http://git-scm.com/\">"; ?> consult the Git
the Cocoa class <tt>UIButton</tt>. When a click handler is added to an <tt>android.widget.Button</tt> instance, method <tt>setOnClickListener()</tt> adds an instance of the Cocoa class <tt>UIControlDelegate</tt> to the <tt>UIButton</tt> via the corresponding method <tt>addTarget()</tt>. The code below will be cross-compiled to Objective-C: </p> <div style="float:right"><object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/TG-NIt2O5J8&hl=en_US&fs=1&color1=0x5d1719&color2=0xcd311b"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TG-NIt2O5J8&hl=en_US&fs=1&color1=0x5d1719&color2=0xcd311b" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object> <a href="http://xmlvm.org/slides/android2iphone-google-mtv.pdf" style="margin-top:4px;" target="_blank"><br/>Download the slides as PDF</a> </div> <div class="code_block"> <p> <?php print_code("package android.widget;\n" . "\n" . "public class Button extends View {\n" . " protected UIButton button;\n" . "\n" . " // ...\n" . "\n" . " public void setOnClickListener(OnClickListener listener) {\n" . " final OnClickListener theListener = listener;\n" . " button.addTarget(new UIControlDelegate() {\n" . "\n" . " @Override\n" . " public void raiseEvent() {\n" . " theListener.onClick(Button.this);\n" . " }\n" . "\n" . " }, UIControl.UIControlEventTouchUpInside);\n" . " }\n" . "}\n"); ?> </p> </div> <script> function popupDemo() { var newwindow=window.open("demo", "_blank", "height=600,width=910"); if (window.focus) {newwindow.focus()} return false; } </script> XMLVM includes a demo that demonstrates the power of cross-compiling Android applications to the iPhone. The demo is an Android version of the classic Sokoban game called Xokoban. An <a href="#" onclick="popupDemo();">
?> </p> </div> <p> Since Objective-C does not support overloading of methods with identical selectors, XMLVM uses name-mangling to differentiate between different overloaded versions of a method. Apart of language-level cross-compilation, iPhone applications depend on iPhone-specific widgets. XMLVM features a prototype implementation of a Java version of the Cocoa API. The following iPhone application demonstrates a GUI version of "Hello World" in Java: </p> <div class="code_block"> <p> <?php print_code("public class HelloWorld extends UIApplication\n" . "{\n" . " public void applicationDidFinishLaunching(NSNotification n)\n" . " {\n" . " UIScreen screen = UIScreen.mainScreen();\n" . " CGRect rect = screen.applicationFrame();\n" . " UIWindow window = new UIWindow(rect);\n" . "\n" . " rect.origin.x = rect.origin.y = 0;\n" . " UIView mainView = new UIView(rect);\n" . " window.addSubview(mainView);\n" . "\n" . " UILabel title = new UILabel(rect);\n" . " title.setText(\"Hello World!\");\n" . " title.setTextAlignment(UITextAlignment.UITextAlignmentCenter);\n" . " mainView.addSubview(title);\n" . "\n" . " window.makeKeyAndVisible();\n" . " }\n" . "}\n"); ?> </p> </div> <p> The Java application above can be cross-compiled to Objective-C and executed on an iPhone. The Cocoa-specific Java classes such as <tt>UIWindow</tt> and <tt>UIView</tt> are mapped to their Objective-C counter-parts. XMLVM also features a Swing-based implementation of these Cocoa classes that make it possible to run a Java-based iPhone application on a desktop. The resulting iPhone simulator is shown below as a Java applet. The accelerometer controls influence the orientation of the fireworks. On a real iPhone the sparks will follow gravity: </p> <script>
</p> <table cellpadding="5" border="0" width="90%" align="center"> <tr> <th width="50%">GNU Tar</th> <th width="50%">Non-GNU Tar</th> </tr> <tr> <td valign="top"> <?php print_code("shell% cd \$HOME\nshell% tar jcvf ompi-output.tar.bz2 ompi-output\n#...lots of output...\nshell% "); ?> </td> <td valign="top"> <?php print_code("shell% cd \$HOME\nshell% tar cvf ompi-output.tar ompi-output\n#...lots of output...\nshell% bzip2 ompi-output.tar\nshell% "); ?> </td> </tr> </table> </p> <P> Then send the resulting <code>ompi-output.tar.bz2</code> file to the mailing list.</p> <p><strong>NOTE:</strong> The mailing lists <em>do</em> have size limits on attachments. If your post is rejected because the attachment is too large, try compressing at a higher level. If that does not work, then try posting your file on the internet somewhere and sending a link to it on the list.
<p> As can be seen, the <tt><clr:ldc></tt> (<em>load constant</em>) pushes one integer onto the type stack, while the <tt><clr:rem></tt> (<em>remainder after division</em>) pops off two integers and pushes one back onto the type-stack. Each element of the type stack is represented by the <tt><elem></tt> tag. Based on the information computed by the DFA, it is possible to map CLR instructions to the JVM. This can be accomplished by XSL stylesheets with appropriate XPath expressions. The following XSL template maps the <tt><clr:rem></tt> instruction to <tt><jvm:irem></tt> if the top of the type stack has an integer: </p> <div class="code_block"> <p> <?php print_code("<xsl:template match=\"clr:rem[stack-post/elem[last()][@type = 'int']]\">\n" . " <jvm:irem/>\n" . "</xsl:template>"); ?> </p> </div> <p> To demonstrate this approach, we have written a C# version of the calculator that was also used for the AJAX demo. The following links show the various artifacts created during the cross-compilation process: </p> <p> <ul> <li><a href="Calculator.cs" target="blank">Calculator.cs</a>: C# source code of this calculator using WinForms as the GUI library.</li> <li><a href="Calculator.xmlvm-clr" target="blank">Calculator.xmlvm-clr</a>: the XMLVM<sub>CLR</sub> version of <tt>Calculator.cs</tt></li> <li><a href="Calculator.xmlvm-clr-dfa" target="blank">Calculator.xmlvm-clr-dfa</a>: the XMLVM<sub>CLR-DFA</sub> version showing the result of the DFA.</li>
JavaScript code. </p> <p> The XMLVM generated by the <a href="../frontend">front-end</a> can be mapped to JavaScript using XSL stylesheets. The general approach is to mimic the stack-based virtual machine in the target language by declaring helper variables for the stack and stack-pointer. Consider the <tt><jvm:irem></tt> instruction (<em>integer remainder</em>) that pops two integers off the stack and pushes the remainder after division back onto the stack. Using the following XSL template, the <tt><jvm:irem></tt> instruction can be mapped to JavaScript: </p> <div class="code_block"> <p> <?php print_code("<xsl:template match=\"jvm:irem\">\n" . " <xsl:text>\n" . " __op2 = __stack[--__sp]; // Pop operand 1\n" . " __op1 = __stack[--__sp]; // Pop operand 2\n" . " __stack[__sp++] = __op1 % __op2; // Push remainder\n" . " </xsl:text>\n" . "</xsl:template>\n"); ?> </p> </div> <p> Variable <tt>__stack</tt> represents the runtime stack, whereas <tt>__sp</tt> refers to the top of the stack. Pre-decrement and post-increment operations are used for popping and pushing of arguments respectively. The following JavaScript program is the cross-compiled version of "Hello World": </p> <div class="code_block"> <p> qx.Class.define(<span style="color:green">"org_xmlvm_test_HelloWorld"</span>, {<br/> extend: java_lang_Object,<br/> statics:<br/>
<li> 6- Gatherv, </li> <li> 7- Allgatherv, </li> <li> 8- Alltoall, </li> <li> 9- Alltoallv, </li> <li> 10- Scatter, </li> <li> 11- Scatterv)</li> </ul> <li> -a Number of processes (if using Skampi)</li> <li> -e Operation for Reduce/Allreduce like MPI_MAX</li> <li> -x generate an input file from an ouput result file</li> </ul></p> <p>A sample run command would be:</p> <p> <?php print_code("./otpo -p OpenIB_Parameters -t Netpipe -w path_to_where_netpipe_is_compiled/NPmpi"); ?> </p> <p>The --generate_input_file (-x) option is a feature that allows a user to give OTPO previously generated result files. OTPO would then use these files to parse the parameters and the values noted as the best values for those parameters and generate a new input parameter file from them automatically. This can be done using UNION or INTERSECTION of the files, which should be specified with the operation parameter -e or --operations.</p> <p>An example to run this feature on three result file (R1 R2 and R3): ./otpo -x R1 R2 R3 -e union -o union_input_file ./otpo -x R1 R2 R3 -e intersection -o intersection_input_file </p>