Skip to content
Snippets Groups Projects
Commit 2bb20460 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

made realtiem run on CPU

parent 5c1c05fe
No related branches found
No related tags found
No related merge requests found
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
package realtime package realtime
import ( import (
jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
"gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/crypto/cryptops" "gitlab.com/elixxir/crypto/cryptops"
"gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/cyclic"
...@@ -243,9 +241,6 @@ var DecryptMul3Chunk = services.Module{ ...@@ -243,9 +241,6 @@ var DecryptMul3Chunk = services.Module{
// InitDecryptGraph called to initialize the graph. Conforms to graphs.Initialize function type // InitDecryptGraph called to initialize the graph. Conforms to graphs.Initialize function type
func InitDecryptGraph(gc services.GraphGenerator) *services.Graph { func InitDecryptGraph(gc services.GraphGenerator) *services.Graph {
if viper.GetBool("useGPU") {
jww.FATAL.Panicf("Using realtime decrypt graph running on CPU instead of equivalent GPU graph")
}
g := gc.NewGraph("RealtimeDecrypt", &KeygenDecryptStream{}) g := gc.NewGraph("RealtimeDecrypt", &KeygenDecryptStream{})
decryptKeygen := graphs.Keygen.DeepCopy() decryptKeygen := graphs.Keygen.DeepCopy()
...@@ -260,9 +255,6 @@ func InitDecryptGraph(gc services.GraphGenerator) *services.Graph { ...@@ -260,9 +255,6 @@ func InitDecryptGraph(gc services.GraphGenerator) *services.Graph {
// InitDecryptGPUGraph called to initialize the graph. Conforms to graphs.Initialize function type // InitDecryptGPUGraph called to initialize the graph. Conforms to graphs.Initialize function type
func InitDecryptGPUGraph(gc services.GraphGenerator) *services.Graph { func InitDecryptGPUGraph(gc services.GraphGenerator) *services.Graph {
if !viper.GetBool("useGPU") {
jww.WARN.Printf("Using realtime decrypt graph running on GPU instead of equivalent CPU graph")
}
g := gc.NewGraph("RealtimeDecryptGPU", &KeygenDecryptStream{}) g := gc.NewGraph("RealtimeDecryptGPU", &KeygenDecryptStream{})
decryptKeygen := graphs.Keygen.DeepCopy() decryptKeygen := graphs.Keygen.DeepCopy()
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
package realtime package realtime
import ( import (
jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
"gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/crypto/cryptops" "gitlab.com/elixxir/crypto/cryptops"
"gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/cyclic"
...@@ -177,9 +175,6 @@ var PermuteMul2Chunk = services.Module{ ...@@ -177,9 +175,6 @@ var PermuteMul2Chunk = services.Module{
// InitPermuteGraph initializes and returns a new graph. // InitPermuteGraph initializes and returns a new graph.
func InitPermuteGraph(gc services.GraphGenerator) *services.Graph { func InitPermuteGraph(gc services.GraphGenerator) *services.Graph {
if viper.GetBool("useGPU") {
jww.FATAL.Panicf("Using realtime permute graph running on CPU instead of equivalent GPU graph")
}
gcPermute := graphs.ModifyGraphGeneratorForPermute(gc) gcPermute := graphs.ModifyGraphGeneratorForPermute(gc)
g := gcPermute.NewGraph("RealtimePermute", &PermuteStream{}) g := gcPermute.NewGraph("RealtimePermute", &PermuteStream{})
...@@ -193,9 +188,6 @@ func InitPermuteGraph(gc services.GraphGenerator) *services.Graph { ...@@ -193,9 +188,6 @@ func InitPermuteGraph(gc services.GraphGenerator) *services.Graph {
// InitPermuteGPUGraph initializes a graph that uses the GPU // InitPermuteGPUGraph initializes a graph that uses the GPU
func InitPermuteGPUGraph(gc services.GraphGenerator) *services.Graph { func InitPermuteGPUGraph(gc services.GraphGenerator) *services.Graph {
if !viper.GetBool("useGPU") {
jww.WARN.Printf("Using realtime permute graph running on GPU instead of equivalent CPU graph")
}
gcPermute := graphs.ModifyGraphGeneratorForPermute(gc) gcPermute := graphs.ModifyGraphGeneratorForPermute(gc)
g := gcPermute.NewGraph("RealtimePermuteGPU", &PermuteStream{}) g := gcPermute.NewGraph("RealtimePermuteGPU", &PermuteStream{})
......
...@@ -249,7 +249,7 @@ func NewRoundComponents(gc services.GraphGenerator, topology *connect.Circuit, ...@@ -249,7 +249,7 @@ func NewRoundComponents(gc services.GraphGenerator, topology *connect.Circuit,
Timeout: newRoundTimeout, Timeout: newRoundTimeout,
} }
if pool != nil && useGPU { if pool != nil && useGPU {
realtimeDecryptDefinition.Graph = realtime.InitDecryptGPUGraph(gc) realtimeDecryptDefinition.Graph = realtime.InitDecryptGraph(gc)
} else { } else {
realtimeDecryptDefinition.Graph = realtime.InitDecryptGraph(gc) realtimeDecryptDefinition.Graph = realtime.InitDecryptGraph(gc)
} }
...@@ -284,7 +284,7 @@ func NewRoundComponents(gc services.GraphGenerator, topology *connect.Circuit, ...@@ -284,7 +284,7 @@ func NewRoundComponents(gc services.GraphGenerator, topology *connect.Circuit,
DoVerification: true, DoVerification: true,
} }
if pool != nil && useGPU { if pool != nil && useGPU {
realtimePermuteDefinition.Graph = realtime.InitPermuteGPUGraph(gc) realtimePermuteDefinition.Graph = realtime.InitPermuteGraph(gc)
} else { } else {
realtimePermuteDefinition.Graph = realtime.InitPermuteGraph(gc) realtimePermuteDefinition.Graph = realtime.InitPermuteGraph(gc)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment