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

Added simple support for Thread Count setter - partially tested #394

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

bemcdonnell
Copy link
Member

Closes #172

Interested in seeing how the unit tests play out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should check after the simulation using massbal_getRoutingTotal to check if the threads are set.
Also, I assume this will overwrite the Threads from INP file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should also make sure INP threads are retained with this addition. We should add a test to make sure swmm_setSimulationParam is reading the threads set in the INP file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, Mac probably needs to revert to an older version of the OS supported by actions.

Copy link
Member Author

Choose a reason for hiding this comment

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

@abhiramm7 when project.c parses the INP file the THREADS are first set there. This feature only avails that change if the user wants to change it through the API. We also set the same limits / rules as the project.c has.. (>=1 and <= Max Threads Available). The mac build finally ran and it checks out


#if defined(_OPENMP)
error = swmm_setSimulationParam(SM_THREADS, 2);
error = swmm_setSimulationParam(SM_THREADS, &value);
Copy link
Member

Choose a reason for hiding this comment

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

@bemcdonnell, can we change line 429 to use swmm_getSimulationParam? I think you are trying to set the param, then check that it was set properly, but I'm not sure the code does this currently.

Copy link
Member Author

Choose a reason for hiding this comment

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

OOOF good catch!!!! Doing that now

@bemcdonnell bemcdonnell requested review from karosc and abhiramm7 June 17, 2023 00:16
@bemcdonnell bemcdonnell merged commit 033a9f7 into develop Jun 19, 2023
@karosc karosc deleted the dev_api_threadcount branch September 2, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants