From f24d401b6156e2ab2df52d35af1e912be00a1b00 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 18 Dec 2020 17:46:49 +0800 Subject: [PATCH 1/2] add bench env print --- cmd/lotus-bench/main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index b246aedbb..551c32754 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -446,6 +446,17 @@ var sealBenchCmd = &cli.Command{ bo.VerifyWindowPostHot = verifyWindowpost2.Sub(verifyWindowpost1) } + fmt.Println("environment variable list:") + for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_MAXIMIZE_CACHING", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER", + "FIL_PROOFS_USE_GPU_TREE_BUILDER", "FIL_PROOFS_USE_MULTICORE_SDR", "BELLMAN_CUSTOM_GPU"} { + envValue, found := os.LookupEnv(envKey) + if found { + fmt.Printf("%s=%s\n", envKey, envValue) + } else { + fmt.Printf("%s not set\n", envKey) + } + } + if c.Bool("json-out") { data, err := json.MarshalIndent(bo, "", " ") if err != nil { From fdc46ad5dff68bcf0c7051a73581a20776d0468b Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 6 Jan 2021 12:20:33 +0800 Subject: [PATCH 2/2] update json format --- cmd/lotus-bench/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 551c32754..398512e0d 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -40,6 +40,8 @@ import ( var log = logging.Logger("lotus-bench") type BenchResults struct { + EnvVar map[string]string + SectorSize abi.SectorSize SectorNumber int @@ -446,14 +448,12 @@ var sealBenchCmd = &cli.Command{ bo.VerifyWindowPostHot = verifyWindowpost2.Sub(verifyWindowpost1) } - fmt.Println("environment variable list:") + bo.EnvVar = make(map[string]string) for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_MAXIMIZE_CACHING", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER", "FIL_PROOFS_USE_GPU_TREE_BUILDER", "FIL_PROOFS_USE_MULTICORE_SDR", "BELLMAN_CUSTOM_GPU"} { envValue, found := os.LookupEnv(envKey) if found { - fmt.Printf("%s=%s\n", envKey, envValue) - } else { - fmt.Printf("%s not set\n", envKey) + bo.EnvVar[envKey] = envValue } } @@ -465,6 +465,10 @@ var sealBenchCmd = &cli.Command{ fmt.Println(string(data)) } else { + fmt.Println("environment variable list:") + for envKey, envValue := range bo.EnvVar { + fmt.Printf("%s=%s\n", envKey, envValue) + } fmt.Printf("----\nresults (v28) SectorSize:(%d), SectorNumber:(%d)\n", sectorSize, sectorNumber) if robench == "" { fmt.Printf("seal: addPiece: %s (%s)\n", bo.SealingSum.AddPiece, bps(bo.SectorSize, bo.SectorNumber, bo.SealingSum.AddPiece))