Skip to content
Snippets Groups Projects
Commit 746c5284 authored by Sydney Erickson's avatar Sydney Erickson
Browse files

Change graph gen params to default to previous values

parent 0919f990
No related branches found
No related tags found
No related merge requests found
package conf package conf
import "runtime"
var ExpectedGraphGen = GraphGen{ var ExpectedGraphGen = GraphGen{
minInputSize: 4, minInputSize: 4,
defaultNumTh: 2, defaultNumTh: uint8(runtime.NumCPU()),
outputSize: 4, outputSize: 4,
outputThreshold: 0.0, outputThreshold: 0.0,
} }
\ No newline at end of file
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"gitlab.com/elixxir/server/services" "gitlab.com/elixxir/server/services"
"golang.org/x/crypto/blake2b" "golang.org/x/crypto/blake2b"
"net" "net"
"runtime"
) )
// This object is used by the server instance. // This object is used by the server instance.
...@@ -72,8 +73,18 @@ func NewParams(vip *viper.Viper) (*Params, error) { ...@@ -72,8 +73,18 @@ func NewParams(vip *viper.Viper) (*Params, error) {
params.Permissioning.RegistrationCode = vip.GetString("permissioning.registrationCode") params.Permissioning.RegistrationCode = vip.GetString("permissioning.registrationCode")
params.GraphGen.defaultNumTh = uint8(vip.GetUint("graphgen.defaultNumTh")) params.GraphGen.defaultNumTh = uint8(vip.GetUint("graphgen.defaultNumTh"))
if params.GraphGen.defaultNumTh == 0 {
params.GraphGen.defaultNumTh = uint8(runtime.NumCPU())
}
params.GraphGen.minInputSize = vip.GetUint32("graphgen.mininputsize") params.GraphGen.minInputSize = vip.GetUint32("graphgen.mininputsize")
if params.GraphGen.minInputSize == 0 {
params.GraphGen.minInputSize = 4
}
params.GraphGen.outputSize = vip.GetUint32("graphgen.outputsize") params.GraphGen.outputSize = vip.GetUint32("graphgen.outputsize")
if params.GraphGen.outputSize == 0 {
params.GraphGen.outputSize = 4
}
// This (outputThreshold) already defaulted to 0.0
params.GraphGen.outputThreshold = float32(vip.GetFloat64("graphgen.outputthreshold")) params.GraphGen.outputThreshold = float32(vip.GetFloat64("graphgen.outputthreshold"))
params.Batch = vip.GetUint32("batch") params.Batch = vip.GetUint32("batch")
......
...@@ -50,9 +50,4 @@ skipReg: true ...@@ -50,9 +50,4 @@ skipReg: true
keepBuffers: true keepBuffers: true
metrics: metrics:
log: "~/.elixxir/metrics.log" log: "~/.elixxir/metrics.log"
graphgen:
defaultNumTh: 2
mininputsize: 4
outputsize: 4
outputthreshold: 0.0
... ...
...@@ -149,14 +149,6 @@ func StartServer(vip *viper.Viper) { ...@@ -149,14 +149,6 @@ func StartServer(vip *viper.Viper) {
round, payload, "FULL/BATCH") round, payload, "FULL/BATCH")
} }
//PanicHandler := func(g, m string, err error) {
// jww.FATAL.Panicf(fmt.Sprintf("Error in module %s of graph %s: %+v", g,
// m, err))
//}
//def.GraphGenerator = services.NewGraphGenerator(4, PanicHandler,
// uint8(runtime.NumCPU()), 4, 0.0)
def.RngStreamGen = fastRNG.NewStreamGenerator(params.RngScalingFactor, def.RngStreamGen = fastRNG.NewStreamGenerator(params.RngScalingFactor,
uint(runtime.NumCPU()), csprng.NewSystemRNG) uint(runtime.NumCPU()), csprng.NewSystemRNG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment