[Denovoassembler-devel] RE : Why flush both k-mer and its complement?
Ray -- Parallel genome assemblies for parallel DNA sequencing
Brought to you by:
sebhtml
From: Sébastien B. <seb...@ul...> - 2011-07-21 14:40:51
|
Short answer: no. Although both k-mers will go on the same MPI rank, the first flush may generate an actual MPI message on the network. As such, the second flush won't flush anything because the buffer was just reset. On the other hand, if the first k-mer does not generate a message when flush is called, then the second flush may do so. I think you bring a good point however. complementVertex being the function that consumes the most CPU cycles (according to GNU gprof), clearly, there is room here for improvement (i.e. as you underline using 1 call instead of 3 would be better). I added a TODO. Feel free to send me a patch for this ! see code/Submit-a-patch.txt > ________________________________________ > De : David Eccles (gringer) [dav...@mp...] > Date d'envoi : 21 juillet 2011 05:46 > À : Sébastien Boisvert; den...@li... > Objet : Why flush both k-mer and its complement? > > I notice that in assembler/KmerAcademyBuilder.cpp:120-139 you have: > > 120 rankToFlush=m_parameters->_vertexRank(&a); > 121 [add <rankToFlush> to pending flush messages] > 130 Kmer b = > complementVertex(&a,wordSize,m_parameters->getColorSpaceMode()); > 132 rankToFlush=m_parameters->_vertexRank(&b); > 133 [add <rankToFlush> to pending flush messages] > > but the vertexRank function returns the hash of the lowest k-mer: > > core/Parameters.cpp:1200 (_vertexRank) > return vertexRank(a,m_size,m_wordSize,m_colorSpaceMode); > > core/common_functions.cpp (vertexRank) > 134 Kmer b=complementVertex(a,w,color); > 135 if(a->isLower(&b)) > 136 b=*a; > 137 return hash_function_1(&b)%(_size); > > So the code appears to be doing 3 complement vertex operations > (KmerAcademyBuilder.cpp:130, common_functions.cpp:134 * 2) for each > flush. Could the second flush (i.e. KmerAcademyBuilder.cpp:130-139) be > removed without loss of function? > > -- David > Sébastien |