Skip to content

Implement parallel network discovery - #28

Open
VictorLiwentao wants to merge 1 commit into
Center-For-Complex-Systems-Science:mainfrom
VictorLiwentao:fix/issue-17-n-jobs
Open

VictorLiwentao wants to merge 1 commit into
Center-For-Complex-Systems-Science:mainfrom
VictorLiwentao:fix/issue-17-n-jobs

Conversation

@VictorLiwentao

Copy link
Copy Markdown

Fixes issue #17.

Makes n_jobs actually control parallel execution in discover_network.

The work is parallelized by target variable, with workers returning edges and the parent process building the graph.

Local benchmark on a MacBook Pro with M1 Pro (8 logical CPUs), macOS arm64; synthetic lag-1 Gaussian chain, T=500, max_lag=2, n_shuffles=50, median of 3 runs after warm-up:

  • n=20: 10.13s (n_jobs=1) → 2.51s (n_jobs=-1), ~4.0x speedup
  • n=30: 28.78s (n_jobs=1) → 6.43s (n_jobs=-1), ~4.5x speedup

Serial and parallel runs produced matching graphs.

40 discovery tests pass, and serial/parallel outputs match.

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