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

Cast environment variables to integers #65

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Conversation

cbkerr
Copy link
Member

@cbkerr cbkerr commented Dec 5, 2024

Description

Cast environment variables to integers in example code.

Motivation and context

Ran into the undefined operator error in Communicator where it checks the following with ranks_per_partition as a string.

if self.cpp_mpi_conf.getNRanksGlobal() % ranks_per_partition:

How has this been tested?

I changed the code I copied which fixed the problem. I didn't test the change for getting ACTION_THREADS_PER_PROCESS

Checklist:

  • I have reviewed the Contributor Guidelines.
  • I agree with the terms of the Row Contributor Agreement.
  • My name is on the list of contributors (doc/src/contributors.md) in the pull request source branch.
  • I have added a change log entry to doc/src/release-notes.md.

@joaander
Copy link
Member

joaander commented Dec 5, 2024

Yet another example showing that duck typing is an epic failure. I would also welcome a fix to HOOMD-blue that casts the RHS of that operator to int. Isaac found a similar case where hoomd.variant.box.InverseVolumeRamp should cast parameters before initializing the C++ struct.

@joaander joaander merged commit 3c18956 into trunk Dec 5, 2024
18 checks passed
@joaander joaander deleted the fix/integer-env-vars branch December 5, 2024 17:23
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