Skip to content

Commit

Permalink
Merge pull request #4 from dpryan79/fix3
Browse files Browse the repository at this point in the history
Fix #3
  • Loading branch information
dpryan79 committed Dec 30, 2015
2 parents a80436a + e489f8d commit a4c7f18
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 35 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo: false
language: c
os:
- linux
- osx
env: MPI=openmpi
script: make
compiler:
- clang
- gcc
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Please see the tutorial (http://sourceforge.net/projects/dna-bison/files/bison_tutorial.tar.gz/download) for help in setting these options.
WORK=/home/ryand#This should be changed to match your needs
PREFIX = $(WORK)/bin
CC = mpicc
HTSLIB=htslib/libhts.a #Use -lhtslib and set LIB_DIRS for dynamic linkage
WORK?=/home/ryand#This should be changed to match your needs
PREFIX ?= $(WORK)/bin
CC ?= mpicc
HTSLIB ?= htslib/libhts.a #Use -lhtslib and set LIB_DIRS for dynamic linkage
INCLUDE_DIRS = -Ihtslib
LIB_DIRS =
OPTS = -Wall -g #-DDEBUG #-DNOTHROTTLE
Expand Down
21 changes: 10 additions & 11 deletions herd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,6 @@ int main(int argc, char *argv[]) {
char processor_name[MPI_MAX_PROCESSOR_NAME];
#endif

//Deal with MPI initialization, this seems like an odd way to do things.
MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
if(provided != MPI_THREAD_MULTIPLE) {
fprintf(stderr, "You're MPI implementation doesn't support MPI_THREAD_MULTIPLE, which is required for bison_herd to work.\n");
return -1;
}
#ifndef DEBUG
MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
MPI_Get_processor_name(processor_name, &name_len);
#endif

config.odir = NULL;
config.paired = 0; //Default is single-ended
config.directional = 0; //Default is non-directional
Expand Down Expand Up @@ -330,6 +319,16 @@ int main(int argc, char *argv[]) {
}
}

MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
if(provided != MPI_THREAD_MULTIPLE) {
fprintf(stderr, "You're MPI implementation doesn't support MPI_THREAD_MULTIPLE, which is required for bison_herd to work.\n");
return -1;
}
#ifndef DEBUG
MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
MPI_Get_processor_name(processor_name, &name_len);
#endif

if(config.FASTQ1 == NULL || config.genome_dir == NULL || (config.FASTQ2 == NULL && config.paired == 1)) {
if(taskid == MASTER) {
fprintf(stderr, "No FASTQ files!\n");
Expand Down
2 changes: 1 addition & 1 deletion htslib
25 changes: 12 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,6 @@ int main(int argc, char *argv[]) {
char processor_name[MPI_MAX_PROCESSOR_NAME];
#endif

//Deal with MPI initialization, this seems like an odd way to do things.
#ifndef DEBUG
MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
MPI_Get_processor_name(processor_name, &name_len);
#else
MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
#endif
if(provided != MPI_THREAD_FUNNELED) {
fprintf(stderr, "Your implementation does not support MPI_THREAD_FUNNELED, which is required for bison to run. This is actually quite unusual!\n");
return -1;
}

config.odir = NULL;
config.paired = 0; //Default is single-ended
config.directional = 0; //Default is non-directional
Expand Down Expand Up @@ -250,6 +237,18 @@ int main(int argc, char *argv[]) {
}
}

#ifndef DEBUG
MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
MPI_Comm_rank(MPI_COMM_WORLD, &taskid);
MPI_Get_processor_name(processor_name, &name_len);
#else
MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
#endif
if(provided != MPI_THREAD_FUNNELED) {
fprintf(stderr, "Your implementation does not support MPI_THREAD_FUNNELED, which is required for bison to run. This is actually quite unusual!\n");
return -1;
}

#ifndef DEBUG
if(!config.quiet) {printf("%s has rank %i\n", processor_name, taskid); fflush(stderr);}
#endif
Expand Down
8 changes: 4 additions & 4 deletions markduplicates.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ typedef struct {
} qsort_func_struct;

//Get the total phred score
inline int32_t total_phred(bam1_t *read) {
int32_t total_phred(bam1_t *read) {
int32_t l = read->core.l_qseq;
int32_t i=0, total=0;
uint8_t *qual = bam_get_qual(read);
Expand Down Expand Up @@ -271,7 +271,7 @@ are on different chromosomes or different strand.\n");
it's full). The default is 1000000.\n");
}

inline int32_t get_strand(bam1_t *read) {
int32_t get_strand(bam1_t *read) {
char *XG = bam_aux2Z(bam_aux_get(read, "XG"));
char *XR = bam_aux2Z(bam_aux_get(read, "XR"));

Expand All @@ -294,7 +294,7 @@ inline int32_t get_strand(bam1_t *read) {
}
}

inline int32_t get_pos(bam1_t *read) {
int32_t get_pos(bam1_t *read) {
int32_t pos = read->core.pos;
uint32_t *CIGAR = bam_get_cigar(read);
int32_t op, nops;
Expand All @@ -315,7 +315,7 @@ inline int32_t get_pos(bam1_t *read) {
}

//return the tid, such that first 2 bits denote the strand
inline int32_t get_tid(bam1_t *read) {
int32_t get_tid(bam1_t *read) {
int32_t strand = get_strand(read);

strand = strand << 30;
Expand Down
2 changes: 1 addition & 1 deletion master.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int get_AS(bam1_t *read) {
* int32_t rlen: a read length
*
*******************************************************************************/
inline int scoreMin(int32_t rlen) {
int scoreMin(int32_t rlen) {
//Return different values, depending on --score-min
if(config.scoremin_type == 'L') {
return (config.scoremin_intercept + config.scoremin_coef * rlen);
Expand Down
2 changes: 1 addition & 1 deletion slurp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void add_element(struct packed_struct *last, void *packed) {
* struct packed_struct *remove: element to destroy
*
*******************************************************************************/
inline void destroy_element(struct packed_struct *remove) {
void destroy_element(struct packed_struct *remove) {
bam1_t *pbam1_t = remove->packed;
if(pbam1_t != NULL) {
if(pbam1_t->data != NULL) free(pbam1_t->data);
Expand Down

0 comments on commit a4c7f18

Please sign in to comment.