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

DM-12766: Add __reduce__ to CoaddDriver so to know how to pickle #41

Merged
merged 2 commits into from
Nov 27, 2017

Conversation

hsinfang
Copy link

Running coaddDriver with cores >1 has been producing MPI_Abort(MPI_COMM_WORLD, 1)

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of style changes requested, and one important omission: the __reduce__ method doesn't preserve the reuse argument.

def __reduce__(self):
"""Pickler"""
return unpickle, (self.__class__, [], dict(config=self.config, name=self._name,
parentTask=self._parentTask, log=self.log))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent to match paren above.

def unpickle(factory, args, kwargs):
"""Unpickle something by calling a factory"""
return factory(*args, **kwargs)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two lines between function and class.

def __reduce__(self):
"""Pickler"""
return unpickle, (self.__class__, [], dict(config=self.config, name=self._name,
parentTask=self._parentTask, log=self.log))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's reuse?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch. Adding it to MultiBandDriver too.

@hsinfang hsinfang merged commit 1492ab6 into master Nov 27, 2017
@ktlim ktlim deleted the tickets/DM-12766 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants