This archive was generated by
When you execute it, do check that you are using the home directory since this is the only one shared by all modes and master by default.
Also, I notice you use iron python. To simplify things, can you run using sshmaster and sshnode. This may give you additional indication on what is going on.
I am unsure of a solution, yet these seem reasonable steps to check.
I hope this helps narrow down the issue.
Sent from my iPhone
On Aug 18, 2014, at 2:49 PM, Ya Xue <yxue_at_measinc.com> wrote:
> I have a script that needs to import a module and the module name is given as an input parameter. It works well on a local machine but generates “ImportError” with StarCluster. Here is a simple script that can reproduce the error:
> def imp(fname):
> if fname[-3:] == '.py':
> fname = fname[:-3]
> exec('import ' + fname + ' as params')
> print params.alpha
> f = open(fname+'_alpha.txt', 'w')
> f.write('%f' % params.alpha)
> If I run it on the StarCluster master, no problem:
> In : run error.py
> In : imp('p1.py')
> However, on the cluster:
> In : from IPython.parallel import Client
> In : c = Client()
> In : v = c[:]
> In : files = ['p1.py','p2.py','p3.py']
> In : r = v.map(imp, files)
> In : r
> ImportError Traceback (most recent call last)<string> in <module>()
> /home/ya/Code/error.py in imp(fname)
> 4 if fname[-3:] == '.py':
> 5 fname = fname[:-3]
> ----> 6 exec('import ' + fname + ' as params')
> 7 print params.alpha
> 8 f = open(fname+'_alpha.txt', 'w')
> <string> in <module>()
> ImportError: No module named p1
> Does anyone know how to fix it?
> This email (including any attachments) may contain confidential information intended solely for acknowledged recipients. If you think you have received this information in error, please reply to the sender and delete all copies from your system. Please note that unauthorized use, disclosure, or further distribution of this information is prohibited by the sender. Note also that we may monitor email directed to or originating from our network. Thank you for your consideration and assistance. |
> StarCluster mailing list
Received on Tue Aug 19 2014 - 11:21:00 EDT