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

Adding random generator seed to all pytacs/mphys tests #302

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

timryanb
Copy link
Collaborator

@timryanb timryanb commented Mar 14, 2024

Addresses #301. Should fix intermitent test failures we've been seeing on CI recently

@timryanb timryanb marked this pull request as ready for review March 14, 2024 16:43
@timryanb
Copy link
Collaborator Author

Ran the CI 10 times in a row without any tests failing. The issue seems to be resolved for now

@@ -63,6 +64,9 @@ def setUp(self):
# Populate fd/cs perturbation vectors based on user-defined method
self.setup_tacs_vecs(self.fea_assembler, self.dv_pert, self.xpts_pert)

# Seed random number generator in tacs for consistent test results
elements.SeedRandomGenerator(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does seeding the random generator in elements affect the random generator used by the Eigensolver? Are they the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It calls the same C++ seed function srand that should seed all random number functions used in tacs.

@A-CGray A-CGray merged commit 416c6c7 into smdogroup:master Mar 14, 2024
5 checks passed
@timryanb timryanb deleted the test-rand-seed branch March 14, 2024 17:33
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.

2 participants