Me@0: /* Me@0: * Copyright 2009 OpenSourceStewardshipFoundation.org Me@0: * Licensed under GNU General Public License version 2 Me@0: * Me@0: * Author: seanhalle@yahoo.com Me@0: * Me@0: */ Me@0: Me@0: #ifndef _VCilk_H Me@0: #define _VCilk_H Me@0: Me@0: #include "VMS/Queue_impl/PrivateQueue.h" Me@0: #include "VMS/Hash_impl/PrivateHash.h" Me@0: #include "VMS/VMS.h" Me@0: Me@0: /*This header defines everything specific to the VCilk semantic plug-in Me@0: */ Me@0: typedef struct _VCilkSemReq VCilkSemReq; Me@0: Me@0: Me@0: /*Semantic layer-specific data sent inside a request from lib called in app Me@0: * to request handler called in MasterLoop Me@0: */ Me@0: enum VCilkReqType Me@0: { Me@0: syncReq = 1, Me@0: mallocReq, Me@0: freeReq Me@0: }; Me@0: Me@0: struct _VCilkSemReq Me@0: { enum VCilkReqType reqType; Me@0: VirtProcr *requestingPr; Me@0: int32 sizeToMalloc; Me@0: void *ptrToFree; Me@0: VirtProcrFnPtr fnPtr; Me@0: void *initData; Me@0: int32 coreToSpawnOnto; Me@0: } Me@0: /* VCilkSemReq */; Me@0: Me@0: typedef struct Me@0: { Me@0: PrivQueueStruc **readyVPQs; Me@0: HashTable *commHashTbl; Me@0: int32 numVirtPr; Me@0: int32 nextCoreToGetNewPr; Me@0: int32 primitiveStartTime; Me@0: } Me@0: VCilkSemEnv; Me@0: Me@0: typedef struct Me@0: { Me@0: int32 syncPending; Me@0: int32 numLiveChildren; Me@0: VirtProcr *parentPr; Me@0: } Me@0: VCilkSemData; Me@0: Me@0: //=========================================================================== Me@0: Me@0: void Me@0: VCilk__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); Me@0: Me@0: int32 Me@0: VCilk__giveMinWorkUnitCycles( float32 percentOverhead ); Me@0: Me@0: void inline Me@0: VCilk__start_primitive(); Me@0: Me@0: int32 inline Me@0: VCilk__end_primitive_and_give_cycles(); Me@0: Me@0: int32 Me@0: VCilk__giveIdealNumWorkUnits(); Me@0: Me@0: //======================= Me@0: Me@0: void Me@0: VCilk__init(); Me@0: Me@0: void Me@0: VCilk__cleanup_after_shutdown(); Me@0: Me@0: //======================= Me@0: Me@0: void inline Me@0: VCilk__spawn( int32 coreToSpawnOnto, VirtProcrFnPtr fnPtr, Me@0: void *initData, VirtProcr *creatingPr ); Me@0: Me@0: int32 Me@0: VCilk__give_number_of_cores_to_spawn_onto(); Me@0: Me@0: void Me@0: VCilk__sync( VirtProcr *animatingPr ); Me@0: Me@0: void * Me@0: VCilk__malloc( int32 sizeToMalloc, VirtProcr *animPr ); Me@0: Me@0: void Me@0: VCilk__free( void *ptrToFree, VirtProcr *animPr ); Me@0: Me@0: void Me@0: VCilk__dissipate_procr( VirtProcr *procrToDissipate ); Me@0: Me@0: //======================= Me@0: Me@0: void Me@0: VCilk__free_semantic_request( VCilkSemReq *semReq ); Me@0: Me@0: Me@0: //========================= Internal use only ============================= Me@0: void Me@0: VCilk__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); Me@0: Me@0: VirtProcr * Me@0: VCilk__schedule_virt_procr( void *_semEnv, int coreNum ); Me@0: Me@0: Me@0: #endif /* _VCilk_H */ Me@0: