annotate SSR.h @ 16:6c6d7fbd7e25

added ideal num work units plus PRINT_DEBUG as macro
author Me
date Thu, 14 Oct 2010 17:06:28 -0700
parents bcc22f6f11a5
children bf57b83019e5
rev   line source
Me@6 1 /*
Me@6 2 * Copyright 2009 OpenSourceStewardshipFoundation.org
Me@6 3 * Licensed under GNU General Public License version 2
Me@6 4 *
Me@6 5 * Author: seanhalle@yahoo.com
Me@6 6 *
Me@6 7 */
Me@6 8
Me@6 9 #ifndef _SSR_H
Me@6 10 #define _SSR_H
Me@6 11
Me@6 12 #include "VMS/Queue_impl/PrivateQueue.h"
Me@6 13 #include "VMS/Hash_impl/PrivateHash.h"
Me@6 14 #include "VMS/VMS.h"
Me@6 15
Me@6 16 /*This header defines everything specific to the SSR semantic plug-in
Me@6 17 */
Me@6 18 typedef struct _SSRSemReq SSRSemReq;
Me@6 19
Me@6 20
Me@6 21 /*Semantic layer-specific data sent inside a request from lib called in app
Me@6 22 * to request handler called in MasterLoop
Me@6 23 */
Me@6 24 enum SSRReqType
Me@6 25 {
Me@6 26 send_type = 1,
Me@6 27 send_from_to,
Me@6 28 receive_any, //order and grouping matter -- send before receive
Me@6 29 receive_type, // and receive_any first of the receives -- Handlers
Me@6 30 receive_from_to,// rely upon this ordering of enum
Me@6 31 transfer_to,
Me@6 32 transfer_out
Me@6 33 };
Me@6 34
Me@6 35 struct _SSRSemReq
Me@6 36 { enum SSRReqType reqType;
Me@6 37 VirtProcr *sendPr;
Me@6 38 VirtProcr *receivePr;
Me@6 39 int32 msgType;
Me@6 40 void *msg;
Me@6 41 SSRSemReq *nextReqInHashEntry;
Me@6 42 }
Me@6 43 /* SSRSemReq */;
Me@6 44
Me@6 45 typedef struct
Me@6 46 {
Me@6 47 PrivQueueStruc **readyVPQs;
Me@14 48 HashTable *commHashTbl;
Me@14 49 int32 numVirtPr;
Me@14 50 int32 nextCoreToGetNewPr;
Me@14 51 int32 primitiveStartTime;
Me@6 52 }
Me@6 53 SSRSemEnv;
Me@6 54
Me@6 55
Me@6 56 //===========================================================================
Me@6 57
Me@6 58 void
Me@6 59 SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
Me@6 60
Me@14 61 int32
Me@14 62 SSR__giveMinWorkUnitCycles( float32 percentOverhead );
Me@14 63
Me@14 64 void inline
Me@14 65 SSR__start_primitive();
Me@14 66
Me@14 67 int32 inline
Me@14 68 SSR__end_primitive_and_give_cycles();
Me@14 69
Me@16 70 int32
Me@16 71 SSR__giveIdealNumWorkUnits();
Me@14 72
Me@6 73 //=======================
Me@6 74
Me@6 75 void
Me@6 76 SSR__init();
Me@6 77
Me@6 78 void
Me@6 79 SSR__cleanup_after_shutdown();
Me@6 80
Me@6 81 //=======================
Me@6 82
Me@6 83 inline VirtProcr *
Me@6 84 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
Me@6 85 VirtProcr *creatingPr );
Me@6 86
Me@6 87 void
Me@6 88 SSR__dissipate_procr( VirtProcr *procrToDissipate );
Me@6 89
Me@6 90 //=======================
Me@6 91 void *
Me@6 92 SSR__malloc_size_to( int numBytes, VirtProcr *ownerPr );
Me@6 93
Me@6 94 void
Me@6 95 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
Me@6 96 VirtProcr *newOwnerPr );
Me@6 97
Me@6 98 void
Me@6 99 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
Me@6 100
Me@6 101 void
Me@6 102 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
Me@6 103
Me@6 104 void
Me@6 105 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
Me@6 106
Me@6 107
Me@6 108
Me@6 109 //=======================
Me@6 110 void
Me@6 111 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
Me@6 112 VirtProcr *receivePr);
Me@6 113
Me@6 114 void
Me@6 115 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
Me@6 116
Me@6 117 void *
Me@6 118 SSR__receive_type_to( const int type, VirtProcr *receivePr );
Me@6 119
Me@6 120 void *
Me@6 121 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
Me@6 122
Me@6 123
Me@6 124 //=======================
Me@6 125
Me@6 126 void
Me@6 127 SSR__free_semantic_request( SSRSemReq *semReq );
Me@6 128
Me@6 129
Me@6 130 //========================= Internal use only =============================
Me@6 131 void
Me@6 132 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
Me@6 133
Me@6 134 VirtProcr *
Me@6 135 SSR__schedule_virt_procr( void *_semEnv, int coreNum );
Me@6 136
Me@6 137
Me@6 138 #endif /* _SSR_H */
Me@6 139