Skip to content

Commit

Permalink
bugfix in stitching, upgrade to 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tpesout committed Apr 13, 2021
1 parent 8ad449e commit 89fe1fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ execute_process(
)
set(MARGIN_VERSION_MAJOR 2)
set(MARGIN_VERSION_MINOR 2)
set(MARGIN_VERSION_COMMIT dev-${GIT_COMMIT_HASH})
#set(MARGIN_VERSION_COMMIT 1)
#set(MARGIN_VERSION_COMMIT dev-${GIT_COMMIT_HASH})
set(MARGIN_VERSION_COMMIT 2)
configure_file(
"${PROJECT_SOURCE_DIR}/inc/marginVersion.h.in"
"${PROJECT_SOURCE_DIR}/inc/marginVersion.h"
Expand Down
10 changes: 10 additions & 0 deletions impl/stitching.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,8 @@ void outputChunkers_stitchAndTrackExtraData(OutputChunkers *outputChunkers, bool
// nothing to do otherwise, just wait until end or new contig
}

ChunkToStitch **stitchedContigs = st_calloc(stList_length(contigChunkPositions), sizeof(ChunkToStitch*));

// in parallel, stitch each contig linearly
#pragma omp parallel for schedule(static,1)
for (int64_t contigIdx = 0; contigIdx < stList_length(contigChunkPositions); contigIdx++) {
Expand All @@ -1636,6 +1638,12 @@ void outputChunkers_stitchAndTrackExtraData(OutputChunkers *outputChunkers, bool
}
chunkToStitch_destruct(chunks[i]);
}
stitchedContigs[contigIdx] = stitched;
}

// write everything single-threaded
for (int64_t contigIdx = 0; contigIdx < stList_length(contigChunkPositions); contigIdx++) {
ChunkToStitch *stitched = stitchedContigs[contigIdx];

// write contents
outputChunkers_writeChunk(outputChunkers, stitched);
Expand All @@ -1662,9 +1670,11 @@ void outputChunkers_stitchAndTrackExtraData(OutputChunkers *outputChunkers, bool
chunkToStitch_destruct(stitched);
}


// cleanup
stList_destruct(contigChunkPositions);
stList_destruct(contigNames);
free(stitchedContigs);
free(chunks); //chunks are freed as they're merged

}
Expand Down

0 comments on commit 89fe1fb

Please sign in to comment.