zhangmeng
2019-12-12 f1e9da0594463de2270b7e8d6240d9bf4413d2b2
main.go
@@ -143,18 +143,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()