annotate 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
rev   line source
Me@0 1 /*
Me@0 2 * Copyright 2009 OpenSourceStewardshipFoundation.org
Me@0 3 * Licensed under GNU General Public License version 2
Me@0 4 *
Me@0 5 * Author: seanhalle@yahoo.com
Me@0 6 *
Me@0 7 */
Me@0 8
Me@0 9 #ifndef _VCilk_H
Me@0 10 #define _VCilk_H
Me@0 11
Me@0 12 #include "VMS/Queue_impl/PrivateQueue.h"
Me@0 13 #include "VMS/Hash_impl/PrivateHash.h"
Me@0 14 #include "VMS/VMS.h"
Me@0 15
Me@0 16 /*This header defines everything specific to the VCilk semantic plug-in
Me@0 17 */
Me@0 18 typedef struct _VCilkSemReq VCilkSemReq;
Me@0 19
Me@0 20
Me@0 21 /*Semantic layer-specific data sent inside a request from lib called in app
Me@0 22 * to request handler called in MasterLoop
Me@0 23 */
Me@0 24 enum VCilkReqType
Me@0 25 {
Me@0 26 syncReq = 1,
Me@0 27 mallocReq,
Me@0 28 freeReq
Me@0 29 };
Me@0 30
Me@0 31 struct _VCilkSemReq
Me@0 32 { enum VCilkReqType reqType;
Me@0 33 VirtProcr *requestingPr;
Me@0 34 int32 sizeToMalloc;
Me@0 35 void *ptrToFree;
Me@0 36 VirtProcrFnPtr fnPtr;
Me@0 37 void *initData;
Me@0 38 int32 coreToSpawnOnto;
Me@0 39 }
Me@0 40 /* VCilkSemReq */;
Me@0 41
Me@0 42 typedef struct
Me@0 43 {
Me@0 44 PrivQueueStruc **readyVPQs;
Me@0 45 HashTable *commHashTbl;
Me@0 46 int32 numVirtPr;
Me@0 47 int32 nextCoreToGetNewPr;
Me@0 48 int32 primitiveStartTime;
Me@0 49 }
Me@0 50 VCilkSemEnv;
Me@0 51
Me@0 52 typedef struct
Me@0 53 {
Me@0 54 int32 syncPending;
Me@0 55 int32 numLiveChildren;
Me@0 56 VirtProcr *parentPr;
Me@0 57 }
Me@0 58 VCilkSemData;
Me@0 59
Me@0 60 //===========================================================================
Me@0 61
Me@0 62 void
Me@0 63 VCilk__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
Me@0 64
Me@0 65 int32
Me@0 66 VCilk__giveMinWorkUnitCycles( float32 percentOverhead );
Me@0 67
Me@0 68 void inline
Me@0 69 VCilk__start_primitive();
Me@0 70
Me@0 71 int32 inline
Me@0 72 VCilk__end_primitive_and_give_cycles();
Me@0 73
Me@0 74 int32
Me@0 75 VCilk__giveIdealNumWorkUnits();
Me@0 76
Me@0 77 //=======================
Me@0 78
Me@0 79 void
Me@0 80 VCilk__init();
Me@0 81
Me@0 82 void
Me@0 83 VCilk__cleanup_after_shutdown();
Me@0 84
Me@0 85 //=======================
Me@0 86
Me@0 87 void inline
Me@0 88 VCilk__spawn( int32 coreToSpawnOnto, VirtProcrFnPtr fnPtr,
Me@0 89 void *initData, VirtProcr *creatingPr );
Me@0 90
Me@0 91 int32
Me@0 92 VCilk__give_number_of_cores_to_spawn_onto();
Me@0 93
Me@0 94 void
Me@0 95 VCilk__sync( VirtProcr *animatingPr );
Me@0 96
Me@0 97 void *
Me@0 98 VCilk__malloc( int32 sizeToMalloc, VirtProcr *animPr );
Me@0 99
Me@0 100 void
Me@0 101 VCilk__free( void *ptrToFree, VirtProcr *animPr );
Me@0 102
Me@0 103 void
Me@0 104 VCilk__dissipate_procr( VirtProcr *procrToDissipate );
Me@0 105
Me@0 106 //=======================
Me@0 107
Me@0 108 void
Me@0 109 VCilk__free_semantic_request( VCilkSemReq *semReq );
Me@0 110
Me@0 111
Me@0 112 //========================= Internal use only =============================
Me@0 113 void
Me@0 114 VCilk__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
Me@0 115
Me@0 116 VirtProcr *
Me@0 117 VCilk__schedule_virt_procr( void *_semEnv, int coreNum );
Me@0 118
Me@0 119
Me@0 120 #endif /* _VCilk_H */
Me@0 121