Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
284 commits
Select commit Hold shift + click to select a range
2dd5a14
print_dag: grey/white nodes
erickoskinen Apr 11, 2024
92589d5
print_pdg/dag: thicker edges if loop_carried
erickoskinen Apr 11, 2024
90de37e
fix dag nodes label
pFathololumi Apr 11, 2024
ddf886e
merge DAG
pFathololumi Apr 19, 2024
f492623
thread partitioning
pFathololumi Apr 22, 2024
f99f2fd
codegen_c: refactor to prepare for SendDep() stmt
erickoskinen Apr 23, 2024
48fdc4c
generate tasks
pFathololumi Apr 23, 2024
2454465
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Apr 23, 2024
46d1267
fix tasks dependencies
pFathololumi Apr 25, 2024
929fafc
fix types for dependency
pFathololumi Apr 25, 2024
910fc75
add support for commute dependency in pdg
pFathololumi Apr 29, 2024
102a072
some SendDep and task printing
erickoskinen Apr 30, 2024
2ea3832
fix task dependencies
pFathololumi Apr 30, 2024
0e417b8
more sendDep
erickoskinen Apr 30, 2024
72ed496
array version of ps-dswp
erickoskinen Apr 30, 2024
ede8c49
no more example task generation
erickoskinen Apr 30, 2024
0ae76bf
ps-dwp.vcy for/while
erickoskinen Apr 30, 2024
a647683
some senddep cleanup
erickoskinen Apr 30, 2024
52b10e2
fix multiple declaration
pFathololumi May 1, 2024
6835fab
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi May 1, 2024
bf01687
codegen_c support for arrays. various DOT tweaks/fixes
erickoskinen May 1, 2024
fc24864
minor task visualization improvements
erickoskinen May 2, 2024
9038599
fix data dependency analysis
pFathololumi May 2, 2024
cd44fd7
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi May 2, 2024
eb33337
minor
erickoskinen May 2, 2024
2877865
minor
erickoskinen May 2, 2024
13560c0
fix global variables
pFathololumi May 2, 2024
8934a3a
simple_frag
erickoskinen May 2, 2024
365aa74
Try to add IO specs.
Crazycolorz5 Mar 26, 2024
cf9b6d1
Basic working version of realWorld variables.
Crazycolorz5 Mar 27, 2024
99d4996
Add ideas to the notes.
Crazycolorz5 Mar 28, 2024
4cc6e5e
Add states_eq for realWorld
Crazycolorz5 Mar 28, 2024
e20868b
Fix syntax errors.
Crazycolorz5 Mar 28, 2024
9ec2d7b
Remove debug print statement.
Crazycolorz5 Mar 28, 2024
ca04f5f
Minimal example working.
Crazycolorz5 Mar 28, 2024
1ce32eb
Fix bugs and simplify model.
Crazycolorz5 Apr 1, 2024
4e88273
Continue working on specs.
Crazycolorz5 Apr 1, 2024
094ed7f
Add postconditions for other IO methods and have working example.
Crazycolorz5 Apr 2, 2024
75f3300
Add asserts to lib specs and make example more compelling.
Crazycolorz5 Apr 2, 2024
2a4f997
Move around and add examples.
Crazycolorz5 Apr 2, 2024
f17ad96
Add additional io functions requested and an example of one's use.
Crazycolorz5 Apr 4, 2024
fc70572
Add uninterpreted functions for function definitions.
Crazycolorz5 Apr 10, 2024
20b4b62
Add example.
Crazycolorz5 Apr 11, 2024
7bc7927
Add md5 benchmarking.
Crazycolorz5 Apr 23, 2024
7fa9389
Add two global commutativity examples.
Crazycolorz5 May 3, 2024
f3bc3d1
Fix some syntax errors.
Crazycolorz5 May 3, 2024
ed4fafc
simple_vector_while
erickoskinen May 3, 2024
d5c3d14
fix send dependencies issue
pFathololumi May 3, 2024
6821f02
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi May 3, 2024
f915c10
bugfix
erickoskinen May 4, 2024
8dcb1bc
fix merging labeled blocks
pFathololumi May 6, 2024
d374c58
fix parser
pFathololumi May 7, 2024
1cd3fac
infer/verify global commutativity
pFathololumi May 7, 2024
987fda4
fix commute blocks dependencies
pFathololumi May 7, 2024
708b11a
add commute condition into tasks
pFathololumi May 7, 2024
3044e13
Support for "interp --dswp"
erickoskinen May 9, 2024
5c3fcb9
fix data dependency in commute blocks
pFathololumi May 9, 2024
9318319
add dependencies to SendDep
pFathololumi May 10, 2024
5d798f4
initial support for ps-dswp execution mode
erickoskinen May 10, 2024
e8b5542
more PS-DSWP
erickoskinen May 10, 2024
42857d4
more dswp mode
erickoskinen May 16, 2024
96b0746
Fix compilation error.
Crazycolorz5 May 17, 2024
c67a809
Fix a few more errors.
Crazycolorz5 May 17, 2024
6c0ad3b
Fix mishandled call stack (might not be semantically correct?)
Crazycolorz5 May 17, 2024
3e35017
Preliminary implementation of new_job.
Crazycolorz5 May 17, 2024
f846fc0
Make new tasks run in parallel, scheduler waits for all tasks to join…
Crazycolorz5 May 20, 2024
206a14d
sendEOP sketch
erickoskinen May 20, 2024
f429a2f
Prelimiary implementation of SendEOP.
Crazycolorz5 May 21, 2024
7dede68
add SendEOP in tasks
pFathololumi May 21, 2024
5536386
add task0
pFathololumi May 21, 2024
41291ab
Changes to ps-dswp2 example.
Crazycolorz5 May 22, 2024
d903779
Clean up print statement, make compilation a togglable flag, fix comp…
Crazycolorz5 May 22, 2024
03e35f2
Some more code cleanup. Depricate ast_to_c.ml.
Crazycolorz5 May 22, 2024
4c56a5d
Add some printing modes. Fix an example.
Crazycolorz5 May 22, 2024
62df6b4
Work on ex.
Crazycolorz5 May 22, 2024
03c8742
Make printing prettier.
Crazycolorz5 May 22, 2024
a9ef2cf
Make printing prettier (again).
Crazycolorz5 May 22, 2024
19b8680
Add missing pretty print function.
Crazycolorz5 May 22, 2024
46ba4be
Add missing matching cases.
Crazycolorz5 May 22, 2024
55b5337
Add (unusued) draft of new senddep that can handle multiple input dep…
Crazycolorz5 May 22, 2024
eaf7201
support for --time in dswp mode
erickoskinen May 23, 2024
aea6ea7
Initial implementation of new scheduler aand commute stuff.
Crazycolorz5 May 23, 2024
fe869d0
Remove extraneous statement from simple_vector (see simple_vector_err)
Crazycolorz5 May 23, 2024
be13d68
dswp scaling experiments
erickoskinen May 23, 2024
9dfa4bd
support for argv/argc in dswp mode
erickoskinen May 23, 2024
e006eb0
minor
erickoskinen May 23, 2024
da5fc60
Add it so that a send_dep does not have to wait on its parent if its …
Crazycolorz5 May 23, 2024
5a36d7b
Fix rebase build error.
Crazycolorz5 May 23, 2024
d82dfb7
Somehow this file got changed. Revert it to show error.
Crazycolorz5 May 23, 2024
a4e2708
Shift location of wait in ps-dswp to show gfains from parallelization.
Crazycolorz5 Jun 18, 2024
d07bf3f
commset benchmark
pFathololumi Jun 18, 2024
aecc8ab
Change dependency checking to per-job instead of per-task.
Crazycolorz5 Jun 19, 2024
111d288
minor
pFathololumi Jun 24, 2024
4d37e71
Fix debug print issue.
Crazycolorz5 Jun 24, 2024
6ca6bd5
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Jun 24, 2024
f144222
Fixed failed pattern match on false commutativity condition.
Crazycolorz5 Jun 24, 2024
c38fb0c
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Jun 24, 2024
b19a44c
Preliminary structure for phi evaluation across two environments.
Crazycolorz5 Jun 26, 2024
816bda8
Fix some errors in the test case.
Crazycolorz5 Jun 27, 2024
ea626a2
add formals to commute_cond
pFathololumi Jul 1, 2024
999c39e
Some work towards binding separate commute conds.
Crazycolorz5 Jul 1, 2024
6e287b3
fix dependencies
pFathololumi Jul 1, 2024
d3206a2
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Jul 1, 2024
84eb202
Make formals only strings.
Crazycolorz5 Jul 1, 2024
29e5e9d
Reach compilable state.
Crazycolorz5 Jul 1, 2024
90c925f
substitute
pFathololumi Jul 1, 2024
e1fecf6
vote-infer and vote-run
erickoskinen Jul 1, 2024
76b4ca1
fix vote-infer
pFathololumi Jul 2, 2024
1e2650b
fix substitutions
pFathololumi Jul 2, 2024
edfedb9
Add debug output on bind formals failure.
Crazycolorz5 Jul 2, 2024
f2918fc
Update simple.vcy
Crazycolorz5 Jul 2, 2024
2fa312e
Make simple.vcy work.
Crazycolorz5 Jul 2, 2024
c09cc35
minor
pFathololumi Jul 2, 2024
8f13509
Unpushed changes to benches during meeting.
Crazycolorz5 Jul 3, 2024
fac984a
Add new vote-infer idea.
Crazycolorz5 Jul 3, 2024
a2a3214
Rename misnamed file.
Crazycolorz5 Jul 3, 2024
e318ddc
Make a minimal, working vote-run example.
Crazycolorz5 Jul 3, 2024
70bf4ff
debug vote-infer
pFathololumi Jul 5, 2024
84d2e57
Update to new commit of servois2.
Crazycolorz5 Jul 8, 2024
0593d62
move declarations to task0
pFathololumi Jul 8, 2024
4763098
generate init task
pFathololumi Jul 10, 2024
338be72
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Jul 10, 2024
6060c39
Mutex auto-initialization (warns on debug mode)
Crazycolorz5 Jul 11, 2024
a6ce97b
fix reconstructing AST
pFathololumi Jul 11, 2024
99c9a0f
change init task
pFathololumi Jul 11, 2024
71f16d8
Starting to implement init_job
Crazycolorz5 Jul 11, 2024
9296755
Make init_job.
Crazycolorz5 Jul 11, 2024
0217f34
Reach compilable state.
Crazycolorz5 Jul 11, 2024
086c29c
Debugged.
Crazycolorz5 Jul 12, 2024
1ee74f6
Bug fixes.
Crazycolorz5 Jul 12, 2024
3907c13
Get to runnable state.
Crazycolorz5 Jul 12, 2024
67e313c
fix init task jobs
pFathololumi Jul 12, 2024
3c0d8f8
minor
pFathololumi Jul 12, 2024
dee6a84
minor
pFathololumi Jul 12, 2024
1d77616
Add a lot of debug messages and fix init tasks not waiting on tasks w…
Crazycolorz5 Jul 12, 2024
694d3b6
Initial implementation of commutativity in init_job.
Crazycolorz5 Jul 18, 2024
3b99515
minor
pFathololumi Jul 18, 2024
dfae2b1
Various; minor
Crazycolorz5 Jul 18, 2024
90498a3
Make debug more readable, fix simple_vector
Crazycolorz5 Jul 18, 2024
6ecf7e8
Fix waiting for commutative deps.
Crazycolorz5 Jul 18, 2024
78dcc61
commset.vcy new design
pFathololumi Jul 23, 2024
cae5222
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Jul 23, 2024
233e958
Scale vote-run scalingfactor accordinly to match other benches.
Crazycolorz5 Jul 18, 2024
4127cdb
Add commset benching.
Crazycolorz5 Jul 26, 2024
5a831ed
refine benchmarking commset.
Crazycolorz5 Jul 26, 2024
38fd477
fix self commute
pFathololumi Jul 29, 2024
a90a363
uninterp functions
pFathololumi Jul 29, 2024
565ba3a
Create workaround.
Crazycolorz5 Aug 1, 2024
13c17b1
Update servois2 commit.
Crazycolorz5 Aug 1, 2024
14e4061
plot script
pFathololumi Aug 2, 2024
c3580d8
minor
pFathololumi Aug 6, 2024
bf84074
Rename some files for consistency/clarity.
Crazycolorz5 Aug 12, 2024
c728767
minor fix
pFathololumi Aug 12, 2024
c59109f
new benchmarks
pFathololumi Aug 12, 2024
e024c28
fix benchmark
pFathololumi Aug 12, 2024
324c2dc
Increase busy wait for multi-blocks by 1000x
Crazycolorz5 Aug 12, 2024
c2c0af1
add benchmark to script
pFathololumi Aug 12, 2024
5cc4493
Make commset and simple-io IO rate limited. Adjust speedup dswp appro…
Crazycolorz5 Aug 12, 2024
96862d1
Add toggleable threads option for dswp mode.
Crazycolorz5 Aug 14, 2024
49e02e2
minor fix
pFathololumi Aug 15, 2024
81dbc52
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Aug 16, 2024
08a896b
motivation benchmark
pFathololumi Aug 26, 2024
b812481
wrong merge of return
pFathololumi Aug 30, 2024
cfbac9c
missing data dependency for SBlock
pFathololumi Aug 30, 2024
13df490
minor
pFathololumi Sep 3, 2024
3eda3d1
fix some variable scoping issues.
Crazycolorz5 Sep 9, 2024
eefe616
send_dep non-blocking, block in new thread waiting for deps.
Crazycolorz5 Sep 9, 2024
3d0c2bb
Correct notes.
Crazycolorz5 Sep 9, 2024
f5e5e47
Add benching results.
Crazycolorz5 Sep 10, 2024
39ace26
Remove unused mutex init (that could cause error if it ran after the …
Crazycolorz5 Sep 10, 2024
933eb52
fix motivation benchmark
pFathololumi Sep 10, 2024
7346177
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Sep 10, 2024
dcae1e7
fix data-dependency in simple-vector
pFathololumi Sep 10, 2024
2dba265
readme edits
erickoskinen Sep 11, 2024
ae2502e
arran runs
erickoskinen Sep 11, 2024
2c9c87b
Merge branch 'global_commutativity' of github.com:veracity-lang/verac…
erickoskinen Sep 11, 2024
78986aa
edit plot
pFathololumi Sep 11, 2024
a340fe6
new motivation benchmark
pFathololumi Sep 11, 2024
f10c997
Remove waiting on EOP.
Crazycolorz5 Sep 16, 2024
f1ca527
Fix empty waits on init jobs
Crazycolorz5 Sep 16, 2024
ea22c5f
Add some notes on non-empty waits.
Crazycolorz5 Sep 16, 2024
e58d4cf
Add notes on benchmarks.
Crazycolorz5 Sep 16, 2024
94d2a6e
add empty data dep edges
pFathololumi Sep 16, 2024
3ef354d
Add starting processes and waiting in topological order.
Crazycolorz5 Sep 19, 2024
8b61728
Update benchmark notes.
Crazycolorz5 Sep 24, 2024
db1661f
Add cases for self-loops in topsort algorithm (ignore them)
Crazycolorz5 Sep 25, 2024
579a2a3
fix redundant tasks
pFathololumi Sep 25, 2024
93b7246
merge
pFathololumi Sep 25, 2024
5b7723e
Disallow self-waiting.
Crazycolorz5 Sep 26, 2024
c0320fa
fix verify
pFathololumi Sep 26, 2024
a9a7014
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Sep 26, 2024
68e5211
minor syntax
pFathololumi Sep 26, 2024
74d33f3
Remove print statement to a debug print (should fix report generation).
Crazycolorz5 Sep 30, 2024
2bbe939
Rerun benches.
Crazycolorz5 Sep 30, 2024
ca8119e
re-rerun tests with bigger sizes enabled.
Crazycolorz5 Sep 30, 2024
197bb9e
Clean up code using Mutex.protect.
Crazycolorz5 Sep 30, 2024
74e32d2
Fix an issue where two threads could initialize a different mutex (hu…
Crazycolorz5 Sep 30, 2024
2d6979e
Make waiting only on un-finished jobs.
Crazycolorz5 Oct 2, 2024
071e9a4
new plot
pFathololumi Oct 2, 2024
245098b
Add debug message printing the topological order association list.
Crazycolorz5 Oct 4, 2024
7d3f5a7
fix missing data dependencies
pFathololumi Oct 4, 2024
a6b4c09
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Oct 4, 2024
9b0bef8
make a flag for new job data-dep
pFathololumi Oct 6, 2024
cd01bdb
Fix type error in debug message.
Crazycolorz5 Oct 4, 2024
50613ed
Reduce iteration count on motivation
Crazycolorz5 Oct 7, 2024
5acbf17
Fix top sort to use only the newJob graph.
Crazycolorz5 Oct 7, 2024
e7d5187
Change from using top sort to a brute force topological layering.
Crazycolorz5 Oct 7, 2024
5c4634a
Remove duplicate waits.
Crazycolorz5 Oct 7, 2024
bdf740b
Modify parameters to motivation in speedup script.
Crazycolorz5 Oct 8, 2024
5cd8e59
fix index out of bound issue
pFathololumi Oct 8, 2024
89950b7
fix data dependency lifting
pFathololumi Oct 9, 2024
ba5d141
Make motivation's scaling factor bigger.
Crazycolorz5 Oct 9, 2024
6d6ffdf
new run
Oct 10, 2024
4fe2016
minor edit in plot script
pFathololumi Oct 11, 2024
3321f36
script for no commutativity
pFathololumi Oct 14, 2024
7c1bc04
minor
pFathololumi Oct 14, 2024
0b09348
new run on arran
Oct 14, 2024
5291206
run for non commutativity in arran
Oct 15, 2024
88fa7c6
missed files
Oct 15, 2024
9b68773
fix unmerged dependencies
pFathololumi Oct 15, 2024
3cd3e98
Improve some benchmarks
Crazycolorz5 Oct 15, 2024
faaa8fd
make motivation work on bigger numbers.
Crazycolorz5 Oct 15, 2024
d9a3b5a
new plot arran
Oct 15, 2024
59de64f
new run non commute
Oct 15, 2024
b9191f0
new plots + minor edits
pFathololumi Oct 15, 2024
eb714ac
new script + plots
pFathololumi Oct 22, 2024
46ff854
script for no NB
pFathololumi Oct 23, 2024
8858c4c
new run in arran
Oct 23, 2024
08890ab
sec5 example
erickoskinen Oct 25, 2024
32a2369
update speedup script
pFathololumi Oct 29, 2024
10a6754
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Oct 29, 2024
19080a9
Correct error in simpleio
Crazycolorz5 Nov 5, 2024
55dce1a
minor update in plot script
pFathololumi Nov 5, 2024
9588ff6
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Nov 5, 2024
44bde93
fix bugs to ignore SBlock with no label
pFathololumi Nov 6, 2024
31d168e
new results on arran
Nov 7, 2024
a8173cd
fix a bug
pFathololumi Nov 8, 2024
673a113
new run for multi-blocks
Nov 8, 2024
139df30
Update simple-vector.vcy
Crazycolorz5 Nov 11, 2024
cced171
Add version of simple-io that can be verified.
Crazycolorz5 Nov 12, 2024
fedc568
change plots style
pFathololumi Nov 12, 2024
2c93bb8
Add version of commset that can verify
Crazycolorz5 Nov 12, 2024
b25acd0
Merge branch 'global_commutativity' of https://github.com/veracity-la…
pFathololumi Nov 12, 2024
d5606ce
multi-blocks
Nov 12, 2024
d5714a6
new run on Arran
Nov 13, 2024
2706bac
manually add dependency for simple-io
Nov 14, 2024
a088ebf
minor cleanup
pFathololumi Nov 15, 2024
37a58e9
Merge branch 'main' into global_commutativity
Crazycolorz5 Jan 24, 2025
b78f1e0
Merge pull request #1 from veracity-lang/global_commutativity
Crazycolorz5 Jan 27, 2025
285dc05
pruning unused taskparallel folder
erickoskinen Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[submodule "src/servois2"]
path = src/servois2
url = https://github.com/veracity-lang/servois2.git
ignore = dirty
ignore = dirty
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"*.smtlib2": "smt-lib",
"*.vcy": "c",
"random": "c",
"stdlib.h": "c",
"string": "c"
"fetchandadd": "c"
}
}
}
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ add-apt-repository ppa:avsm/ppa
apt update
apt install opam
apt install cvc4
apt install graphviz # optional, for PDG output

