Open EricDeveaud opened 3 years ago
back on this topic.
problem is the memory computation performed by Roary::External::Cdhit
which is wrong regarding the new cd-hit memory estimation
see how version cd-hit performed the memory estimation
size_t SequenceDB::MinimalMemory( int frag_no, int bsize, int T, const Options & options, size_t extra )
{
int N = sequences.size();
int F = frag_no < MAX_TABLE_SEQ ? frag_no : MAX_TABLE_SEQ;
size_t mem_need = 0;
size_t mem, mega = 1000000;
int table = T > 1 ? 2 : 1;
printf( "\nApproximated minimal memory consumption:\n" );
mem = N*sizeof(Sequence) + total_desc + N + extra;
if( options.store_disk == false ) mem += total_letter + N;
printf( "%-16s: %zuM\n", "Sequence", mem/mega );
mem_need += mem;
mem = bsize;
printf( "%-16s: %i X %zuM = %zuM\n", "Buffer", T, mem/mega, T*mem/mega );
mem_need += T*mem;
mem = F*(sizeof(Sequence*) + sizeof(IndexCount)) + NAAN*sizeof(NVector<IndexCount>);
printf( "%-16s: %i X %zuM = %zuM\n", "Table", table, mem/mega, table*mem/mega );
mem_need += table*mem;
mem = sequences.capacity()*sizeof(Sequence*) + N*sizeof(int);
mem += Comp_AAN_idx.size()*sizeof(int);
printf( "%-16s: %zuM\n", "Miscellaneous", mem/mega );
mem_need += mem;
printf( "%-16s: %zuM\n\n", "Total", mem_need/mega );
if(options.max_memory and options.max_memory < mem_need + 50*table ){
char msg[200];
sprintf( msg, "not enough memory, please set -M option greater than %zu\n",
50*table + mem_need/mega );
bomb_error(msg);
}
return mem_need;
}
so just take in account number of characters in input file (_combined_files
) as $memory_required = -s $filename;
does is no longer sufficiant.
regards
Eric
I finally hacked lib/Bio/Roary/External/Cdhit.pm
to force memory to unlimited ;-) harsh but functional
--- lib/Bio/Roary/External/Cdhit.pm.ori 2021-07-16 08:37:29.333069603 +0000
+++ lib/Bio/Roary/External/Cdhit.pm 2021-07-16 08:36:11.646064928 +0000
@@ -58,7 +58,10 @@
{
my ($self) = @_;
my $memory_to_cdhit = int($self->memory_in_mb *0.9);
- return $memory_to_cdhit;
+# return $memory_to_cdhit;
+# memory estimation is wrong
+# force -M to 0. fix https://github.com/sanger-pathogens/Roary/issues/539
+ return 0;
}
sub clusters_filename
This thread saved me a ton of time. Thanks, @EricDeveaud !
Hello, running Roary/1.13.0
we have a problem running roary, it stops with the following error message:
after digging in the code I noticed 1) that Roary.pm does not test the cd-hit command execution return code. 2) that cd-hit failure is due to memory requestedis too low. see when I run th ecd-hit command mannualy
I'm not enough perl fluent to dig further. hope this helps.
NB for inforamtion here's the
roary -a output
regards
Eric