Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VCilk_impls > VCilk__MC_shared_impl
view VCilk.h @ 0:b456b67cddd0
Initial add -- works, with vmalloc + probes version of VMS
| author | Me |
|---|---|
| date | Sat, 30 Oct 2010 20:51:40 -0700 |
| parents | |
| children | 2845dca6a28b |
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _VCilk_H
10 #define _VCilk_H
12 #include "VMS/Queue_impl/PrivateQueue.h"
13 #include "VMS/Hash_impl/PrivateHash.h"
14 #include "VMS/VMS.h"
16 /*This header defines everything specific to the VCilk semantic plug-in
17 */
18 typedef struct _VCilkSemReq VCilkSemReq;
21 /*Semantic layer-specific data sent inside a request from lib called in app
22 * to request handler called in MasterLoop
23 */
24 enum VCilkReqType
25 {
26 syncReq = 1,
27 mallocReq,
28 freeReq
29 };
31 struct _VCilkSemReq
32 { enum VCilkReqType reqType;
33 VirtProcr *requestingPr;
34 int32 sizeToMalloc;
35 void *ptrToFree;
36 VirtProcrFnPtr fnPtr;
37 void *initData;
38 int32 coreToSpawnOnto;
39 }
40 /* VCilkSemReq */;
42 typedef struct
43 {
44 PrivQueueStruc **readyVPQs;
45 HashTable *commHashTbl;
46 int32 numVirtPr;
47 int32 nextCoreToGetNewPr;
48 int32 primitiveStartTime;
49 }
50 VCilkSemEnv;
52 typedef struct
53 {
54 int32 syncPending;
55 int32 numLiveChildren;
56 VirtProcr *parentPr;
57 }
58 VCilkSemData;
60 //===========================================================================
62 void
63 VCilk__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
65 int32
66 VCilk__giveMinWorkUnitCycles( float32 percentOverhead );
68 void inline
69 VCilk__start_primitive();
71 int32 inline
72 VCilk__end_primitive_and_give_cycles();
74 int32
75 VCilk__giveIdealNumWorkUnits();
77 //=======================
79 void
80 VCilk__init();
82 void
83 VCilk__cleanup_after_shutdown();
85 //=======================
87 void inline
88 VCilk__spawn( int32 coreToSpawnOnto, VirtProcrFnPtr fnPtr,
89 void *initData, VirtProcr *creatingPr );
91 int32
92 VCilk__give_number_of_cores_to_spawn_onto();
94 void
95 VCilk__sync( VirtProcr *animatingPr );
97 void *
98 VCilk__malloc( int32 sizeToMalloc, VirtProcr *animPr );
100 void
101 VCilk__free( void *ptrToFree, VirtProcr *animPr );
103 void
104 VCilk__dissipate_procr( VirtProcr *procrToDissipate );
106 //=======================
108 void
109 VCilk__free_semantic_request( VCilkSemReq *semReq );
112 //========================= Internal use only =============================
113 void
114 VCilk__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
116 VirtProcr *
117 VCilk__schedule_virt_procr( void *_semEnv, int coreNum );
120 #endif /* _VCilk_H */
