main
test-branch
|
Last change
on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
466 bytes
|
| Line | |
|---|
| 1 | #include <civlc.cvh>
|
|---|
| 2 | #include <assert.h>
|
|---|
| 3 | #include <mpi.h>
|
|---|
| 4 | #include <civl-mpi.cvh>
|
|---|
| 5 |
|
|---|
| 6 | $input int in;
|
|---|
| 7 | $assume(in > 0);
|
|---|
| 8 |
|
|---|
| 9 | int f1(int a, int b)
|
|---|
| 10 | $requires {$collective(MPI_COMM_WORLD) isRecvBufEmpty(0)}
|
|---|
| 11 | $requires {b@a > 1}
|
|---|
| 12 | $ensures {$result > 0}
|
|---|
| 13 | $ensures {b >= 2} {
|
|---|
| 14 |
|
|---|
| 15 | if(a == 1)
|
|---|
| 16 | return a + b;
|
|---|
| 17 | else
|
|---|
| 18 | return a - b;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | int f2(int a, int b)
|
|---|
| 22 | $ensures {a > 0}{
|
|---|
| 23 | int x;
|
|---|
| 24 |
|
|---|
| 25 | x = a + b;
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | int main() {
|
|---|
| 31 | int i = 0;
|
|---|
| 32 |
|
|---|
| 33 | i = f1(in, 2);
|
|---|
| 34 | i = f2(1, 2);
|
|---|
| 35 | return 0;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.