MCPcopy Create free account
hub / github.com/OpenGene/fastp / markProcessed

Method markProcessed

src/threadconfig.cpp:127–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void ThreadConfig::markProcessed(long readNum) {
128 mCurrentSplitReads += readNum;
129 if(!mOptions->split.enabled)
130 return ;
131 // if splitting is enabled, check whether current file is full
132 if(mCurrentSplitReads >= mOptions->split.size) {
133 // if it's splitting by file number, totally we cannot exceed split.number
134 // if it's splitting by file lines, then we don't need to check
135 if(mOptions->split.byFileLines || mWorkingSplit + mOptions->thread < mOptions->split.number ){
136 mWorkingSplit += mOptions->thread;
137 initWriterForSplit();
138 mCurrentSplitReads = 0;
139 } else {
140 // this thread can be stoped now since all its tasks are done
141 // only a part of threads have to deal with the remaining reads
142 if(mOptions->split.number % mOptions->thread >0
143 && mThreadId >= mOptions->split.number % mOptions->thread)
144 mCanBeStopped = true;
145 }
146 }
147}
148
149// if a task of writting N files is assigned to this thread, but the input file doesn't have so many reads to input
150// write some empty files so it will not break following pipelines

Callers 2

processPairEndMethod · 0.80
processSingleEndMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected