<div>Hi,</div>
<div>&nbsp;</div>
<div>I am trying to call MPI.Net from IronPython 1.1.1 in the following script.&nbsp; The problem is IronPython automatically converts my MPI.Environment() object into a tuple type, so that the object cannot be disposed at the end of with statement.</div>

<div>&nbsp;</div>
<div>the following is what I did:</div>
<div>1) write a __future__.py containing the following 2 lines:</div>
<div>division=1<br>with_statement=1</div>
<div>&nbsp;</div>
<div>2) run my script like: ipy.exe -X:Python25 pi.py</div>
<div>Got error here:</div>
<div>Traceback (most recent call last):<br>&nbsp; File d:\tools\IronPython-1.1.1\pi.py, line 19, in Initialize<br>AttributeError: &#39;tuple&#39; object has no attribute &#39;__exit__&#39;<br>ERROR: MPI.Environment not finalized.<br>
Please call Dispose() on your MPI.Environment object.</div>
<div>&nbsp;</div>
<div>Can you tell me what&#39;s wrong with the script? can I avoid to the conversion from MPI.Environment object to tuple? Thanks,</div>
<div>&nbsp;</div>
<div># This is a IronPython program to calculate PI using MPI.Net.<br># Usage (For IronPython 1.1.1):<br>#&nbsp;&nbsp; ipy.exe -X:Python25 pi.py</div>
<p>from __future__ import with_statement<br>import sys<br>import clr<br>import System</p>
<p>sys.path.append(&quot;C:\Program Files (x86)\<a href="http://MPI.NET">MPI.NET</a>\Lib&quot;)<br>clr.AddReferenceToFile(&quot;MPI.dll&quot;)<br>import MPI</p>
<div>with MPI.Environment(argarrayref) as mpienv:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n=100<br></div>
<div>Liwei</div>
<div>&nbsp;</div>