dwbf

package
v0.0.0-...-8ff7918 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Trials           uint
	ErrorProbability []float64
	Threads          uint
	Verbose          bool
	MaxIter          uint
	Alpha            float64
	EtaThreshold     float64
)
View Source
var DwbfRun = func(cmd *cobra.Command, args []string) {
	if len(args) != 2 {
		fmt.Println("requires both ECC_JSON_FILE RESULT_JSON")
		return
	}

	ecc, err := tools.LoadLinearBlockECC(args[0])
	if err != nil {
		fmt.Println(err)
		return
	}

	//next we see if the RESULT_JSON exists if so we load it and validate we're running it against the right thing
	var data *tools.SimulationStats
	data, err = tools.LoadResults(args[1])
	if err != nil {
		fmt.Println(err)
		return
	}

	if data == nil {
		data = &tools.SimulationStats{
			TypeInfo: typeInfo(),
			ECCInfo:  tools.Md5Sum(ecc.H),
			Stats:    make(map[float64]benchmarking.Stats),
		}
	}

	if data.TypeInfo != typeInfo() {
		fmt.Printf("csv loaded does not match the same type expected %v but found %v\n", typeInfo(), data.TypeInfo)
		return
	}
	if data.ECCInfo != tools.Md5Sum(ecc.H) {
		fmt.Printf("csv laoded does not match the ECC")
		return
	}

	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
	ctx, cancel := context.WithCancel(context.Background())
	go func() {
		sig := <-sigs
		fmt.Println()
		fmt.Println(sig)
		cancel()
	}()

	runSimulation(ctx, data, ecc, args[1])

	err = tools.SaveResults(args[1], data)
	if err != nil {
		fmt.Println(err)
	}
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL