Hi all, I'm finding a problem with the new communicator stuff in ParallelAnalysisInterface in r322fe24bb0cb. Specifically, .comm is being initialized to None. With a short script like this: ~~~~~~~~~~~~ from yt.mods import * from yt.utilities.parallel_tools.parallel_analysis_interface import \ ParallelAnalysisInterface class humbug(ParallelAnalysisInterface): def __init__(self): pass bah = humbug() print bah.comm ~~~~~~~~~~~~ I get "None", which is not correct, I think. I've found that if I modify things to look like this below in parallel_analysis_interface.py, it works. But I don't think that's how things are supposed to work. Could someone who understands what's supposed to happen take a look at this? I suppose _grids and _distributed would also suffer from the same problem. Thanks! ~~~~~~~~~~~~ class ParallelAnalysisInterface(object): comm = communication_system.communicators[-1] _grids = None _distributed = None def __init__(self): self.comm = communication_system.communicators[-1] self._grids = self.comm._grids self._distributed = self.comm._distributed ~~~~~~~~~~~~~~ -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
Hi Stephen, On Thu, Oct 20, 2011 at 11:06 PM, Stephen Skory <s@skory.us> wrote:
Hi all,
I'm finding a problem with the new communicator stuff in ParallelAnalysisInterface in r322fe24bb0cb. Specifically, .comm is being initialized to None. With a short script like this:
~~~~~~~~~~~~
from yt.mods import * from yt.utilities.parallel_tools.parallel_analysis_interface import \ ParallelAnalysisInterface
class humbug(ParallelAnalysisInterface): def __init__(self): pass
bah = humbug()
print bah.comm
That is correct; PAI's initializer must now be called. Is there a subclass that's missing that? The PAI initializer grabs the communicator on the top of the stack. Have you seen issues with _grids or _distributed, that aren't being hit by the test suite? The small data is now passing, and it should have coverage of DQ's, profiles (1 and 2D), PHOP and so on. -Matt
~~~~~~~~~~~~
I get "None", which is not correct, I think. I've found that if I modify things to look like this below in parallel_analysis_interface.py, it works. But I don't think that's how things are supposed to work. Could someone who understands what's supposed to happen take a look at this? I suppose _grids and _distributed would also suffer from the same problem. Thanks!
~~~~~~~~~~~~
class ParallelAnalysisInterface(object): comm = communication_system.communicators[-1] _grids = None _distributed = None
def __init__(self): self.comm = communication_system.communicators[-1] self._grids = self.comm._grids self._distributed = self.comm._distributed
~~~~~~~~~~~~~~
-- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice) _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Matt,
That is correct; PAI's initializer must now be called. Is there a subclass that's missing that? The PAI initializer grabs the communicator on the top of the stack. Have you seen issues with _grids or _distributed, that aren't being hit by the test suite? The small data is now passing, and it should have coverage of DQ's, profiles (1 and 2D), PHOP and so on.
I'm seeing a crash in camera.py where trying to use "self.comm.rank" is dying because "self.comm" is None. Can you point me to an example of where the initializer is correctly called (as much for my own development as a human being as for this specific problem)? -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
Hi Stephen, It looks like the other derived camera classes that were overwriting __init__ didn't have the ParallelAnalysisInterface initialization, which has now been fixed in: https://bitbucket.org/yt_analysis/yt/changeset/510d1815e9af/ Basically you have to send "self" to the PAI __init__() function, as you'll see in the diff on that changeset. Hope that helps. Sam On Fri, Oct 21, 2011 at 6:56 AM, Stephen Skory <s@skory.us> wrote:
Matt,
That is correct; PAI's initializer must now be called. Is there a subclass that's missing that? The PAI initializer grabs the communicator on the top of the stack. Have you seen issues with _grids or _distributed, that aren't being hit by the test suite? The small data is now passing, and it should have coverage of DQ's, profiles (1 and 2D), PHOP and so on.
I'm seeing a crash in camera.py where trying to use "self.comm.rank" is dying because "self.comm" is None. Can you point me to an example of where the initializer is correctly called (as much for my own development as a human being as for this specific problem)?
-- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice) _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (3)
-
Matthew Turk
-
Sam Skillman
-
Stephen Skory