Skip to content
Snippets Groups Projects
Commit c13a0173 authored by Ashwin's avatar Ashwin
Browse files

Added --numCpu flag

parent b1c420ca
No related branches found
No related tags found
No related merge requests found
File added
......@@ -38,6 +38,7 @@ var rdfGzips = flag.String("rdfgzips", "",
var mod = flag.Uint64("mod", 1, "Only pick entities, where uid % mod == 0.")
var postingDir = flag.String("postings", "", "Directory to store posting lists")
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
var numcpu = flag.Int("numCpu", runtime.NumCPU(), "Number of cores to be used by the process")
func main() {
flag.Parse()
......@@ -54,7 +55,7 @@ func main() {
}
logrus.SetLevel(logrus.InfoLevel)
numCpus := runtime.NumCPU()
numCpus := *numcpu
prevProcs := runtime.GOMAXPROCS(numCpus)
glog.WithField("num_cpu", numCpus).
WithField("prev_maxprocs", prevProcs).
......
......@@ -38,6 +38,7 @@ var glog = x.Log("server")
var postingDir = flag.String("postings", "", "Directory to store posting lists")
var mutationDir = flag.String("mutations", "", "Directory to store mutations")
var port = flag.String("port", "8080", "Port to run server on.")
var numcpu = flag.Int("numCpu", runtime.NumCPU(), "Number of cores to be used by the process")
func addCorsHeaders(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
......@@ -109,7 +110,7 @@ func main() {
glog.Fatal("Unable to parse flags")
}
logrus.SetLevel(logrus.InfoLevel)
numCpus := runtime.NumCPU()
numCpus := *numcpu
prev := runtime.GOMAXPROCS(numCpus)
glog.WithField("num_cpu", numCpus).
WithField("prev_maxprocs", prev).
......
......@@ -22,6 +22,7 @@ var rdfGzips = flag.String("rdfgzips", "",
var mod = flag.Uint64("mod", 1, "Only pick entities, where uid % mod == 0.")
var uidDir = flag.String("uidpostings", "", "Directory to store xid to uid posting lists")
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
var numcpu = flag.Int("numCpu", runtime.NumCPU(), "Number of cores to be used by the process")
func main() {
flag.Parse()
......@@ -39,7 +40,7 @@ func main() {
logrus.SetLevel(logrus.InfoLevel)
numCpus := runtime.NumCPU()
numCpus := *numcpu
prevProcs := runtime.GOMAXPROCS(numCpus)
glog.WithField("num_cpus", numCpus).
WithField("prev_maxprocs", prevProcs).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment