Embryo of code for openMP parallelization of LCS alignment but

deactivated for now because can't make it compile with cython/clang
This commit is contained in:
Celine Mercier
2016-12-20 11:46:58 +01:00
parent 9c71b06117
commit 5c50e5b378
3 changed files with 27 additions and 6 deletions

View File

@ -147,6 +147,13 @@ def addOptions(parser):
default=False,
help="Sequence counts are written in the output view. Default: they are not written.")
group.add_argument('--thread-count','-p', # TODO should probably be in a specific option group
action="store", dest="align:threadcount",
metavar='<THREAD COUNT>',
default=1,
type=int,
help="Number of threads to use for the computation. Default: one.")
cpdef align(str dms_n,
str input_view_1_n, str output_view_n,
@ -157,7 +164,8 @@ cpdef align(str dms_n,
double threshold=0.0, bint normalize=True,
int reference=0, bint similarity_mode=True,
bint print_seq=False, bint print_count=False,
comments="") :
comments="",
int thread_count=1) :
cdef OBIDMS d
d = OBIDMS(dms_n)
@ -172,7 +180,8 @@ cpdef align(str dms_n,
str2bytes(comments), \
print_seq, \
print_count, \
threshold, normalize, reference, similarity_mode) < 0 :
threshold, normalize, reference, similarity_mode,
thread_count) < 0 :
raise Exception("Error aligning sequences")
else :
if obi_lcs_align_two_columns(d._pointer, \
@ -216,8 +225,9 @@ def run(config):
similarity_mode = config['align']['similarity'], \
print_seq = config['align']['printseq'], \
print_count = config['align']['printcount'], \
comments = comments)
comments = comments, \
thread_count = config['align']['threadcount'])
print("Done.")