Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main.cpp: Remove fixed size tid array
Browse files Browse the repository at this point in the history
This fixed size array, which overflows when more than 64 threads
are requested, is not used. Remove it.
donald committed Oct 7, 2017
1 parent 491a683 commit ff870a6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -43,7 +43,6 @@ bit32_t n_aligned_pairs=0, n_unique_pairs=0, n_multiple_pairs=0; //number of pa
bit32_t n_aligned_a=0, n_unique_a=0, n_multiple_a=0; //number of a reads aligned
bit32_t n_aligned_b=0, n_unique_b=0, n_multiple_b=0; //number of b reads aligned
bit32_t ref_time, read_time;
bit16_t tid[64];
char version[] = "2.90";
ostringstream message;

@@ -56,7 +55,7 @@ void info(int level) {
pthread_mutex_t mutex_fin=PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex_fout=PTHREAD_MUTEX_INITIALIZER;

void *t_SingleAlign(void *tid) {
void *t_SingleAlign(void *) {
SingleAlign a;
int n;
bit32_t cur_at;
@@ -85,13 +84,13 @@ void *t_SingleAlign(void *tid) {
void Do_SingleAlign() {
vector<pthread_t> pthread_ids(param.num_procs);
for(int i=0; i<param.num_procs; i++) {
tid[i]=i; pthread_create(&pthread_ids[i], NULL, t_SingleAlign, (void*)&tid[i]);
pthread_create(&pthread_ids[i], NULL, t_SingleAlign,NULL);
}
for(int i=0; i<param.num_procs; i++) pthread_join(pthread_ids[i], NULL);
};


void *t_PairAlign(void *tid) {
void *t_PairAlign(void *) {
PairAlign a;
int n1, n2;
bit32_t cur_at;
@@ -126,7 +125,7 @@ void Do_PairAlign() {
//create
//cout <<param.num_procs<<"num_procs\n";
for(int i=0; i<param.num_procs; i++) {
tid[i]=i; pthread_create(&pthread_ids[i], NULL, t_PairAlign, (void*)&tid[i]);
pthread_create(&pthread_ids[i], NULL, t_PairAlign,NULL);
}
for(int i=0; i<param.num_procs; i++) pthread_join(pthread_ids[i], NULL);
};

0 comments on commit ff870a6

Please sign in to comment.