Skip to content

Add/Fix parfor shared variable in Murat_dataParallelized#48

Merged
LucaDeSiena merged 4 commits into
MuRAT4from
add/envelope
Apr 16, 2026
Merged

Add/Fix parfor shared variable in Murat_dataParallelized#48
LucaDeSiena merged 4 commits into
MuRAT4from
add/envelope

Conversation

@GaiaCaporale
Copy link
Copy Markdown
Collaborator

Replaced shared counter countTrash with a logical mask trashMask inside the parfor loop.

Each iteration now marks discarded traces independently using:
trashMask(i) = true

The total number of rejected traces is computed after the loop with:
countTrash = sum(trashMask)

This improves robustness and follows best practices for parallel MATLAB loops, avoiding potential issues with shared/reduction variables.

No changes in results or workflow.

GaiaCaporale and others added 4 commits March 19, 2026 11:44
Add envelope function in bin and readme on how to use it in input file. also modified line 52 in Murat_Qc.m
Added the envelopeSmoothTime parameter to all example input files (MSH, Romania, Toba) in the Waveform Data section, ensuring consistency with the updated Murat_envelope.m function and README documentation
Replaced shared counter `countTrash` with a logical mask `trashMask` inside the parfor loop.

Each iteration now marks discarded traces independently using:
    trashMask(i) = true

The total number of rejected traces is computed after the loop with:
    countTrash = sum(trashMask)

This improves robustness and follows best practices for parallel MATLAB loops, avoiding potential issues with shared/reduction variables.

No changes in results or workflow.
@LucaDeSiena LucaDeSiena merged commit 32a283c into MuRAT4 Apr 16, 2026
1 check passed
@LucaDeSiena LucaDeSiena deleted the add/envelope branch April 16, 2026 11:48
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