From 3f19ab3c8cb8b5d0ee4aed32eb58e92519b22f3e Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 24 十二月 2019 09:18:01 +0800 Subject: [PATCH] update --- main.go | 25 ++++++++++--------------- 1 files changed, 10 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 777cf7c..097b036 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,9 @@ import ( "analysis/logo" "analysis/util" + "os/signal" "strconv" + "syscall" "analysis/app/master" "analysis/app/slave" @@ -12,8 +14,6 @@ "flag" "os" - - "basic.com/valib/gogpu.git" // "net/http" // _ "net/http/pprof" ) @@ -36,8 +36,8 @@ ) func init() { - flag.StringVar(&role, "role", roleMaster, "run process role master/slave, default single") - flag.StringVar(&runType, "sdk", util.FeatAll, "run sdk type, face/facedetect/facecompare/yolo,etc.") + flag.StringVar(&role, "role", roleMaster, "run process role master/slave, default master") + flag.StringVar(&runType, "sdk", util.FeatAll, "run sdk type, facedetect/yolo,etc.") flag.StringVar(&id, "id", util.FakeSdkID, "sdk id as ipc label") flag.StringVar(&configPath, util.ConfigPath, "", "sdk config file path") @@ -88,12 +88,6 @@ func main() { - indices := gogpu.RankGPU() - if len(indices) == 0 { - logo.Errorln("there is no gpu for valid") - return - } - util.InitConfig() flag.Parse() @@ -114,17 +108,18 @@ ret := false if role == roleMaster { setParamters() - ret = master.Run(ctx, configPath, "./libcomm.so") + ret = master.Run(ctx, "./libcomm.so", configPath) } else if role == roleSlave { ret = slave.Run(ctx, configPath, runType, id, gpu, shm) + } else if role == "test" { + ret = slave.TwoPluginConflict("./libcomm.so", "./zconf/Yolo.json") } if ret { - // c := make(chan os.Signal, 1) - // signal.Notify(c, os.Interrupt, os.Kill, unix.SIGTERM) - // <-c - select {} + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM) + <-c } cancel() -- Gitblit v1.8.0