X-Git-Url: https://git.arvados.org/lightning.git/blobdiff_plain/194c9e16c7cebf25d5830129f8f27d79a2a47ce5..5435c35e1d163adf5a79597721016c253e7c7e1d:/slice.go diff --git a/slice.go b/slice.go index fed3766dfe..4dbe6ab652 100644 --- a/slice.go +++ b/slice.go @@ -66,8 +66,8 @@ func (cmd *slicecmd) RunCommand(prog string, args []string, stdin io.Reader, std Name: "lightning slice", Client: arvados.NewClientFromEnv(), ProjectUUID: *projectUUID, - RAM: 300000000000, - VCPUs: 32, + RAM: 500000000000, + VCPUs: 64, Priority: *priority, KeepCache: 2, APIAccess: true, @@ -136,19 +136,16 @@ func Slice(tagsPerFile int, dstdir string, srcdirs []string) error { throttle := throttle{Max: runtime.GOMAXPROCS(0)} for _, infile := range infiles { infile := infile - throttle.Acquire() - go func() { - defer throttle.Release() + throttle.Go(func() error { f, err := open(infile) if err != nil { - throttle.Report(err) - return + return err } defer f.Close() dir, _ := filepath.Split(infile) namespace := dirNamespace[dir] log.Printf("reading %s (namespace %d)", infile, namespace) - err = DecodeLibrary(f, strings.HasSuffix(infile, ".gz"), func(ent *LibraryEntry) error { + return DecodeLibrary(f, strings.HasSuffix(infile, ".gz"), func(ent *LibraryEntry) error { if err := throttle.Err(); err != nil { return err } @@ -241,8 +238,7 @@ func Slice(tagsPerFile int, dstdir string, srcdirs []string) error { } return nil }) - throttle.Report(err) - }() + }) } throttle.Wait() if throttle.Err() != nil {