-
Notifications
You must be signed in to change notification settings - Fork 442
gkr_nonnative intial review #1162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amit0365
wants to merge
26
commits into
Consensys:master
Choose a base branch
from
amit0365:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b1a4c73
gkr_nonnative intial review
2825fdc
removed unused fns
94a6866
added some tests
6cbdc74
Debugged nil elements -m added verifier in claimsmaanager and popoula…
2b30342
Revert "Debugged nil elements -m added verifier in claimsmaanager and…
ac3b04e
git commit -m "Debugged nil elements" -m "Added verifier in ClaimsMan…
59c8554
Debugged nil elements
650d48a
removed unused fns
4717901
compiles now
04b5caf
fixed
9a6f78c
resolve ivo comments - prover done
TheDarkMatters a8917d9
fixed ivo comments
amit0365 5224fac
removed Fr naming with Emulated
amit0365 4720856
removed all Fr with Emulated
amit0365 218c27a
testing single add gate
amit0365 6670c2d
testgkrvector fails, debug
amit0365 043048b
arya review test
amit0365 0da71f7
fixed single_identity_gate_two_instances prove, renamed partialSumPol…
amit0365 93e787c
single identity gate passes testgkr
amit0365 b091b79
testgkr passes
amit0365 81335d7
commented print patch
amit0365 29c23c5
changes from gofmt
amit0365 3a72147
fixed lint
amit0365 b34071a
removed TestLogNbInstances
amit0365 47bad48
dbladdgkr passes
amit0365 800dcb3
cleanup
amit0365 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package parallel | ||
|
||
import ( | ||
"runtime" | ||
"sync" | ||
) | ||
|
||
// Execute process in parallel the work function | ||
func Execute(nbIterations int, work func(int, int), maxCpus ...int) { | ||
|
||
nbTasks := runtime.NumCPU() | ||
if len(maxCpus) == 1 { | ||
nbTasks = maxCpus[0] | ||
if nbTasks < 1 { | ||
nbTasks = 1 | ||
} else if nbTasks > 512 { | ||
nbTasks = 512 | ||
} | ||
} | ||
|
||
if nbTasks == 1 { | ||
// no go routines | ||
work(0, nbIterations) | ||
return | ||
} | ||
|
||
nbIterationsPerCpus := nbIterations / nbTasks | ||
|
||
// more CPUs than tasks: a CPU will work on exactly one iteration | ||
if nbIterationsPerCpus < 1 { | ||
nbIterationsPerCpus = 1 | ||
nbTasks = nbIterations | ||
} | ||
|
||
var wg sync.WaitGroup | ||
|
||
extraTasks := nbIterations - (nbTasks * nbIterationsPerCpus) | ||
extraTasksOffset := 0 | ||
|
||
for i := 0; i < nbTasks; i++ { | ||
wg.Add(1) | ||
_start := i*nbIterationsPerCpus + extraTasksOffset | ||
_end := _start + nbIterationsPerCpus | ||
if extraTasks > 0 { | ||
_end++ | ||
extraTasks-- | ||
extraTasksOffset++ | ||
} | ||
go func() { | ||
work(_start, _end) | ||
wg.Done() | ||
}() | ||
} | ||
|
||
wg.Wait() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.