zhangmeng
2020-01-06 a10f7bf10c195421b089cda0c13f2195c614cb80
main.go
@@ -15,6 +15,7 @@
   "golang.org/x/sys/unix"
   "analysis/gosdk"
   "basic.com/valib/gogpu.git"
   // "net/http"
   // _ "net/http/pprof"
@@ -143,18 +144,21 @@
   logo.Infoln(os.Args)
   ctx, cancel := context.WithCancel(context.Background())
   ret := false
   if role == single {
      proc.SingleRole(ctx, runType, id, gpu, shm)
      ret = proc.SingleRole(ctx, runType, id, gpu, shm)
   } else if role == master {
      setParamters()
      proc.MasterRole(ctx)
      ret = proc.MasterRole(ctx)
   } else if role == slave {
      proc.SingleRole(ctx, runType, id, gpu, shm)
      ret = proc.SingleRole(ctx, runType, id, gpu, shm)
   }
   c := make(chan os.Signal, 1)
   signal.Notify(c, os.Interrupt, os.Kill, unix.SIGTERM)
   <-c
   if ret {
      c := make(chan os.Signal, 1)
      signal.Notify(c, os.Interrupt, os.Kill, unix.SIGTERM)
      <-c
   }
   cancel()