Skip to content

Paral make it so 3 thr#5

Open
kindfairy wants to merge 6 commits intokamyshova:masterfrom
kindfairy:paral-makeItSo-3-thr
Open

Paral make it so 3 thr#5
kindfairy wants to merge 6 commits intokamyshova:masterfrom
kindfairy:paral-makeItSo-3-thr

Conversation

@kindfairy
Copy link
Copy Markdown

Description

Used two SingleThreadExecutors for parallel computing in makeItSo
Didn't use JMH yet

Checklist (never delete this)

Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.

Content

  • Added or modified tests to cover changes and any new functionality
  • Edited the README / documentation (if applicable)
  • All tests passing on Travis

Review

  • Final thumbs-up from reviewer
  • Rebase, squash and reword as applicable

For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests

	modified:   src/main/java/picard/analysis/CollectInsertSizeMetrics.java
	modified:   src/main/java/picard/analysis/CollectGcBiasMetrics.java
	modified:   src/main/java/picard/analysis/CollectInsertSizeMetrics.java
…e from walker

and executing method accpetRead
Created Semaphore to limit number of in-memory objects
Tested. Works.
Deleted debug output (measuring time), wrote comments
Copy link
Copy Markdown
Owner

@kamyshova kamyshova left a comment

Choose a reason for hiding this comment

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

Исправьте замечания + поработайте с sonar. И попробуйте распараллелить по программам.

if (walker == null || tmpRecord.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
ref = null;
} else {
ref = walker.get(tmpRecord.getReferenceIndex());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Вы точно уверены, что этот код синхронизирован? Потому как walker не синхронизирован.

ExecutorService acceptReadService = Executors.newSingleThreadExecutor();

//Limit for tasks into services' queues
Semaphore semaphore = new Semaphore(SEMAPHORE_PERMITS);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Лучше использовать BlockingQueue с размером в ThreadPool.

try {
refReadService.awaitTermination(1, TimeUnit.DAYS);
} catch (InterruptedException e) {
e.printStackTrace();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Нужно перебросить исключение.

public void run() {
for (Pair<SAMRecord, ReferenceSequence> pair : pairs) {
for (final SinglePassSamProgram program : programs) {
program.acceptRead(pair.getKey(), pair.getValue());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Нельзя, чтобы параллельно на одной программе обрабатывалось несколько рекордов.

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