Skip to content

v1.5.3: Parallel processing, timers, OpenMP, facet labels, Rmd user guide#1

Open
Linbojun99 wants to merge 11 commits into
masterfrom
dev
Open

v1.5.3: Parallel processing, timers, OpenMP, facet labels, Rmd user guide#1
Linbojun99 wants to merge 11 commits into
masterfrom
dev

Conversation

@Linbojun99
Copy link
Copy Markdown
Owner

Summary

Major update adding parallel processing, execution timing, and documentation improvements.

New Features

Parallel Processing (ncores parameter)

  • run_acl(ncores): Parallel multi-start optimization via parLapply (socket cluster). Runs N independent optimizations from jittered starting points, keeps the best result. Purpose: robustness (avoid local optima), recommended ncores = 2–4.
  • sim_acl(ncores): Parallel across simulation iterations via mclapply (Mac/Linux) or parLapply (Windows). Purpose: speed.
  • retro_acl(ncores): Parallel across retrospective peels via mclapply/parLapply. Purpose: speed.

Execution Timers

  • run_acl: Reports optimization time, sdreport time, and total time.
  • sim_acl: Reports per-iteration time and total time with success count.
  • retro_acl: Reports full model time, per-peel time, and total time breakdown.

OpenMP Support (ACL.cpp)

  • Replaced Type nll = zero with parallel_accumulator<Type> nll(this) to enable TMB native OpenMP gradient parallelism.
  • compile_acl.R: Auto-detects platform and compiles with OpenMP flags (-fopenmp). Falls back gracefully if OpenMP is unavailable.

Bug Fixes

Facet Label Improvements (7 plot functions)

  • First/last length bins now display as open-ended: Length bin <7, Length bin >49 instead of 5-7, 49-51.
  • Year facets now display as Year 1, Year 2 instead of 1, 2.
  • Added shared helper function .acl_fix_len_labels() in acl_theme.R.
  • Affected functions: plot_abundance, plot_biomass, plot_SSB, plot_CatL, plot_pla, plot_residuals.

Documentation

  • Added ACL_User_Guide.Rmd: Full bilingual (EN/CN) user guide with all features documented.
  • Updated example_1_simulation.R and example_2_YTF_real_data.R with core detection (Step 0) and ncores usage.
  • Updated roxygen docs for run_acl, sim_acl, retro_acl with ncores parameter documentation.

Files Changed

  • R/: run_acl.R, sim_acl.R, retro_acl.R, compile_acl.R, acl_theme.R, plot_abundance.R, plot_biomass.R, plot_SSB.R, plot_CatL.R, plot_pla.R, plot_residuals.R
  • inst/extdata/ACL.cpp
  • scr/example_1_simulation.R, scr/example_2_YTF_real_data.R
  • ACL_User_Guide.Rmd (new)

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