| true | 42 | | trc_recv_messages( ID, max_count, status ) | | | 43 | | TRC_ID ID; | | | 44 | | int max_count; | | | 45 | | int *status; | | | 46 | | { | | | 47 | | static int *tids = (int *) NULL;
| | | 48 | | static int ntids = 0; | | | 49 | | | | | 50 | | TRC_HOST H; | | | 51 | | | | | 52 | | TRC_ID DEAD_ID_last; | | | | | ... | | | 61 | | int mid; | | | 62 | | int num; | | | 63 | | int tid; | | | 64 | | int src; | | | 65 | | int tmp; | | | 66 | | int cc; | | | 67 | | int i; | | | 68 | | | | | 69 | | | | | 70 | | | | | 71 | | if ( TRC_HOST_ADD_NOTIFY_CODE == -1 | | | 72 | | || TRC_HOST_DEL_NOTIFY_CODE == -1 | | | 73 | | #ifndef USE_PVM_33 | | | 74 | | || ID->event_ctx == -1 || ID->output_ctx == -1 | | | 75 | | #endif | | | 76 | | || ID->event_tag == -1 || ID->output_tag == -1 ) | | | 77 | | { | | | 78 | | printf( "Error: Message Codes Not Set - %d %d %d %d %d %d\n", | | | 79 | | TRC_HOST_ADD_NOTIFY_CODE, TRC_HOST_DEL_NOTIFY_CODE, | | | 80 | | ID->event_ctx, ID->output_ctx, | | | 81 | | ID->event_tag, ID->output_tag ); | | | 82 | | | | | 83 | | return( -1 ); | | | 84 | | } | | | 85 | | | | | 86 | | | | | 87 | | | | | 88 | | if ( status != NULL )
| | | 89 | | *status = TRC_MSG_STATUS_NONE;
| | | 90 | | | | | 91 | | | | | 92 | | | | | 93 | | ecnt = 0; | | | 94 | | | | | 95 | | | | | 96 | | | | | 97 | | ecnt += trc_check_host_sync( ID ); | | | 98 | | | | | 99 | | | | | 100 | | | | | 101 | | cnt = 0; | | | 102 | | | | | 103 | | while ( cnt < max_count | | | 104 | | && (mid = trc_get_msg( ID, &len, &msgtag, &src, &others )) > 0 ) | | | 105 | | { | | | 106 | | | | | 107 | | | | | 108 | | if ( status != NULL )
| | | 109 | | *status |= TRC_MSG_STATUS_ACTIVE;
| | | 110 | | | | | 111 | | | | | 112 | | | | | 113 | | if ( msgtag == TRC_HOST_ADD_NOTIFY_CODE && src == 0x80000000 ) | | | 114 | | { | | | 115 | | cc = pvm_upkint( &num, 1, 1 ); | | | 116 | | | | | 117 | | if ( cc < 0 ) | | | 118 | | pvm_perror( "Error Unpacking Host Add Notify" ); | | | 119 | | | | | 120 | | else | | | 121 | | { | | | 122 | | if ( num > ntids ) | | | 123 | | { | | | | | ... | | | 141 | | pvm_notify( PvmHostDelete,
| | | 142 | | TRC_HOST_DEL_NOTIFY_CODE, num, tids ); | | | 143 | | | | | 144 | | ecnt += trc_handle_host_add_notify( ID, tids, num ); | | | 145 | | } | | | 146 | | } | | | 147 | | } | | | 148 | | | | | 149 | | | | | 150 | | | | | 151 | | else if ( msgtag == TRC_HOST_DEL_NOTIFY_CODE | | | 152 | | && src == 0x80000000 ) | | | 153 | | { |
| | 1255 | | | | pvm_upkint(np, cnt, std) | | | 1256 | | | | int *np; | | | 1257 | | | | int cnt; | | | 1258 | | | | int std; | | | 1259 | | | | { | | | 1260 | | | | int cc; | | | 1261 | | | | long ad; | | | 1262 | | | | TEV_DECLS
| | | 1263 | | | | | | | 1264 | | | | if (TEV_EXCLUSIVE) {
| | | 1265 | | | | if (TEV_DO_TRACE(TEV_UPKINT,TEV_EVENT_ENTRY)) {
| | | 1266 | | | | ad = (long)np; | | | 1267 | | | | TEV_PACK_LONG( TEV_DID_PDA, TEV_DATA_SCALAR, &ad, 1, 1 );
| | | 1268 | | | | TEV_PACK_INT( TEV_DID_PC, TEV_DATA_SCALAR, &cnt, 1, 1 );
| | | 1269 | | | | TEV_PACK_INT( TEV_DID_PSD, TEV_DATA_SCALAR, &std, 1, 1 );
| | | 1270 | | | | TEV_FIN;
| | | 1271 | | | | } | | | 1272 | | | | } | | | 1273 | | | | | | | 1274 | | | | if (cnt < 0) | | | 1275 | | | | cc = PvmBadParam;
| | | 1276 | | | | else if (!pvmrbuf) | | | 1277 | | | | cc = PvmNoBuf;
| | | 1278 | | | | else | | | 1279 | | | | cc = (pvmrbuf->m_codef->dec_int) (pvmrbuf, (void*)np, cnt, std, sizeof(int)); | | | 1280 | | | | | | | 1281 | | | | if (TEV_AMEXCL) {
| | | 1282 | | | | if (TEV_DO_TRACE(TEV_UPKINT,TEV_EVENT_EXIT)) {
| | | 1283 | | | | TEV_PACK_INT( TEV_DID_CC, TEV_DATA_SCALAR, &cc, 1, 1 );
| | | 1284 | | | | TEV_FIN;
| | | 1285 | | | | } | | | 1286 | | | | TEV_ENDEXCL;
| | | 1287 | | | | } | | | 1288 | | | | return (cc < 0 ? lpvmerr("pvm_upkint", cc) : PvmOk);
| | tid is uninitialized | 1289 | | | | } |
|