Skip to content

Commit

Permalink
use single-threaded bgzf until I figure out race
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed May 5, 2017
1 parent 9c41f9e commit 15cbf60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
19 changes: 2 additions & 17 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"log"
"os"
"reflect"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -661,30 +660,16 @@ func (a *Annotator) Setup(query HeaderUpdater) ([]interfaces.Queryable, error) {
}
var wg sync.WaitGroup
wg.Add(len(files))
workers := 1
if runtime.GOMAXPROCS(0) > len(files) && len(files) > 0 {
workers = imax(2, runtime.GOMAXPROCS(0)/len(files))
if workers > 3 {
workers = 3
}
log.Printf("vcfanno: using ~%d workers per file", workers)
}

queryables := make([]interfaces.Queryable, len(files))
workers := 1
for i, file := range files {
go func(idx int, file string) {
var q interfaces.Queryable
var err error
if strings.HasSuffix(file, ".bam") {
q, err = parsers.NewBamQueryable(file, 2)
} else {
if getSize(file) > 2320303098 {
q, err = bix.New(file, workers+1)
} else if getSize(file) < 120303098 {
q, err = bix.New(file, 1)
} else {
q, err = bix.New(file, workers)
}
q, err = bix.New(file, workers)
}
if err != nil {
log.Fatal(err)
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.2.6
------
+ fix race condition from 0.2.4 by reverting some speed improvements from that release.

v0.2.5
------
+ better error messages
Expand Down
2 changes: 1 addition & 1 deletion vcfanno.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/brentp/xopen"
)

var VERSION = "0.2.5"
var VERSION = "0.2.6"

func envGet(name string, vdefault int) int {
sval := os.Getenv(name)
Expand Down

0 comments on commit 15cbf60

Please sign in to comment.