<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1016" rel="nofollow">http://projects.scipy.org/scipy/ticket/1016</a> on 2009-10-09 by trac user elambert, assigned to unknown.</em></p>
<p dir="auto">We experienced problems with a script that is executed in MPIRUN on multiple cores (and possibly multiple nodes) because the temporary path used for generation and compilation was not always unique.</p>
<p dir="auto">IN catalog.py, FUNCTION intermediate_dir() AS FOLLOWS :</p>
<p dir="auto">def intermediate_dir():</p>
<p dir="auto">...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mypid=os.getpid()

myhostname = socket.gethostname()

myrandom = random.randint(0,128000)

path = os.path.join(tempfile.gettempdir(),&quot;%s%s%s%i&quot;%(myhostname,whoami(),mypid,myrandom),python_name)"><pre class="notranslate"><code class="notranslate">mypid=os.getpid()

myhostname = socket.gethostname()

myrandom = random.randint(0,128000)

path = os.path.join(tempfile.gettempdir(),"%s%s%s%i"%(myhostname,whoami(),mypid,myrandom),python_name)
</code></pre></div>
<p dir="auto">...</p>
<p dir="auto">see also:<br>
<a href="http://projects.scipy.org/scipy/ticket/1015" rel="nofollow">http://projects.scipy.org/scipy/ticket/1015</a></p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1016" rel="nofollow">http://projects.scipy.org/scipy/ticket/1016</a> on 2009-10-09 by trac user elambert, assigned to unknown.</em></p>
<p dir="auto">We experienced problems with a script that is executed in MPIRUN on multiple cores (and possibly multiple nodes) because the temporary path used for generation and compilation was not always unique.</p>
<p dir="auto">IN catalog.py, FUNCTION intermediate_dir() AS FOLLOWS :</p>
<p dir="auto">def intermediate_dir():</p>
<p dir="auto">...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mypid=os.getpid()

myhostname = socket.gethostname()

myrandom = random.randint(0,128000)

path = os.path.join(tempfile.gettempdir(),&quot;%s%s%s%i&quot;%(myhostname,whoami(),mypid,myrandom),python_name)"><pre class="notranslate"><code class="notranslate">mypid=os.getpid()

myhostname = socket.gethostname()

myrandom = random.randint(0,128000)

path = os.path.join(tempfile.gettempdir(),"%s%s%s%i"%(myhostname,whoami(),mypid,myrandom),python_name)
</code></pre></div>
<p dir="auto">...</p>
<p dir="auto">see also:<br>
<a href="http://projects.scipy.org/scipy/ticket/1015" rel="nofollow">http://projects.scipy.org/scipy/ticket/1015</a></p>