Skip to content

Commit

Permalink
#74 Add rank calculation tracing. Fix cpu build
Browse files Browse the repository at this point in the history
  • Loading branch information
hleb-albau committed Nov 22, 2018
1 parent 494c79f commit ea32356
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cosmos/poc/app/rank/calculate_gpu_nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ package rank

import (
. "github.com/cybercongress/cyberd/cosmos/poc/app/storage"
"github.com/tendermint/tendermint/libs/log"
)

func calculateRankGPU(data *InMemoryStorage) ([]float64, int) {
func calculateRankGPU(data *InMemoryStorage, logger log.Logger) ([]float64, int) {
panic("Not Supported")
}
5 changes: 3 additions & 2 deletions cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
cpurank "github.com/cybercongress/cyberd/cosmos/poc/app/rank"
. "github.com/cybercongress/cyberd/cosmos/poc/app/storage"
"github.com/tendermint/tendermint/libs/log"
)

/*
Expand Down Expand Up @@ -78,14 +79,14 @@ func main() {
m.AddLink(LinkedCids{FromCid: CidNumber(4), ToCid: CidNumber(3), Creator: AccountNumber(2)})
m.AddLink(LinkedCids{FromCid: CidNumber(5), ToCid: CidNumber(4), Creator: AccountNumber(1)})

rank, _ = cpurank.CalculateRank(&m, cpurank.CPU)
rank, _ = cpurank.CalculateRank(&m, cpurank.CPU, log.NewNopLogger())

fmt.Printf("Rank calculated on cpu...\n")
for c, r := range rank {
fmt.Printf("%v -> %v\n", c, r)
}

rank, _ = cpurank.CalculateRank(&m, cpurank.GPU)
rank, _ = cpurank.CalculateRank(&m, cpurank.GPU, log.NewNopLogger())

fmt.Printf("Rank calculated on gpu via cyberd ...\n")
for c, r := range rank {
Expand Down

0 comments on commit ea32356

Please sign in to comment.