opam init
eval $(opam env)

opam update
opam switch create 4.12.0mc 4.12.0+domains+effects --repositories=multicore=git+https://github.com/ocaml-multicore/multicore-opam.git,default
opam switch 4.12.0mc
#opam switch create 4.12.0mc 4.12.0+domains+effects --repositories=multicore=git+https://github.com/ocaml-multicore/multicore-opam.git,default
#opam switch 4.12.0mc
opam switch create 5.2.0
eval $(opam env)

opam install sexplib ppxlib.0.22.0+effect-syntax ppx_deriving_yaml ounit2 menhir
#opam install sexplib ppxlib.0.22.0+effect-syntax ppx_deriving_yaml
opam install ounit2 menhir zarith yaml domainslib
eval $(opam env)
```

Expand Down
49 changes: 49 additions & 0 deletions benchmarks/global_commutativity/2d-array.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@


int main(int argc, string[] argv) {
int[] pIds = new int[100];
bool[] visited = new bool[100];
int pSize = 100;
/* Each row is a fixed p, variable q */
int[] pValue = new int[100];
bool[][] pqFlag = new bool[][100];
int sum =0;
/* initialize pqFlag */
int i = 0;
int p = 0;
int id = 0;
int row = 0;
int q = 0;
int scalingfactor = 1000;
scalingfactor = int_of_string(argv[1]);

/* mutex_init(0); */
while(i < 100) {
pqFlag[i] = new bool[100];
pIds[i] = i;
pValue[i] = i;
/* if (pIds[i] < 0) { pIds[i] = i; } */
i = i + 1;
}

while(p < pSize){
id = pIds[p];
if(!visited[id % 100]){
visited[id % 100] = true;

row = p; /* "row" should be the dep */
q = 0;
while (q < 99 && !pqFlag[row][q%100]){
busy_wait(scalingfactor);
q = q+1;
}
if(q < 100){
mutex_lock(0);
sum = (sum + pValue[row]) % 256;
mutex_unlock(0);
}
}
p = p + 1;
}
return sum;
}
40 changes: 40 additions & 0 deletions benchmarks/global_commutativity/commset-verify.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
commutativity {
{f1(i_left)}, {f1(i_right)} : (i_left != i_right)
}

int main(int argc, string[] argv) {
int i = 1;
int i_left = 1;
int i_right = 1;
string[] digest = new string[16];

while (i < argc){
f1(i):{
string temp = "";
string filename = "";
string s = "";
int m = md5_lower(s);
filename = argv[i];
in_channel c = open_read(filename);
s = read_line(c);
temp = string_of_int(m);

close(c);
digest[i] = temp;
print(digest[i]);
print("\n");

temp = "";
filename = "";
s = "";
m = 0;
c = open_read(temp);
close(c);
}
i = i + 1;
}

return 0;
}


38 changes: 38 additions & 0 deletions benchmarks/global_commutativity/commset.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
commutativity {
{f1(i_1)}, {f1(i_2)} : (i_1 != i_2)
}

int main(int argc, string[] argv) {
int i = 1;
string[] digest = new string[16];
string s = "";
int i_1 = 0;
int i_2 = 0;
string filename = "";

while (i < argc){
f1(i):{
int j = 0;
string temp = "";
filename = argv[i];
while (j < 10) { /* Artificially increase workload by 10x */
j = j+1;

in_channel c = open_read(filename);
s = read_line(c);
int j = 0;
temp = string_of_int(md5_lower(s));

close(c);
}
digest[i] = temp;
print(digest[i]);
print("\n");
}
i = i + 1;
}

return 0;
}


34 changes: 34 additions & 0 deletions benchmarks/global_commutativity/commset_infer.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
commutativity {
{f1(i_1, digest)}, {f1(i_2, digest)} : _
}

int i = 1;
string[] digest = new string[16];

int main(int argc, string[] argv) {
int i_1 = 0;
int i_2 = 0;

while (i < argc){
f1(i, digest):{
string filename = argv[i];
in_channel c = open_read(filename);
string s = read_line(c);
int md5 = md5_lower(s);
string temp = string_of_int(md5);
digest[i] = temp;
close(c);

filename = "";
s = "";
temp = "";
md5 = 0;
c = open_read(filename);
}
i = i + 1;
}

return 0;
}


45 changes: 45 additions & 0 deletions benchmarks/global_commutativity/motivation.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
commutativity {
{f1(i_1, x, arr)}, {f2(i_2, arr)}: ((i_1 != i_2) || (i_1 == i_2 && arr[i_1] > 0))
}

int main(int argc, string[] argv) {
int scalingfactor = int_of_string(argv[1]);
int x = 10;
int[] arr = new int[1000];
int size = int_of_string(argv[2]);
int[] out = new int[size];
int i = 0;
int j = 0;
int i_1 = 0;
int i_2 = 2;
int res = 0;
int t = 0;

while (j < 1000) {
arr[j] = random(1, 1000);
j = j + 1;
}

while (i < size) {
f1(i, x, arr):{ /* will only increase arr[i] */
busy_wait(scalingfactor);
x = i;
arr[i] = arr[i] + (x*x);
}

f2(i, arr):{ /* only observes if arr[i]>0 */
t = /*compute*/(i);
busy_wait(scalingfactor);
if (arr[i] > 0 && t < 0) {
arr[i] = arr[i] - 1;
out[i] = /*calc2*/(t);
} else {
out[i] = /*calc3*/(t);
}
}

i = i + 1;
}

return arr[0];
}
71 changes: 71 additions & 0 deletions benchmarks/global_commutativity/multi-blocks.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
commutativity {
{f1(tbl,x,y)}, {f2(tbl,z,y)}: (tbl[z] == tbl[x] && !(z == x) || z == x);
{f2(tbl,z,y)}, {f3(tbl,z,y)}: (!(ht_size(tbl) > 0) && !(0 == z) || 0 == z);
{f4(files,i_1)}, {f4(files,i_2)}: (files[i_2] == files[i_1]);
{f4(files,i_1)}, {f6(files,i_3)}: (!(i_3 == i_1));
{f1(tbl,x,y)}, {f3(tbl,z,y)}: (!(ht_size(tbl) > 0) && !(0 == ht_size(tbl)) && !(0 == z) || 0 == ht_size(tbl) && !(0 == z) || 0 == z);
{f1(tbl,x,y)}, {f4(files,i_1)}: (true);
{f1(tbl,x,y)}, {f6(files,i_3)}: (true);
{f2(tbl,z,y)}, {f4(files,i_1)}: (true);
{f2(tbl,z,y)}, {f6(files,i_3)}: (true);
{f3(tbl,z,y)}, {f4(files,i_1)}: (true);
{f3(tbl,z,y)}, {f6(files,i_3)}: (true)
}

int main(int argc, string[] argv) {
hashtable[int,int] tbl = new hashtable[int,int];
int n = 1000 * int_of_string(argv[1]);
int x = 2;
int y = 5;
int z = 0;
int f = 1;
int g = 0;
int i = 0;
int i_1 = 3;
int i_2 = 3;
int i_3 = 4;
int j = 0;

int[] files = new int[10];

tbl[x] = 12;
tbl[z] = 12;

while(j < 10) {
files[j] = j;
j = j + 1;
}

f1(tbl,x,y):{
busy_wait(n);
if(ht_mem(tbl, x)) {
y = ht_get(tbl, x);
}
}
f2(tbl,z,y): {
y = ht_get(tbl, z);
busy_wait(n);
}
f3(tbl,z,y): {
busy_wait(n);
if(ht_size(tbl) > 0) {
y = y + z;
}
}

f4(files,i):{
busy_wait(n);
f = files[i];
f = f + 5;
files[i] = f;
}

f6(files,i):{
busy_wait(n);
g = files[i];
g = g + 5;
files[i] = g;
}

return 0;
}
20 changes: 20 additions & 0 deletions benchmarks/global_commutativity/nested_if.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
commutativity {

}

int main(int argc, string[] argv) {
int x = 1;
x = x + 2;
if(x > 2) {
if (x == 3){
x = x - 1;
}
}
else{
x = x + 1;
}

return x;
}


32 changes: 32 additions & 0 deletions benchmarks/global_commutativity/nested_if_loop.vcy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
commutativity {

}

int main(int argc, string[] argv) {
int x = 0;
x = 1;
x = x + 2;
if(x > 2) {
if (x == 3){
x = x * 10;
while(x > 4) {
x = x - 1;
}
}
else{
x = x * 2;
}
}
else{
if(x == 0){
x = x + 2;
}
else{
x = x + 1;
}
}

return x;
}


Loading