SciLifeLab / facs

Fast and Accurate Classification of Sequences using Bloom filters
http://facs.scilifelab.se/
Other
16 stars 9 forks source link

Make sure number of threads are the same in tests #99

Closed brainstorm closed 10 years ago

brainstorm commented 10 years ago

Add threads attribute to FACS JSON output with underlying code:

http://scv.bu.edu/~kadin/Tutorials/Alliance/OpenMP/omp_set_num_threads.html

Check/set the environment variable OMP_NUM_THREADS accordingly before running runtests on FACS.

The threads attribute is already present in fastq_screen

brainstorm commented 10 years ago

@tzcoolman

The environment variable does not seem to affect FACS threads which remain "1"... or should I get the number of threads only from the parallel pragma zone in OpenMP?

(see last value in the JSON document, threads)

$ ./facs query -r ../tests/data/bloom/eschColi_K12.bloom -q ../tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq 
{"begin_timestamp": "2014-01-15T21:36:04.226+0100","end_timestamp": "2014-01-15T21:36:04.261+0100","sample": "/pica/h1/roman/dev/facs/tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq","bloom_filter": "/pica/h1/roman/dev/facs/tests/data/bloom/eschColi_K12.bloom","total_read_count": 100,"contaminated_reads": 100,"total_hits": 8364,"contamination_rate": 1.000000,"p_value": 1.000000e+00,"threads": 1}

$ OMP_NUM_THREADS=8 ./facs query -r ../tests/data/bloom/eschColi_K12.bloom -q ../tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq 
{"begin_timestamp": "2014-01-15T21:36:29.604+0100","end_timestamp": "2014-01-15T21:36:29.611+0100","sample": "/pica/h1/roman/dev/facs/tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq","bloom_filter": "/pica/h1/roman/dev/facs/tests/data/bloom/eschColi_K12.bloom","total_read_count": 100,"contaminated_reads": 100,"total_hits": 8364,"contamination_rate": 1.000000,"p_value": 1.000000e+00,"threads": 1}

$ export OMP_NUM_THREADS=8
$ ./facs query -r ../tests/data/bloom/eschColi_K12.bloom -q ../tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq 
{"begin_timestamp": "2014-01-15T21:37:41.449+0100","end_timestamp": "2014-01-15T21:37:41.454+0100","sample": "/pica/h1/roman/dev/facs/tests/data/synthetic_fastq/simngs_eschColi_K12_100.fastq","bloom_filter": "/pica/h1/roman/dev/facs/tests/data/bloom/eschColi_K12.bloom","total_read_count": 100,"contaminated_reads": 100,"total_hits": 8364,"contamination_rate": 1.000000,"p_value": 1.000000e+00,"threads": 1}
brainstorm commented 10 years ago

Indeed, fixed in ebb2bce.