kuleshov / cdhit

Automatically exported from code.google.com/p/cdhit
GNU General Public License v2.0
0 stars 0 forks source link

Compiler warnings and CPU time bug #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compiling the code on gcc 4.5.2 produces numerous formatting warnings.
2. Running cd-hit always shows a CPU time of 0 at the end of the output.

I've fixed all compiler warnings by altering printf formatting to the 
appropriate characters (for instance, a struct pointer should be printed using 
%p, not %x, even though it is hexadecimal).

I've also fixed the CPU time bug simply by changing the value of the computed 
time into double, rather than int. Naturally, when one divides two millisecond 
values obtained from the tms struct by the defined conversion of 100 to 
seconds, one loses precision, so the time is truncated. As my calculations are 
all pretty quick, the CPU time should be 0.something, instead of just 0.

It seems to work properly now. I've thoroughly tested it against a wide variety 
of data sets and my code performs exactly like your original code without the 
CPU time issue or the compiler warnings.

Please apply my attached patch to reproduce my fixes.

Hope this helps!

Regards,

Varun
The Division of Structural Biology
University of Oxford

Original issue reported on code.google.com by varun.ra...@gmail.com on 1 Jun 2011 at 2:42

Attachments:

GoogleCodeExporter commented 9 years ago
Varun, thank you very much for the patch.
Now it is applied and committed to the repository.

Original comment by phooli...@gmail.com on 3 Jun 2011 at 11:57

GoogleCodeExporter commented 9 years ago
Cheers, and thanks for acting on this so soon. I can confirm that the hg update 
works properly.

Regards,

Varun

Original comment by varun.ra...@gmail.com on 4 Jun 2011 at 1:15

GoogleCodeExporter commented 9 years ago
Quick question:

Have you actually applied the patch or did you just add it to your repository? 
When I check the source, it doesn't look like the patch has been applied...

Thanks!

Varun

Original comment by varun.ra...@gmail.com on 8 Jun 2011 at 9:04

GoogleCodeExporter commented 9 years ago
The patched codes is pushed into the googlecode repository, as you can see from:

http://code.google.com/p/cdhit/source/detail?r=dd555b4174ff48acb97b0cc33a0476474
06ef785&name=default

Original comment by phooli...@gmail.com on 8 Jun 2011 at 7:45

GoogleCodeExporter commented 9 years ago
Thank you! You might want to remove the .patch file itself then to avoid 
confusion for users.

Varun

Original comment by varun.ra...@gmail.com on 9 Jun 2011 at 10:05