PageRenderTime 56ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/support/pp-1.6.2/doc/ppdoc.html

https://github.com/supergis/GIScript
HTML | 180 lines | 158 code | 11 blank | 11 comment | 0 complexity | abc28bc9802218dab0d0c29663e8a866 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-3.0
  1. <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Parallel Python - Parallel Python documentation</title>
  5. <meta name="title" content="Parallel Python documentation" />
  6. <meta name="author" content="Administrator" />
  7. <meta name="description" content="Parallel Python" />
  8. <meta name="keywords" content="parallel python" />
  9. <meta name="Generator" content="Joomla! - Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved." />
  10. <meta name="robots" content="index, follow" />
  11. <script language="JavaScript" type="text/javascript" src="http://www.parallelpython.com/forum/Themes/default/script.js?rc2"></script>
  12. <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
  13. var smf_theme_url = "http://www.parallelpython.com/forum/Themes/default";
  14. var smf_images_url = "http://www.parallelpython.com/forum/Themes/default/images";
  15. var smf_scripturl = "http://www.parallelpython.com/component/option,com_smf/Itemid,28/";
  16. var smf_session_id = "48ff31d1970c688e3f847f901e82316d";
  17. // ]]></script>
  18. <link rel="help" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/action,help/" target="_blank" />
  19. <link rel="search" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/action,search/" />
  20. <link rel="contents" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/" />
  21. <link rel="alternate" type="application/rss+xml" title="Parallel Python Community Forums - RSS" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/type,rss;action,.xml/" />
  22. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  23. <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
  24. var current_header = false;
  25. function shrinkHeader(mode)
  26. { document.cookie = "upshrink=" + (mode ? 1 : 0); document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
  27. document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
  28. document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
  29. current_header = mode;
  30. }
  31. // ]]></script>
  32. <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
  33. var current_header_ic = false;
  34. function shrinkHeaderIC(mode)
  35. {
  36. document.cookie = "upshrinkIC=" + (mode ? 1 : 0);
  37. document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
  38. document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
  39. current_header_ic = mode;
  40. }
  41. // ]]></script>
  42. <base href="http://www.parallelpython.com/" />
  43. <link rel="shortcut icon" href="http://www.parallelpython.com/images/favicon.ico" />
  44. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  45. <meta name="netinsert" content="0.0.1.3.4.8.1" />
  46. <link href="http://www.parallelpython.com/templates/vivacious14/css/template_css.css" rel="stylesheet" type="text/css" />
  47. <link rel="shortcut icon" href="http://www.parallelpython.com/images/favicon.ico" />
  48. </head>
  49. <body>
  50. <div id="outer" class="outer">
  51. <div class="section1">
  52. <div class="sitename">Parallel Python</div>
  53. <div class="sitedate">
  54. </div>
  55. <div id="pathway_outer" class="pathway_outer">
  56. <div id="pathway" class="pathway" style='float:left;width:50%;'><span class="pathway"><a href="http://www.parallelpython.com/" class="pathway">Home</a> <img src="http://www.parallelpython.com/images/M_images/arrow.png" alt="arrow" /> Documents </span></div>
  57. <div style='float:right;'><div class="g-plusone" data-size="small" data-count="false"></div></div>
  58. <div class="addthis_toolbox addthis_default_style" style='float: right; display: inline-block; text-align: right;'>
  59. <nobr>
  60. <a class="addthis_button_preferred_1"></a>
  61. <a class="addthis_button_preferred_2"></a>
  62. <a class="addthis_button_preferred_3"></a>
  63. <a class="addthis_button_preferred_4"></a>
  64. <a class="addthis_button_preferred_5"></a>
  65. <a class="addthis_button_preferred_6"></a>
  66. <a class="addthis_button_preferred_7"></a>
  67. <a class="addthis_button_preferred_8"></a>
  68. <a class="addthis_button_compact"></a>
  69. </nobr>
  70. </div>
  71. <script type='text/javascript'>
  72. var addthis_config = {
  73. pubid: 'linkedweb',
  74. };
  75. </script>
  76. <script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=linkedweb' async></script>
  77. <script type='text/javascript' src='https://apis.google.com/js/plusone.js' async></script>
  78. </div>
  79. </div>
  80. <div class="section2">
  81. <div id="user3" class="user3">
  82. <table cellpadding="0" cellspacing="0" class="moduletable">
  83. <tr>
  84. <td>
  85. <ul id="mainlevel-nav"><li><a href="http://www.parallelpython.com/" class="mainlevel-nav" >Home</a></li><li><a href="http://www.parallelpython.com/component/option,com_smf/Itemid,29/" class="mainlevel-nav" >Forums</a></li><li><a href="http://www.parallelpython.com/content/view/15/30/" class="mainlevel-nav" id="active_menu-nav">Documents</a></li><li><a href="http://www.parallelpython.com/content/view/17/31/" class="mainlevel-nav" >Examples</a></li><li><a href="http://www.parallelpython.com/content/view/18/32/" class="mainlevel-nav" >Download</a></li><li><a href="http://www.parallelpython.com/component/option,com_weblinks/Itemid,23/" class="mainlevel-nav" >Links</a></li><li><a href="http://www.pythonblogs.com" class="mainlevel-nav" >Blogs</a></li><li><a href="http://www.parallelpython.com/component/option,com_contact/Itemid,3/" class="mainlevel-nav" >Contact Us</a></li></ul> </td>
  86. </tr>
  87. </table>
  88. </div>
  89. <!--commented by Vitalii div class="logo"><img src="http://www.parallelpython.com/templates/vivacious14/images/logo.gif" alt="Free Mambo Templates TY2U.com"></div-->
  90. <div class="topspace">
  91. <table cellpadding="0" cellspacing="0" class="moduletable">
  92. <tr>
  93. <td>
  94. <a href='http://www.nutritionvalue.org'><img src='/images/nv_banner.png' alt='Nutrition facts and analysis' title='Nutrition facts and analysis' style='border:0'></a> <br /> </td>
  95. </tr>
  96. </table>
  97. </div>
  98. </div>
  99. <div class="section3">
  100. <!--div class="search_outer">
  101. <div class="search_inner">
  102. <form action="index.php" method="post">
  103. <input class="inputbox" type="text" name="searchword" size="15" tabindex="1" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" />
  104. <br /><input name="submit" type="image" src="http://www.parallelpython.com/templates/vivacious14/images/search.gif" class="searchbutton" tabindex="2" value="Search"/> <div class="advsearch"><a href="/index.php?option=com_search">Advanced Search</a></div>
  105. <input type="hidden" name="option" value="search" />
  106. </form>
  107. </div>
  108. </div-->
  109. </div>
  110. <div class="section5">
  111. </div>
  112. <div class="section6">
  113. <div class="mainbody">
  114. <table class="contentpaneopen">
  115. <tr>
  116. <td class="contentheading" width="100%">
  117. Parallel Python documentation </td>
  118. <td align="right" width="100%" class="buttonheading">
  119. <a href="http://www.parallelpython.com/index2.php?option=com_content&amp;do_pdf=1&amp;id=15" target="_blank" onclick="window.open('http://www.parallelpython.com/index2.php?option=com_content&amp;do_pdf=1&amp;id=15','win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'); return false;" title="PDF">
  120. <img src="http://www.parallelpython.com/images/M_images/pdf_button.png" alt="PDF" name="PDF" align="middle" border="0" /></a>
  121. </td>
  122. <td align="right" width="100%" class="buttonheading">
  123. <a href="http://www.parallelpython.com/index2.php?option=com_content&amp;task=view&amp;id=15&amp;pop=1&amp;page=0&amp;Itemid=30" target="_blank" onclick="window.open('http://www.parallelpython.com/index2.php?option=com_content&amp;task=view&amp;id=15&amp;pop=1&amp;page=0&amp;Itemid=30','win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'); return false;" title="Print">
  124. <img src="http://www.parallelpython.com/images/M_images/printButton.png" alt="Print" name="Print" align="middle" border="0" /></a>
  125. </td>
  126. <td align="right" width="100%" class="buttonheading">
  127. <a href="http://www.parallelpython.com/index2.php?option=com_content&amp;task=emailform&amp;id=15&amp;itemid=30" target="_blank" onclick="window.open('http://www.parallelpython.com/index2.php?option=com_content&amp;task=emailform&amp;id=15&amp;itemid=30','win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=250,directories=no,location=no'); return false;" title="E-mail">
  128. <img src="http://www.parallelpython.com/images/M_images/emailButton.png" alt="E-mail" name="E-mail" align="middle" border="0" /></a>
  129. </td>
  130. </tr>
  131. </table>
  132. <table class="contentpaneopen">
  133. <tr>
  134. <td valign="top" colspan="2">
  135. <p>&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#API">Module API</a> <br />&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#QUICKSMP">Quick start guide, SMP</a><br />&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#QUICKCLUSTERS">Quick start guide, clusters<br />&nbsp;</a><a href="http://www.parallelpython.com/content/view/15/30/#QUICKCLUSTERSAUTO">Quick start guide, clusters with auto-discovery</a><br /> &nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#ADVANCEDCLUSTERS">Advanced guide, clusters</a><br /> &nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#COMMANDLINE">Command line arguments, ppserver.py</a><br />&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#SECURITY">Security and secret key</a><br />&nbsp;<a href="component/option,com_smf/Itemid,29/topic,210.msg653#msg653" title="PP FAQ">PP FAQ</a> </p><hr /> <p>&nbsp;</p><h1 id="API">&nbsp; pp 1.6.2 module API</h1> <p> <table border="0" cellspacing="0" cellpadding="2" width="100%" summary="section"> <tbody><tr bgcolor="#ffc8d8"> <td colspan="3" valign="bottom">&nbsp;<br /> <font face="helvetica, arial" color="#000000"><a name="Server" title="Server"></a>class <strong>Server</strong></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan="2">&nbsp;&nbsp;&nbsp;</td> <td colspan="2">Parallel&nbsp;Python&nbsp;SMP&nbsp;execution&nbsp;server&nbsp;class<br />&nbsp;</td></tr> <tr><td>&nbsp;</td> <td width="100%">Methods defined here:<br /> <dl><dt><a name="Server-__init__" title="Server-__init__"></a><strong>__init__</strong>(self, ncpus<font color="#909090">=&#39;autodetect&#39;</font>, ppservers<font color="#909090">=()</font>, secret<font color="#909090">=None</font>, restart<font color="#909090">=False</font>, proto<font color="#909090">=2</font>, socket_timeout<font color="#909090">=3600</font>)</dt><dd>Creates&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#Server">Server</a>&nbsp;instance<br /> &nbsp;</dd><dd>&nbsp;</dd><dd>&nbsp;</dd><dd> ncpus&nbsp;-&nbsp;the&nbsp;number&nbsp;of&nbsp;worker&nbsp;processes&nbsp;to&nbsp;start&nbsp;on&nbsp;the&nbsp;local&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;computer,&nbsp;if&nbsp;parameter&nbsp;is&nbsp;omitted&nbsp;it&nbsp;will&nbsp;be&nbsp;set&nbsp;to&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system<br /> ppservers&nbsp;-&nbsp;list&nbsp;of&nbsp;active&nbsp;parallel&nbsp;python&nbsp;execution&nbsp;servers&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;connect&nbsp;with<br /> secret&nbsp;-&nbsp;passphrase&nbsp;for&nbsp;network&nbsp;connections,&nbsp;if&nbsp;omitted&nbsp;a&nbsp;default<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;passphrase&nbsp;will&nbsp;be&nbsp;used.&nbsp;It&#39;s&nbsp;highly&nbsp;recommended&nbsp;to&nbsp;use&nbsp;a&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;custom&nbsp;passphrase&nbsp;for&nbsp;all&nbsp;network&nbsp;connections.<br /></dd><dd>restart&nbsp;- whether to&nbsp;restart&nbsp;worker&nbsp;process&nbsp;after&nbsp;each&nbsp;task&nbsp;completion&nbsp;<br /> proto&nbsp;-&nbsp;protocol&nbsp;number&nbsp;for&nbsp;pickle&nbsp;module</dd><dd>socket_timeout - socket timeout in seconds which is also the maximum <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time a remote job could be executed. Increase this value<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if you have long running jobs or decrease if connectivity<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to remote ppservers is often lost. <br /></dd><dd>&nbsp; <br /> With&nbsp;ncpus&nbsp;=&nbsp;1&nbsp;all&nbsp;tasks&nbsp;are&nbsp;executed&nbsp;consequently<br /> For&nbsp;the&nbsp;best&nbsp;performance&nbsp;either&nbsp;use&nbsp;the&nbsp;default&nbsp;&quot;autodetect&quot;&nbsp;value<br /> or&nbsp;set&nbsp;ncpus&nbsp;to&nbsp;the&nbsp;total&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system</dd></dl><dl><dt><a name="Server-destroy" title="Server-destroy"></a><strong>destroy</strong>(self)</dt><dd>Kills&nbsp;ppworkers&nbsp;and&nbsp;closes&nbsp;open&nbsp;files</dd></dl> <dl><dt><a name="Server-get_active_nodes" title="Server-get_active_nodes"></a><strong>get_active_nodes</strong>(self)</dt><dd>Returns&nbsp;active&nbsp;nodes&nbsp;as&nbsp;a&nbsp;dictionary&nbsp;<br /> [keys&nbsp;-&nbsp;nodes,&nbsp;values&nbsp;-&nbsp;ncpus]</dd></dl> <dl><dt><a name="Server-get_ncpus" title="Server-get_ncpus"></a><strong>get_ncpus</strong>(self)</dt><dd>Returns&nbsp;the&nbsp;number&nbsp;of&nbsp;local&nbsp;worker&nbsp;processes&nbsp;(ppworkers)</dd></dl> <dl><dt><a name="Server-get_stats" title="Server-get_stats"></a><strong>get_stats</strong>(self)</dt><dd>Returns&nbsp;job&nbsp;execution&nbsp;statistics&nbsp;as&nbsp;a&nbsp;dictionary</dd></dl><dl><dt><a name="Server-print_stats" title="Server-print_stats"></a><strong>print_stats</strong>(self)</dt><dd>Prints&nbsp;job&nbsp;execution&nbsp;statistics.&nbsp;Useful&nbsp;for&nbsp;benchmarking&nbsp;on&nbsp;<br /> clusters</dd></dl> <dl><dt><a name="Server-set_ncpus" title="Server-set_ncpus"></a><strong>set_ncpus</strong>(self, ncpus<font color="#909090">=&#39;autodetect&#39;</font>)</dt><dd>Sets&nbsp;the&nbsp;number&nbsp;of&nbsp;local&nbsp;worker&nbsp;processes&nbsp;(ppworkers)<br /> &nbsp;<br /> ncpus&nbsp;-&nbsp;the&nbsp;number&nbsp;of&nbsp;worker&nbsp;processes,&nbsp;if&nbsp;parammeter&nbsp;is&nbsp;omitted<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;will&nbsp;be&nbsp;set&nbsp;to&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system</dd></dl> <dl><dt><a name="Server-submit" title="Server-submit"></a><strong>submit</strong>(self, func, args<font color="#909090">=()</font>, depfuncs<font color="#909090">=()</font>, modules<font color="#909090">=()</font>, callback<font color="#909090">=None</font>, callbackargs<font color="#909090">=()</font>, group<font color="#909090">=&#39;default&#39;</font>, globals<font color="#909090">=None</font>)</dt><dd>Submits&nbsp;function&nbsp;to&nbsp;the&nbsp;execution&nbsp;queue<br /> &nbsp;<br /> func&nbsp;-&nbsp;function&nbsp;to&nbsp;be&nbsp;executed<br /> args&nbsp;-&nbsp;tuple&nbsp;with&nbsp;arguments&nbsp;of&nbsp;the&nbsp;&#39;func&#39;<br /> depfuncs&nbsp;-&nbsp;tuple&nbsp;with&nbsp;functions&nbsp;which&nbsp;might&nbsp;be&nbsp;called&nbsp;from&nbsp;&#39;func&#39;<br /> modules&nbsp;-&nbsp;tuple&nbsp;with&nbsp;module&nbsp;names&nbsp;to&nbsp;import<br /> callback&nbsp;-&nbsp;callback&nbsp;function&nbsp;which&nbsp;will&nbsp;be&nbsp;called&nbsp;with&nbsp;argument&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list&nbsp;equal&nbsp;to&nbsp;callbackargs+(result,)&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;soon&nbsp;as&nbsp;calculation&nbsp;is&nbsp;done<br /> callbackargs&nbsp;-&nbsp;additional&nbsp;arguments&nbsp;for&nbsp;callback&nbsp;function<br /> group&nbsp;-&nbsp;job&nbsp;group,&nbsp;is&nbsp;used&nbsp;when&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#Server-wait">wait</a>(group)&nbsp;is&nbsp;called&nbsp;to&nbsp;wait&nbsp;for<br /> jobs&nbsp;in&nbsp;a&nbsp;given&nbsp;group&nbsp;to&nbsp;finish<br /> globals&nbsp;-&nbsp;dictionary&nbsp;from&nbsp;which&nbsp;all&nbsp;modules,&nbsp;functions&nbsp;and&nbsp;classes<br /> will&nbsp;be&nbsp;imported,&nbsp;for&nbsp;instance:&nbsp;globals=globals()</dd></dl> <dl><dt><a name="Server-wait" title="Server-wait"></a><strong>wait</strong>(self, group<font color="#909090">=None</font>)</dt><dd>Waits&nbsp;for&nbsp;all&nbsp;jobs&nbsp;in&nbsp;a&nbsp;given&nbsp;group&nbsp;to&nbsp;finish.<br /> If&nbsp;group&nbsp;is&nbsp;omitted&nbsp;waits&nbsp;for&nbsp;all&nbsp;jobs&nbsp;to&nbsp;finish</dd></dl> <dl><dt><strong>default_port</strong> = 60000</dt></dl> <dl><dt><strong>default_secret</strong> = &#39;epo20pdosl;dksldkmm&#39;</dt></dl> </td></tr></tbody></table> </p><p> <table border="0" cellspacing="0" cellpadding="2" width="100%" summary="section"> <tbody><tr bgcolor="#ffc8d8"> <td colspan="3" valign="bottom">&nbsp;<br /> <font face="helvetica, arial" color="#000000"><a name="Template" title="Template"></a>class <strong>Template</strong></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan="2">&nbsp;&nbsp;&nbsp;</td> <td colspan="2"><a href="http://www.parallelpython.com/content/view/15/30/#Template">Template</a>&nbsp;class<br />&nbsp;</td></tr> <tr><td>&nbsp;</td> <td width="100%">Methods defined here:<br /> <dl><dt><a name="Template-__init__" title="Template-__init__"></a><strong>__init__</strong>(self, job_server, func, depfuncs<font color="#909090">=()</font>, modules<font color="#909090">=()</font>, callback<font color="#909090">=None</font>, callbackargs<font color="#909090">=()</font>, group<font color="#909090">=&#39;default&#39;</font>, globals<font color="#909090">=None</font>)</dt><dd>Creates&nbsp;<a href="http://www.parallelpython.com/content/view/15/30/#Template">Template</a>&nbsp;instance<br /> &nbsp;<br /> jobs_server&nbsp;-&nbsp;pp&nbsp;server&nbsp;for&nbsp;submitting&nbsp;jobs<br /> func&nbsp;-&nbsp;function&nbsp;to&nbsp;be&nbsp;executed<br /> depfuncs&nbsp;-&nbsp;tuple&nbsp;with&nbsp;functions&nbsp;which&nbsp;might&nbsp;be&nbsp;called&nbsp;from&nbsp;&#39;func&#39;<br /> modules&nbsp;-&nbsp;tuple&nbsp;with&nbsp;module&nbsp;names&nbsp;to&nbsp;import<br /> callback&nbsp;-&nbsp;callback&nbsp;function&nbsp;which&nbsp;will&nbsp;be&nbsp;called&nbsp;with&nbsp;argument&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list&nbsp;equal&nbsp;to&nbsp;callbackargs+(result,)&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;soon&nbsp;as&nbsp;calculation&nbsp;is&nbsp;done<br /> callbackargs&nbsp;-&nbsp;additional&nbsp;arguments&nbsp;for&nbsp;callback&nbsp;function<br /> group&nbsp;-&nbsp;job&nbsp;group,&nbsp;is&nbsp;used&nbsp;when&nbsp;wait(group)&nbsp;is&nbsp;called&nbsp;to&nbsp;wait&nbsp;for<br /> jobs&nbsp;in&nbsp;a&nbsp;given&nbsp;group&nbsp;to&nbsp;finish<br /> globals&nbsp;-&nbsp;dictionary&nbsp;from&nbsp;which&nbsp;all&nbsp;modules,&nbsp;functions&nbsp;and&nbsp;classes<br /> will&nbsp;be&nbsp;imported,&nbsp;for&nbsp;instance:&nbsp;globals=globals()</dd></dl> <dl><dt><a name="Template-submit" title="Template-submit"></a><strong>submit</strong>(self, *args)</dt><dd>Submits&nbsp;function&nbsp;with&nbsp;*arg&nbsp;arguments&nbsp;to&nbsp;the&nbsp;execution&nbsp;queue</dd></dl> </td></tr></tbody></table></p><p> <table border="0" cellspacing="0" cellpadding="2" width="100%" summary="section"> <tbody><tr bgcolor="#55aa55"> <td colspan="3" valign="bottom">&nbsp;<br /> <font face="helvetica, arial" color="#ffffff"><strong>Data</strong></font></td></tr> <tr><td bgcolor="#55aa55">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;</td> <td width="100%"><strong>copyright</strong> = &#39;Copyright (c) 2005-2012 Vitalii Vanovschi. All rights reserved&#39;<br /> <strong>version</strong> = &#39;1.6.2&#39;</td></tr></tbody></table> </p><hr /><h1 id="QUICKSMP">&nbsp; Quick start guide, SMP<br /></h1> <p>1) Import pp module:</p><p><strong>&nbsp;&nbsp;&nbsp; import pp</strong></p><p>2) Start pp execution server with the number of workers set to&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system </p><p><strong>&nbsp;&nbsp;&nbsp; job_server = pp.Server()&nbsp;</strong></p><p>3) Submit all the tasks for parallel execution:</p><p><strong>&nbsp;&nbsp;&nbsp; f1 = job_server.submit(func1, args1, depfuncs1, modules1)</strong></p><p><strong>&nbsp;&nbsp;&nbsp; f2 = job_server.submit(func1, args2, depfuncs1, modules1) </strong></p><p><strong>&nbsp;&nbsp;&nbsp; f3 = job_server.submit(func2, args3, depfuncs2, modules2) </strong><br /> </p><p>&nbsp;&nbsp; ...etc...<br /></p><p>4) Retrieve the results as needed:</p><p><strong>&nbsp;&nbsp;&nbsp; r1 = f1()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r2 = f2()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r3 = f3()&nbsp;</strong> </p><p>&nbsp;&nbsp;&nbsp; ...etc...</p><p>&nbsp;To find out how to achieve efficient parallelization with pp please take a look at <a href="content/view/17/31/" title="Parallel Python Implementation Examples">examples</a> </p> <hr /><h1 id="QUICKCLUSTERS">&nbsp; Quick start guide, clusters&nbsp; </h1><p><em><strong>On the nodes</strong></em> <br /></p><p>1) Start parallel python execution server on all your remote computational nodes:</p><p><strong>&nbsp;&nbsp;&nbsp; node-1&gt; ./ppserver.py </strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-2&gt; ./ppserver.py</strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-3&gt; ./ppserver.py</strong></p><p><em><strong>On the client</strong></em> <br /></p><p>2) Import pp module:</p><p><strong>&nbsp;&nbsp;&nbsp; import pp</strong></p><p>3)&nbsp; Create a list of all the nodes in your cluster (computers where you&#39;ve run ppserver.py) </p><p><strong>&nbsp;&nbsp;&nbsp; ppservers=(&quot;node-1&quot;, &quot;node-2&quot;, &quot;node-3&quot;)</strong><br /></p><p>4) Start pp execution server with the number of workers set to&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system and list of ppservers to connect with :</p><p><strong>&nbsp;&nbsp;&nbsp; job_server = pp.Server(</strong><strong>ppservers=</strong><strong>ppservers</strong><strong>)&nbsp;</strong></p><p>5) Submit all the tasks for parallel execution:</p><p><strong>&nbsp;&nbsp;&nbsp; f1 = job_server.submit(func1, args1, depfuncs1, modules1)</strong></p><p><strong>&nbsp;&nbsp;&nbsp; f2 = job_server.submit(func1, args2, depfuncs1, modules1) </strong></p><p><strong>&nbsp;&nbsp;&nbsp; f3 = job_server.submit(func2, args3, depfuncs2, modules2) </strong><br /> </p><p>&nbsp;&nbsp; ...etc...<br /></p><p>6) Retrieve the results as needed:</p><p><strong>&nbsp;&nbsp;&nbsp; r1 = f1()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r2 = f2()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r3 = f3()&nbsp;</strong> </p><p>&nbsp;&nbsp;&nbsp; ...etc...</p><p>&nbsp;To find out how to achieve efficient parallelization with pp please take a look at <a href="content/view/17/31/" title="Parallel Python Implementation Examples">examples</a></p> <hr /><h1 id="QUICKCLUSTERSAUTO">&nbsp; Quick start guide, clusters with autodiscovery<br /> </h1><p><em><strong>On the nodes</strong></em>&nbsp;</p><p>1) Start parallel python execution server on all your remote computational nodes:</p><p><strong>&nbsp;&nbsp;&nbsp; node-1&gt; ./ppserver.py -a<br /> </strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-2&gt; ./ppserver.py -a</strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-3&gt; ./ppserver.py -a<br /></strong></p><p><em><strong>On the client</strong></em></p><p>2) Import pp module:</p><p><strong>&nbsp;&nbsp;&nbsp; import pp</strong></p><p>3)&nbsp; Set ppservers list to auto-discovery: </p><p><strong>&nbsp;&nbsp;&nbsp; ppservers=(&quot;*&quot;,)</strong><br /></p><p>4) Start pp execution server with the number of workers set to&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system and list of ppservers to connect with :</p><p><strong>&nbsp;&nbsp;&nbsp; job_server = pp.Server(</strong><strong>ppservers=</strong><strong>ppservers</strong><strong>)&nbsp;</strong></p><p>5) Submit all the tasks for parallel execution:</p><p><strong>&nbsp;&nbsp;&nbsp; f1 = job_server.submit(func1, args1, depfuncs1, modules1)</strong></p><p><strong>&nbsp;&nbsp;&nbsp; f2 = job_server.submit(func1, args2, depfuncs1, modules1) </strong></p><p><strong>&nbsp;&nbsp;&nbsp; f3 = job_server.submit(func2, args3, depfuncs2, modules2) </strong><br /> </p><p>&nbsp;&nbsp; ...etc...<br /></p><p>6) Retrieve the results as needed:</p><p><strong>&nbsp;&nbsp;&nbsp; r1 = f1()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r2 = f2()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r3 = f3()&nbsp;</strong> </p><p>&nbsp;&nbsp;&nbsp; ...etc...</p><p>&nbsp;To find out how to achieve efficient parallelization with pp please take a look at <a href="content/view/17/31/" title="Parallel Python Implementation Examples">examples</a>&nbsp; </p><hr /><h1 id="ADVANCEDCLUSTERS">&nbsp;&nbsp;&nbsp; Advanced guide, clusters&nbsp; </h1> <p><em><strong>On the nodes</strong></em> &nbsp;</p><p>1) Start parallel python execution server on all your remote computational nodes (listen to a given port 35000,<br /> and local network interface only, accept only connections which know correct secret):</p><p><strong>&nbsp;&nbsp;&nbsp; node-1&gt; ./ppserver.py -p 35000 -i 192.168.0.101 -s &quot;mysecret&quot;<br /></strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-2&gt; ./ppserver.py -p 35000 -i 192.168.0.102</strong><strong> -s &quot;mysecret&quot;</strong></p><p><strong>&nbsp;&nbsp;&nbsp; node-3&gt; ./ppserver.py -p 35000 -i 192.168.0.103</strong><strong> -s &quot;mysecret&quot;</strong></p><p><em><strong>On the client</strong></em> <br /></p> <p>2) Import pp module:</p><p><strong>&nbsp;&nbsp;&nbsp; import pp</strong></p><p>3)&nbsp; Create a list of all the nodes in your cluster (computers where you&#39;ve run ppserver.py) </p><p><strong>&nbsp;&nbsp;&nbsp; ppservers=(&quot;node-1:35000&quot;, &quot;node-2:</strong><strong>35000</strong><strong>&quot;, &quot;node-3:</strong><strong>35000</strong><strong>&quot;)</strong><br /></p><p>4) Start pp execution server with the number of workers set to&nbsp;the&nbsp;number&nbsp;of&nbsp;processors&nbsp;in&nbsp;the&nbsp;system, <br />list of ppservers to connect with and secret key to authorize the connection:</p><p><strong>&nbsp;&nbsp;&nbsp; job_server = pp.Server(</strong><strong>ppservers=</strong><strong>ppservers</strong><strong>, secret=&quot;</strong><strong>mysecret</strong><strong>&quot;)&nbsp;</strong></p><p>5) Submit all the tasks for parallel execution:</p><p><strong>&nbsp;&nbsp;&nbsp; f1 = job_server.submit(func1, args1, depfuncs1, modules1)</strong></p><p><strong>&nbsp;&nbsp;&nbsp; f2 = job_server.submit(func1, args2, depfuncs1, modules1) </strong></p><p><strong>&nbsp;&nbsp;&nbsp; f3 = job_server.submit(func2, args3, depfuncs2, modules2) </strong><br /> </p><p>&nbsp;&nbsp; ...etc...<br /></p><p>6) Retrieve the results as needed:</p><p><strong>&nbsp;&nbsp;&nbsp; r1 = f1()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r2 = f2()</strong></p><p><strong>&nbsp;&nbsp;&nbsp; r3 = f3()&nbsp;</strong> </p><p>&nbsp;&nbsp;&nbsp; ...etc...</p><p>&nbsp;7) Print the execution statistics:<br /></p><p><strong>&nbsp;&nbsp;&nbsp; job_server.print_stats()</strong></p><p>To find out how to achieve efficient parallelization with pp please take a look at <a href="content/view/17/31/" title="Parallel Python Implementation Examples">examples</a> </p><hr /><h1 id="COMMANDLINE">&nbsp; Command line options, ppserver.py </h1> <pre>Usage: ppserver.py [-hda] [-i interface] [-b broadcast] [-p port] [-w nworkers] [-s secret] [-t seconds]<br /> Options:<br /> -h : this help message<br /> -d : debug<br /> -a : enable auto-discovery service<br /> -i interface : interface to listen<br /> -b broadcast : broadcast address for auto-discovery service<br /> -p port : port to listen<br /> -w nworkers : number of workers to start<br /> -s secret : secret for authentication<br /> -t seconds : timeout to exit if no connections with clients exist<br /> -k seconds : socket timeout in seconds <br /></pre><hr /><h1 id="COMMANDLINE">&nbsp; Security and secret key<a name="SECURITY" title="SECURITY"></a></h1><p>&nbsp;Due to the security concerns it is highly recommended to run ppserver.py with an non-trivial secret key (-s command line argument) which should be paired with the matching <em>secret</em> keyword of PP Server class constructor. Since PP 1.5.3 it is possible to set secret key by assigning <strong>pp_secret</strong> variable in the configuration file <strong>.pythonrc.py</strong> which should be located in the user home directory (please make this file readable and writable only by user). The key set in .pythonrc.py could be overridden by command line argument (for ppserver.py) and <em>secret</em> keyword (for PP Server class constructor). </p> </td>
  136. </tr>
  137. </table>
  138. <span class="article_seperator">&nbsp;</span>
  139. </div>
  140. </div>
  141. <div class="section7">
  142. <div class="bottom">
  143. <table cellpadding="0" cellspacing="0" class="moduletable">
  144. <tr>
  145. <td>
  146. <a href='http://www.nutritionvalue.org'><img src='/images/nv_banner.png' alt='Nutrition facts and analysis' title='Nutrition facts and analysis' style='border:0'></a> <br /> </td>
  147. </tr>
  148. </table>
  149. </div>
  150. <div class="footer">
  151. <div align="center">
  152. <font color="gray">Parallel Python Solutions | Parallel Python Forums | Parallel Python Community</font>
  153. </div>
  154. <br/>
  155. <div align="center">
  156. <font color="gray">Parallel Python &copy; 2005 - 2012 Vitalii Vanovschi. All rights reserved</font>
  157. </div>
  158. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  159. </script>
  160. <script type="text/javascript">
  161. _uacct = "UA-404570-4";
  162. urchinTracker();
  163. </script>
  164. </div>
  165. </div>
  166. </div>
  167. </body>
  168. </html>
  169. <!-- 1338709149 -->