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

feat!: add compile time flags to disable rayon #240

Merged
merged 10 commits into from
Aug 27, 2024
Merged

Conversation

kevaundray
Copy link
Contributor

No description provided.

@kevaundray kevaundray marked this pull request as draft August 22, 2024 15:59
Comment on lines 25 to 26
singlethreading = ["bls12_381/blst-no-threads"]
multithreading = ["maybe_rayon/multithreading"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably should standardize this to single-thread, multi-thread

eip7594/Cargo.toml Outdated Show resolved Hide resolved

impl DASContext {
#[cfg(feature = "multithreading")]
pub fn with_threads(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rename this to new so that when users switch from single to multithread, they just need to modify the number of parameters

thread_pool: Arc<ThreadPool>,
pub prover_ctx: ProverContext,
pub verifier_ctx: VerifierContext,
}

#[cfg(feature = "multithreading")]
impl Default for DASContext {
fn default() -> Self {
let trusted_setup = TrustedSetup::default();
const DEFAULT_NUM_THREADS: ThreadCount = ThreadCount::Single;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might make sense to make the default SensibleDefault and then have that use the global threadpool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In terms of defaults, single-thread, global threadpool and then a feature flag for local threadpool with threadcount might be the best, or just ask users to import threadpool in their own crate and set the threadpool amount themselves

@kevaundray kevaundray marked this pull request as ready for review August 27, 2024 09:22
@kevaundray kevaundray added this pull request to the merge queue Aug 27, 2024
Merged via the queue into master with commit d472d60 Aug 27, 2024
44 of 47 checks passed
@kevaundray kevaundray changed the title chore: add compile time flags to disable rayon feat: add compile time flags to disable rayon Aug 27, 2024
@kevaundray kevaundray changed the title feat: add compile time flags to disable rayon feat!: add compile time flags to disable rayon Aug 27, 2024
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.

1 participant