[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/apps/Agilla/components AgentMgrM.nc, 1.30.2.1, 1.30.2.2 HeapMgrM.nc, 1.5, 1.5.2.1 RxnMgrM.nc, 1.9, 1.9.2.1

Chien-Liang Fok chien-liang at users.sourceforge.net
Mon Nov 20 22:55:43 PST 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14117/components

Modified Files:
      Tag: GroupComm
	AgentMgrM.nc HeapMgrM.nc RxnMgrM.nc 
Log Message:
It works.

Index: AgentMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/AgentMgrM.nc,v
retrieving revision 1.30.2.1
retrieving revision 1.30.2.2
diff -C2 -d -r1.30.2.1 -r1.30.2.2
*** AgentMgrM.nc	21 Nov 2006 00:27:33 -0000	1.30.2.1
--- AgentMgrM.nc	21 Nov 2006 06:55:40 -0000	1.30.2.2
***************
*** 198,203 ****
      #endif
      for(i=0; i < AGILLA_NUM_AGENTS; i++) {
!       if (agents[i].id.id == id->id && agents[i].state != AGILLA_STATE_HALT)
!         return &agents[i];
      }
      #if DEBUG_AGENT_MGR
--- 198,209 ----
      #endif
      for(i=0; i < AGILLA_NUM_AGENTS; i++) {
!       if (agents[i].state != AGILLA_STATE_HALT) {
!         #if DEBUG_AGENT_MGR
!           dbg(DBG_USR1, "AgentMgrI.getContext():\tComparing %i with %i.\n", agents[i].id.id, id->id);
!         #endif
! 
!         if (agents[i].id.id == id->id)
!           return &agents[i];
!       }
      }
      #if DEBUG_AGENT_MGR

Index: HeapMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/HeapMgrM.nc,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** HeapMgrM.nc	18 May 2006 19:58:40 -0000	1.5
--- HeapMgrM.nc	21 Nov 2006 06:55:40 -0000	1.5.2.1
***************
*** 93,96 ****
--- 93,100 ----
      bool msgFull = FALSE;
         
+     #if DEBUG_HEAPMGR
+       dbg(DBG_USR1, "HeapMgrM: HeapMgrI.fillMsg(): called with addr=%i\n", addr);
+     #endif       
+ 
      // find the next used heap address    
      while (addr < AGILLA_HEAP_SIZE  && !msgFull)
***************
*** 100,103 ****
--- 104,112 ----
        {
          uint16_t varSize = call VarUtilI.getSize(context, vType);        
+         
+         #if DEBUG_HEAPMGR
+           dbg(DBG_USR1, "HeapMgrM: HeapMgrI.fillMsg(): heap[%i] vType=%s varSize=%i\n", addr, call VarUtilI.typeToString(vType), varSize);
+         #endif            
+         
          if (varSize != 0 && i + varSize + 2 < AGILLA_HEAP_MSG_SIZE) 
          {
***************
*** 108,112 ****
--- 117,126 ----
          } else 
            msgFull = TRUE;
+       } else {
+         #if DEBUG_HEAPMGR
+           dbg(DBG_USR1, "HeapMgrM: HeapMgrI.fillMsg(): heap[%i] vType==AGILLA_TYPE_INVALID\n", addr);
+         #endif                  
        }
+       
        if (!msgFull)
          addr++;              
***************
*** 135,145 ****
      bool done;
      
      addr = heapMsg->data[i++];
      vtype = heapMsg->data[i++];    
      done = (vtype == AGILLA_TYPE_INVALID);
      
      if (context->heap.pos[addr].vtype != AGILLA_TYPE_INVALID) 
      {
!       dbg(DBG_USR1, "HeapMgrM: HeapMsgI.saveMsg(): ERROR: The heap message was a duplicate.\n");
        return SUCCESS;
      }
--- 149,173 ----
      bool done;
      
+     #if DEBUG_HEAPMGR
+       dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): Saving message, id = %i....\n", heapMsg->id);
+       for (i = 0; i < AGILLA_HEAP_MSG_SIZE; i++) {
+         dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): \t%i: %i\n", i, heapMsg->data[i]);        
+       }
+       i = 0;
+     #endif    
+     
      addr = heapMsg->data[i++];
      vtype = heapMsg->data[i++];    
      done = (vtype == AGILLA_TYPE_INVALID);
      
+     if (done) 
+     {
+       dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): The first vtype in heap message is INVALID!\n");
+       return SUCCESS;
+     }    
+     
      if (context->heap.pos[addr].vtype != AGILLA_TYPE_INVALID) 
      {
!       dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): ERROR: The heap message was a duplicate.\n");
        return SUCCESS;
      }
***************
*** 151,156 ****
        {
        
!         #if DEBUG_HEAP_MGR
!           dbg(DBG_USR1, "HeapMgrM: HeapMsgI.saveMsg(): Saving variable  type %i in heap[%i].\n", vtype, addr);
          #endif
          
--- 179,184 ----
        {
        
!         #if DEBUG_HEAPMGR
!           dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): Saving variable  type %i in heap[%i].\n", vtype, addr);
          #endif
          
***************
*** 169,173 ****
        } else
        {
!         dbg(DBG_USR1, "HeapMgrM: HeapMsgI.saveMsg(): ERROR: Variable in HeapMsg is size 0.\n");
        }
      }
--- 197,201 ----
        } else
        {
!         dbg(DBG_USR1, "HeapMgrM: HeapMgrI.saveMsg(): ERROR: Variable in HeapMsg is size 0.\n");
        }
      }

Index: RxnMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/RxnMgrM.nc,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -d -r1.9 -r1.9.2.1
*** RxnMgrM.nc	18 May 2006 19:58:40 -0000	1.9
--- RxnMgrM.nc	21 Nov 2006 06:55:40 -0000	1.9.2.1
***************
*** 98,103 ****
          AgillaAgentContext* context = call AgentMgrI.getContext(&buffer[i].rxn.id);        
          
!         if (context == NULL)
            continue;
         
          #if DEBUG_RXNMGR
--- 98,108 ----
          AgillaAgentContext* context = call AgentMgrI.getContext(&buffer[i].rxn.id);        
          
!         if (context == NULL) {
!           #if DEBUG_RXNMGR
!             dbg(DBG_USR1, "RxnMgrM: runRxnMgr(): context for buffer[%i] is null, id = %i\n", i, buffer[i].rxn.id);
!             call TupleUtilI.printTuple(&buffer[i].rxn.template);
!           #endif          
            continue;
+         }
         
          #if DEBUG_RXNMGR
***************
*** 168,171 ****
--- 173,180 ----
            #endif      
          }
+       } else {
+           #if DEBUG_RXNMGR
+             dbg(DBG_USR1, "RxnMgrM: runRxnMgr(): Reaction buffer[%i] is empty.\n", i);
+           #endif            
        }
      }



More information about the Tinyos-contrib-commits mailing list