[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/apps/Agilla/opcodes OPrtsM.nc, 1.15, 1.15.2.1

Chien-Liang Fok chien-liang at users.sourceforge.net
Wed Dec 20 04:03:12 PST 2006


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

Modified Files:
      Tag: GroupComm
	OPrtsM.nc 
Log Message:
works when the person that moved is the first to talk.

Index: OPrtsM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/opcodes/OPrtsM.nc,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -d -r1.15 -r1.15.2.1
*** OPrtsM.nc	27 Sep 2006 04:20:32 -0000	1.15
--- OPrtsM.nc	20 Dec 2006 12:03:09 -0000	1.15.2.1
***************
*** 102,105 ****
--- 102,107 ----
    uint16_t _flags;
  
+   //bool _runningRxnMgr;
+   
    task void doOProutgs();
    task void doOPrrdpgs();
***************
*** 108,111 ****
--- 110,114 ----
    {    
      _currAgent = NULL;    
+     //_runningRxnMgr = FALSE;
      call QueueI.init(&waitQueue, OP_RTS_M);
      //call QueueI.init(&waitQueue, );
***************
*** 144,191 ****
      uint16_t dest, result_t success)
    { 
!     if (_instr == IOProutgs)
!     {
!       if (post doOProutgs())
!         return SUCCESS;
!       else
!       {
!         dbg(DBG_USR1, "VM (%i:%i): OPrtsM: RemoteTSOpMgrI.done(): ERROR: Could not post doOProutgs().\n", _currAgent->id.id, _currAgent->pc-1);
!         return finish(FAIL);
!       }
!     } else if (_instr == IOPrrdpgs)
      {
!       if (success) 
        {
!         AgillaTuple buff; 
!         AgillaLocation loc;
!        
!         // remove the tuple from the agent's stack       
!         call TupleUtilI.getTuple(agent, &buff);
!        
!         // get the destination's location
!         if (call LocationMgrI.getLocation(dest, &loc))
          {
!           agent->heap.pos[0].value.value++; // update number of results
!           agent->heap.pos[agent->heap.pos[0].value.value].vtype = AGILLA_TYPE_LOCATION;
!           agent->heap.pos[agent->heap.pos[0].value.value].loc = loc;
!           
!           #if DEBUG_OP_RTS
!             dbg(DBG_USR1, "OPrtsM: OPrrdpgs: Saved location (%i, %i) onto heap[%i].\n",
!               agent->heap.pos[agent->heap.pos[0].value.value].loc.x,
!               agent->heap.pos[agent->heap.pos[0].value.value].loc.y,
!               agent->heap.pos[0].value.value);
!           #endif              
          }
!       }
!       
!       if (post doOPrrdpgs())
!         return SUCCESS;
!       else
        {
!         dbg(DBG_USR1, "VM (%i:%i): OPrtsM: RemoteTSOpMgrI.done(): ERROR: Could not post doOPrrdpgs().\n", _currAgent->id.id, _currAgent->pc-1);
!         return finish(FAIL);
!       }
!     } else
!       return finish(success);  
    }
  
--- 147,193 ----
      uint16_t dest, result_t success)
    { 
!     if (_currAgent != NULL) 
      {
!       //_runningRxnMgr = FALSE;
!       if (_instr == IOProutgs)
        {
!         if (post doOProutgs())
!           return SUCCESS;
!         else
          {
!           dbg(DBG_USR1, "VM (%i:%i): OPrtsM: RemoteTSOpMgrI.done(): ERROR: Could not post doOProutgs().\n", _currAgent->id.id, _currAgent->pc-1);
!           return finish(FAIL);
          }
!       } else if (_instr == IOPrrdpgs)
        {
!         if (success == SUCCESS) 
!         {
!           AgillaTuple buff; 
!           AgillaLocation loc;
! 
!           // remove the tuple from the agent's stack       
!           call TupleUtilI.getTuple(agent, &buff);
! 
!           // get the destination's location
!           if (call LocationMgrI.getLocation(dest, &loc))
!           {
!             agent->heap.pos[0].value.value++; // update number of results
!             agent->heap.pos[agent->heap.pos[0].value.value].vtype = AGILLA_TYPE_LOCATION;
!             agent->heap.pos[agent->heap.pos[0].value.value].loc = loc;
! 
!             #if DEBUG_OP_RTS
!               dbg(DBG_USR1, "OPrtsM: OPrrdpgs: Saved location (%i, %i) onto heap[%i].\n",
!                 agent->heap.pos[agent->heap.pos[0].value.value].loc.x,
!                 agent->heap.pos[agent->heap.pos[0].value.value].loc.y,
!                 agent->heap.pos[0].value.value);
!             #endif              
!           }
!         }
!         return post doOPrrdpgs();
!       } else
!         return finish(success);  
!     } else if (!call QueueI.empty(&waitQueue))     
!       call AgentMgrI.run(call QueueI.dequeue(NULL, &waitQueue));      
!     return SUCCESS;
    }
  
***************
*** 236,245 ****
      // Mutual Exclusion.  Only allow one agent to perform
      // a remote tuple space operation at a time.
!     if (_currAgent != NULL) 
      {
        #if DEBUG_OP_RTS
          dbg(DBG_USR1, "OPrtsM: execute(): Another agent is performing remote TS Op, waiting...\n");
!       #endif    
!       
        context->pc--;      
        return call QueueI.enqueue(context, &waitQueue, context);
--- 238,246 ----
      // Mutual Exclusion.  Only allow one agent to perform
      // a remote tuple space operation at a time.
!     if (_currAgent != NULL || call RemoteTSOpMgrI.isRunning()) 
      {
        #if DEBUG_OP_RTS
          dbg(DBG_USR1, "OPrtsM: execute(): Another agent is performing remote TS Op, waiting...\n");
!       #endif      
        context->pc--;      
        return call QueueI.enqueue(context, &waitQueue, context);
***************
*** 275,279 ****
              // get the correct flag according to the location
              if((destV.loc.x == FORCE_UART_X) && (destV.loc.y == FORCE_UART_Y))
!             	_flags |= RTS_OP_MGR_FORCE_UART;
            }
            else 
--- 276,280 ----
              // get the correct flag according to the location
              if((destV.loc.x == FORCE_UART_X) && (destV.loc.y == FORCE_UART_Y))
!               _flags |= RTS_OP_MGR_FORCE_UART;
            }
            else 
***************
*** 375,378 ****
--- 376,380 ----
          } else 
          {
+           //_runningRxnMgr = TRUE;
            #if DEBUG_OP_RTS
              dbg(DBG_USR1, "VM (%i:%i): OPrtsM: performing rout on node %i.\n", _currAgent->id.id, _currAgent->pc-1, dest);
***************
*** 406,409 ****
--- 408,412 ----
          } else 
          {
+           //_runningRxnMgr = TRUE;
            #if DEBUG_OP_RTS
              dbg(DBG_USR1, "VM (%i:%i): OPrtsM: performing rrdp on node %i.\n", _currAgent->id.id, _currAgent->pc-1, dest);



More information about the Tinyos-contrib-commits mailing list