scheduling optimization
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/filecoin-project/lotus/api/v1api"
|
||||
|
||||
@@ -49,6 +50,11 @@ var runCmd = &cli.Command{
|
||||
Usage: "manage open file limit",
|
||||
Value: true,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "parallel-p1-limit",
|
||||
Usage: "maximum pre commit1 operations to run in parallel",
|
||||
Value: -1,
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if !cctx.Bool("enable-gpu-proving") {
|
||||
@@ -58,6 +64,8 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
}
|
||||
|
||||
os.Setenv("PARALLEL_P1_LIMIT", strconv.Itoa(cctx.Int("parallel-p1-limit")))
|
||||
|
||||
ctx, _ := tag.New(lcli.DaemonContext(cctx),
|
||||
tag.Insert(metrics.Version, build.BuildVersion),
|
||||
tag.Insert(metrics.Commit, build.CurrentCommit),
|
||||
|
||||
@@ -152,6 +152,12 @@ func workersCmd(sealing bool) *cli.Command {
|
||||
for _, gpu := range stat.Info.Resources.GPUs {
|
||||
fmt.Printf("\tGPU: %s\n", color.New(gpuCol).Sprintf("%s, %sused", gpu, gpuUse))
|
||||
}
|
||||
|
||||
plConfig, ok := stat.Info.TaskLimits[sealtasks.TTPreCommit1]
|
||||
if ok && plConfig.LimitCount > 0 {
|
||||
fmt.Printf("\tP1LIMIT: [%s] %d/%d tasks are running\n",
|
||||
barString(float64(plConfig.LimitCount), 0, float64(plConfig.RunCount)), plConfig.RunCount, plConfig.LimitCount)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -208,6 +209,11 @@ var runCmd = &cli.Command{
|
||||
Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function",
|
||||
Value: "30m",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "parallel-p1-limit",
|
||||
Usage: "maximum precommit1 operations to run in parallel",
|
||||
Value: -1,
|
||||
},
|
||||
},
|
||||
Before: func(cctx *cli.Context) error {
|
||||
if cctx.IsSet("address") {
|
||||
@@ -228,6 +234,8 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
}
|
||||
|
||||
os.Setenv("PARALLEL_P1_LIMIT", strconv.Itoa(cctx.Int("parallel-p1-limit")))
|
||||
|
||||
limit, _, err := ulimit.GetLimit()
|
||||
switch {
|
||||
case err == ulimit.ErrUnsupported:
|
||||
|
||||
Reference in New Issue
Block a user