Added signal catching and handling in C and Cython
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "obi_lcs.h"
|
||||
#include "obidebug.h"
|
||||
#include "obierrno.h"
|
||||
#include "obisig.h"
|
||||
#include "obitypes.h"
|
||||
#include "obiview.h"
|
||||
#include "sse_banded_LCS_alignment.h"
|
||||
@ -428,6 +429,8 @@ int obi_lcs_align_one_column(const char* dms_name,
|
||||
OBIDMS_column_p ali_length_column = NULL;
|
||||
OBIDMS_column_p score_column = NULL;
|
||||
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
k = 0;
|
||||
|
||||
// Open DMS
|
||||
@ -574,6 +577,9 @@ int obi_lcs_align_one_column(const char* dms_name,
|
||||
if (i%100 == 0)
|
||||
fprintf(stderr,"\rDone : %f %% ", (i / (float) seq_count)*100);
|
||||
|
||||
if (! keep_running)
|
||||
return -1;
|
||||
|
||||
// Get first id idx
|
||||
id1_idx = obi_get_index_with_elt_idx_and_col_p_in_view(seq_view, id_column, i, 0); // TODO Could there be multiple IDs per line?
|
||||
// Get first sequence and its index
|
||||
@ -725,6 +731,8 @@ int obi_lcs_align_two_columns(const char* dms_name,
|
||||
OBIDMS_column_p ali_length_column = NULL;
|
||||
OBIDMS_column_p score_column = NULL;
|
||||
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
k = 0;
|
||||
|
||||
// Open DMS
|
||||
@ -979,6 +987,9 @@ int obi_lcs_align_two_columns(const char* dms_name,
|
||||
|
||||
for (j=0; j < seq2_count; j++)
|
||||
{
|
||||
if (! keep_running)
|
||||
return -1;
|
||||
|
||||
// Get second sequence and its index
|
||||
seq2_idx = obi_get_index_with_elt_idx_and_col_p_in_view(seq2_view, i_seq2_column, j, seq2_elt_idx);
|
||||
blob2 = obi_get_blob_with_elt_idx_and_col_p_in_view(seq2_view, i_seq2_column, j, seq2_elt_idx);
|
||||
|
Reference in New Issue
Block a user