Skip to content

Conversation

@farhadrclass
Copy link
Contributor

Cleaned up the code and rebased on newest changes from #167

@farhadrclass farhadrclass requested a review from dpo January 21, 2025 16:48
@farhadrclass
Copy link
Contributor Author

@dpo I rebased on the your changes and cleaned up the git pushes

@dpo dpo changed the title PR move from old branch Parallel benchmarks Jan 22, 2025
CUTEst problems).
#### Keyword arguments
* `use_threads::Bool`: whether to use threads (default: `true`);
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this keyword? Threads should be enabled/disabled with the environment variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the use_threads keyword is valuable to keep, even with the environment variable, for the following reasons:

Testing and Debugging: This flag allows us to explicitly override the environment variable during testing or debugging. It’s particularly useful to verify that the application behaves correctly in both threaded and non-threaded modes without re-writing the functionality in the unit tests.

Fine-Grained User Control: Some users may want to override the global threading setting for specific scenarios:

They might want to disable threading for this application while leaving it enabled for other programs to avoid resource contention.

I think keeping this flag ensures flexibility and adaptability, making the tool more useful for both development and usage scenarios.

Copy link
Member

Choose a reason for hiding this comment

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

A user who doesn’t set JULIA_NUM_THREADS is not expected anything to run multi-threaded, yet use_threads will be true. I think that only introduces confusion.

kwargs...,
) where {TName}

# Collect information about counters
Copy link
Member

Choose a reason for hiding this comment

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

Please remove these comments and blank lines that do not have anything to do with the new functionality.


for (id, problem) in enumerate(problems)
# Convert problems to an indexable vector
problem_list = collect(problems)
Copy link
Member

Choose a reason for hiding this comment

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

We really do not want this. If problems is a generator of all CUTEst models, this line will try to materialize them all at once and hold them all in memory simultaneously, which is not acceptable.

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