File: ppdoc.html

package info (click to toggle)
parallelpython 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 400 kB
  • sloc: python: 1,459; makefile: 35
file content (184 lines) | stat: -rw-r--r-- 30,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Parallel Python - Parallel Python documentation</title>
<meta name="title" content="Parallel Python documentation" />
<meta name="author" content="Administrator" />
<meta name="description" content="Parallel Python" />
<meta name="keywords" content="parallel python" />
<meta name="Generator" content="Joomla! - Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved." />
<meta name="robots" content="index, follow" />
<script language="JavaScript" type="text/javascript" src="http://www.parallelpython.com/forum/Themes/default/script.js?rc2"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
			var smf_theme_url = "http://www.parallelpython.com/forum/Themes/default";
			var smf_images_url = "http://www.parallelpython.com/forum/Themes/default/images";
			var smf_scripturl = "http://www.parallelpython.com/component/option,com_smf/Itemid,28/";
			var smf_session_id = "48ff31d1970c688e3f847f901e82316d";
			// ]]></script>
<link rel="help" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/action,help/" target="_blank" />
<link rel="search" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/action,search/" />
<link rel="contents" href="http://www.parallelpython.com/component/option,com_smf/Itemid,28/" />
<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/" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
			<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ 
			var current_header = false; 
 
          function shrinkHeader(mode) 
          { document.cookie = "upshrink=" + (mode ? 1 : 0);   document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif"); 
 
               document.getElementById("upshrinkHeader").style.display = mode ? "none" : ""; 
               document.getElementById("upshrinkHeader2").style.display = mode ? "none" : ""; 
 
               current_header = mode; 
				} 
				// ]]></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ 
               var current_header_ic = false; 
 
               function shrinkHeaderIC(mode) 
               {
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif"); 
 
                    document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : ""; 
 
                    current_header_ic = mode; 
               } 
          // ]]></script>
<base href="http://www.parallelpython.com/" />
	<link rel="shortcut icon" href="http://www.parallelpython.com/images/favicon.ico" />
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="netinsert" content="0.0.1.3.4.8.1" />
<link href="http://www.parallelpython.com/templates/vivacious14/css/template_css.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="http://www.parallelpython.com/images/favicon.ico" />
</head>
<body>
<div id="outer" class="outer">
	<div class="section1">
		<div class="sitename">Parallel Python</div>
		<div class="sitedate">
    	</div>
		<div id="pathway_outer" class="pathway_outer">
			<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>
            <div style='float:right;'><div class="g-plusone" data-size="small" data-count="false"></div></div>
            <div class="addthis_toolbox addthis_default_style" style='float: right; display: inline-block; text-align: right;'>
            <nobr>
            <a class="addthis_button_preferred_1"></a>
            <a class="addthis_button_preferred_2"></a>
            <a class="addthis_button_preferred_3"></a>
            <a class="addthis_button_preferred_4"></a>
            <a class="addthis_button_preferred_5"></a>
            <a class="addthis_button_preferred_6"></a>
            <a class="addthis_button_preferred_7"></a>
            <a class="addthis_button_preferred_8"></a>
            <a class="addthis_button_compact"></a>    
            </nobr>
            </div>
        <script type='text/javascript'>
        var addthis_config = {
            pubid: 'linkedweb',
        };
        </script>
        <script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=linkedweb' async></script>
        <script type='text/javascript' src='https://apis.google.com/js/plusone.js' async></script>  
		</div>
	</div>
	<div class="section2">
					<div id="user3" class="user3">
						<table cellpadding="0" cellspacing="0" class="moduletable">
				<tr>
			<td>
				<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>
		</tr>
		</table>
					</div>
				<!--commented by Vitalii div class="logo"><img src="http://www.parallelpython.com/templates/vivacious14/images/logo.gif" alt="Free Mambo Templates TY2U.com"></div-->
				<div class="topspace">
					<table cellpadding="0" cellspacing="0" class="moduletable">
				<tr>
			<td>
				<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>
		</tr>
		</table>
				</div>
			</div>
	<div class="section3">
		<!--div class="search_outer">
		  <div class="search_inner">
				<form action="index.php" method="post">
				  <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='';" />
					<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>
				  <input type="hidden" name="option" value="search" />
				</form>
			</div>
		</div-->
			</div>
		<div class="section5">
			</div>
	<div class="section6">

		<div class="mainbody">
						<table class="contentpaneopen">
			<tr>
								<td class="contentheading" width="100%">
					Parallel Python documentation									</td>
							<td align="right" width="100%" class="buttonheading">
				<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">
					<img src="http://www.parallelpython.com/images/M_images/pdf_button.png"  alt="PDF" name="PDF" align="middle" border="0" /></a>
			</td>
							<td align="right" width="100%" class="buttonheading">
					<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">
						<img src="http://www.parallelpython.com/images/M_images/printButton.png"  alt="Print" name="Print" align="middle" border="0" /></a>
				</td>
							<td align="right" width="100%" class="buttonheading">
				<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">
					<img src="http://www.parallelpython.com/images/M_images/emailButton.png"  alt="E-mail" name="E-mail" align="middle" border="0" /></a>
			</td>
						</tr>
			</table>
			
		<table class="contentpaneopen">
				<tr>
			<td valign="top" colspan="2">
				<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>
		</tr>
				</table>
		
		<span class="article_seperator">&nbsp;</span>
		
				</div>
	</div>
	<div class="section7">
				<div class="bottom">
					<table cellpadding="0" cellspacing="0" class="moduletable">
				<tr>
			<td>
				<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>
		</tr>
		</table>
				</div>
						<div class="footer">
						
<div align="center">
<font color="gray">Parallel Python Solutions | Parallel Python Forums | Parallel Python Community</font>
</div>
<br/>
<div align="center">
<font color="gray">Parallel Python	&copy; 2005 - 2012 Vitalii Vanovschi. All rights reserved</font>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-404570-4";
urchinTracker();
</script>
		</div>
				</div>
</div>
</body>
</html>
<!-- 1338709149 -->