From 15cbf603dda3b9773c1cdd0c5b03cf1046e9eff0 Mon Sep 17 00:00:00 2001 From: Brent Pedersen Date: Fri, 5 May 2017 13:12:21 -0600 Subject: [PATCH] use single-threaded bgzf until I figure out race --- api/api.go | 19 ++----------------- docs/CHANGES.md | 4 ++++ vcfanno.go | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/api/api.go b/api/api.go index e2f15c5..b9952ac 100644 --- a/api/api.go +++ b/api/api.go @@ -5,7 +5,6 @@ import ( "log" "os" "reflect" - "runtime" "strconv" "strings" "sync" @@ -661,16 +660,8 @@ 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 @@ -678,13 +669,7 @@ func (a *Annotator) Setup(query HeaderUpdater) ([]interfaces.Queryable, 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) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 4369b65..abc410a 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -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 diff --git a/vcfanno.go b/vcfanno.go index df9555e..af29a34 100644 --- a/vcfanno.go +++ b/vcfanno.go @@ -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)