3 * Copyright (C) Volker Lendecke 2012
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 int main(int argc
, const char *argv
[])
27 struct asys_context
*ctx
;
34 ret
= asys_context_init(&ctx
, 0);
36 perror("asys_context_create failed");
40 fd
= open("asys_testfile", O_CREAT
|O_RDWR
, 0644);
42 perror("open failed");
46 buf
= calloc(ntasks
, sizeof(int));
48 perror("calloc failed");
52 for (i
=0; i
<ntasks
; i
++) {
56 for (i
=0; i
<ntasks
; i
++) {
57 ret
= asys_pwrite(ctx
, fd
, &buf
[i
], sizeof(int),
58 i
* sizeof(int), &buf
[i
]);
61 perror("asys_pwrite failed");
66 for (i
=0; i
<ntasks
; i
++) {
72 ret
= asys_result(ctx
, &retval
, &err
, &priv
);
75 perror("asys_result failed");
80 printf("%d returned %d\n", *pidx
, (int)retval
);
83 ret
= asys_context_destroy(ctx
);
85 perror("asys_context_delete failed");