source: CIVL/text/include/concurrency.cvl@ 7d23067

1.23 2.0 main test-branch
Last change on this file since 7d23067 was 4d9f19e, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

used linkage for libraries comm/concurrency/mpi. other libraries will be modified soon. Everything works now, except for some mpi-civl examples that use CMPI_Gcomm, which needs to be factored out to some civl-mpi library, say civlmpi.cvh.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1447 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* This file completes the definitions of types and some functions
2 * for concurrency, which are declared in concurrency.cvh.
3 */
4
5#ifdef __CIVLC_CONCURRENCY__
6#else
7#define __CIVLC_CONCURRENCY__
8
9#include<concurrency.cvh>
10
11/* *********************** Types *********************** */
12
13/* A data type representing a global barrier which must be operated by local
14 * barriers. Completes the declaration of this type in civlc-common.h.
15 */
16struct __gbarrier__ {
17 int nprocs;
18 $proc proc_map[]; // initialized as all $proc_null.
19 _Bool in_barrier[]; // initialized as all false.
20 int num_in_barrier; // initialized as 0.
21};
22
23/* A data type representing a global barrier which used for
24 * operating global barriers. The local barrier type has
25 * a handle of a global barrier.
26 * Completes the declaration of this type in civlc-common.h.
27 */
28struct __barrier__ {
29 int place;
30 $gbarrier gbarrier; // initialized as 0.
31};
32
33/* *********************** Functions *********************** */
34
35void $barrier_enter($barrier barrier);
36
37void $barrier_exit($barrier barrier);
38
39void $barrier_call($barrier barrier) {
40 $barrier_enter(barrier);
41 $barrier_exit(barrier);
42}
43
44#endif
Note: See TracBrowser for help on using the repository browser.