Skip to content

Update mpi_numpi.py #27

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

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

faysalkhan8p
Copy link

No description provided.

@faysalkhan8p
Copy link
Author

Now the seed uses rank

def inside_circle(total_count):

np.random.seed(2022*rank)
Copy link
Member

Choose a reason for hiding this comment

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

Aren't you now resetting the seed here every time the function is called? A rank specific seed is indeed necessary...perhaps this deserves an explanatory comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

The function is only called once. Would it be clearer if the seed is set once the rank has been determined, for example on line 9?

Copy link
Member

Choose a reason for hiding this comment

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

I think that would be the right thing to do, there are two subtle things going on that should be clarified in a comment (or in the lesson?): you only set the seed once in your application, and the seed of each rank should be different.

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.

3 participants