Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/diffusion/anisotropy.py fails from base fipy directory #271

Closed
wd15 opened this issue Sep 19, 2014 · 13 comments
Closed

examples/diffusion/anisotropy.py fails from base fipy directory #271

wd15 opened this issue Sep 19, 2014 · 13 comments

Comments

@wd15
Copy link
Contributor

wd15 commented Sep 19, 2014

It works when you're in examples/diffusion, but not from the base directory. The error is

(trunk)bunter[wd15]: python examples/diffusion/anisotropy.py
Traceback (most recent call last):
 File "/users/wd15/Documents/python/fipy/trunk/examples/diffusion/anisotropy.py",
line 139, in <module>
   exec(fipy.tests.doctestPlus._getScript())
 File "<string>", line 51, in <module>
 File "/users/wd15/Documents/python/fipy/trunk/fipy/meshes/gmshImport.py",
line 503, in __init__
   order=order)
 File "/users/wd15/Documents/python/fipy/trunk/fipy/meshes/gmshImport.py",
line 138, in __init__
   f = open(self.filename, "r") # open the msh file
IOError: [2](Errno) No such file or directory:
'examples/diffusion/anisotropy.msh'

Imported from trac ticket #367, created by wd15 on 10-07-2011 at 15:00, last modified: 11-08-2011 at 17:15

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

I noticed that inserting an os.getcwd() before
trunk/fipy/meshes/gmshImport.py#L138 returns
/users/wd15/Documents/python/fipy/CLEAN/examples/diffusion. So,
it's not surprising that L138 in gmshImport.py can't find
examples/diffusion/anisotropy.msh. I noticed the following oddity

(trunk)bunter[wd15]: python examples/diffusion/tmp.py
/users/wd15/Documents/python/fipy/CLEAN
/users/wd15/Documents/python/fipy/CLEAN/examples/diffusion

where tmp.py is simply

import os
print os.getcwd() 
from fipy import *
import os
print os.getcwd()

Next step is that the above script needs
to be run on one of the environments for which
python examples/diffusion/anisotropyTmp.py actually works to see
if fipy changing the cwd is actually the issue.

Trac comment by wd15 on 10-07-2011 at 17:36

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Running the test script on sandbox gives

wd15@Sandbox:~/Documents/python/fipy/trunk$ python examples/diffusion/tmp.py 
/home/wd15/Documents/python/fipy/trunk
/home/wd15/Documents/python/fipy/trunk

and the anisotropy test case runs fine. It has the following configuration

fipy version 2.2-dev4804
numpy version 1.5.1
pysparse version 1.1
PyTrilinos version 4.4
scipy version 0.8.0
matplotlib version 0.99.3
gist is not installed
mpi4py version 1.2.2
enthought.mayavi version

python version 2.7

Trac comment by wd15 on 10-11-2011 at 11:15

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Here is bunter's config

fipy version 2.2-dev4799
numpy version 1.6.1
pysparse version 1.2-dev
PyTrilinos version 4.4
scipy version 0.9.0
matplotlib version 1.0.1
gist is not installed
mpi4py is not installed
mpi4py is not installed

python version 2.5.2

I'll wait for Jon to run this in the CTCMS and look at the differences.

Trac comment by wd15 on 10-11-2011 at 11:25

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Replying to wd15:

Next step is that the above script needs
to be run on one of the environments for which
python examples/diffusion/anisotropyTmp.py actually works to see
if fipy changing the cwd is actually the issue.

On dogbert

(virtualbrew)dogbert:trunk-CLEAN guyer$ python examples/diffusion/tmp.py 
/Users/guyer/Documents/research/FiPy/trunk-CLEAN
/Users/guyer/Documents/research/FiPy/trunk-CLEAN

Python 2.7.2 on Snow Leopard 10.6.8

fipy version 2.2-dev4804
numpy version 1.6.1
pysparse version 1.2-dev
PyTrilinos version 4.4
scipy version 0.9.0
matplotlib version 1.1.0
gist is not installed
mpi4py version 1.2.2
mayavi version 4.0.0

Trac comment by guyer on 10-11-2011 at 14:20

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Replying to guyer:

On dogbert

And on alice

(solar)alice[guyer]: python examples/diffusion/tmp.py
/users/guyer/FiPy/trunk-CLEAN
/users/guyer/FiPy/trunk-CLEAN

Python 2.5.2 with

fipy version 2.2-dev4804
numpy version 1.5.1
pysparse version 1.2-dev
PyTrilinos version 4.1
scipy version 0.8.0
matplotlib version 1.1.0svn
gist is not installed
mpi4py version 1.2.2
mpi4py is not installed

Trac comment by guyer on 10-11-2011 at 14:27

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

After debugging, it seems that PyTrilinos is the culprit, since

import os
print os.getcwd()
from PyTrilinos import Epetra
print os.getcwd()

throws

(trunk)bunter[wd15]: python examples/diffusion/tmp.py
/users/wd15/Documents/python/fipy/CLEAN
/users/wd15/Documents/python/fipy/CLEAN/examples/diffusion

Trac comment by wd15 on 10-11-2011 at 17:22

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

The version of Trilinos is 10.6.4. Jon, what version of Trilinos do you have installed on alice?

Trac comment by wd15 on 10-11-2011 at 17:53

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Replying to wd15:

The version of Trilinos is 10.6.4. Jon, what version of Trilinos do you have installed on alice?

I don't, at least not properly. The version check on PyTrilinos succeeds, but the Epetra import fails with some LD error I haven't debugged yet.

Trac comment by guyer on 10-11-2011 at 18:24

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

I've spent way to long trying to set up a debug environment, see blog:DebugEnvi. Going to use print statements now to try and debug.

Trac comment by wd15 on 11-04-2011 at 10:47

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Trying to get a stack trace, but for some reason gdb just hangs when I call pystack??? I know I've captured the process correctly because the tests stop when the process is attached and it restarts after pushing "c". It hangs at a different place though 39 steps rather than 28. That may be because of print statements also. Actually, adding debug PRINT statements changed the number of steps to hang.

Trac comment by wd15 on 11-04-2011 at 11:53

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Also the hang isn't occurring in the same place as Jon's hang in issue #264. I put print statements around the map calls in trilinosMatrix.py and it doesn't hang there.

Trac comment by wd15 on 11-04-2011 at 11:57

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Replying to wd15:

After debugging, it seems that PyTrilinos is the culprit,

Is this related to the weird working directory shenanigans that Max had to do when he originally wrote the Trilinos solvers?

r2312/branches/maxTest1/fipy/solvers/trilinos/init.py

Trac comment by guyer on 11-08-2011 at 08:47

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Okay, this works now on bunter with python 2.6 so I'm closing it out.

Trac comment by wd15 on 11-08-2011 at 17:15

@wd15 wd15 closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants