? .socketProfile.C.swp
? Cycle_counter.h
? Makefile
? Makefile.in
? a.out
? config.log
? config.status
? difference
? socketProfile.C
? stVy0mkT
? tt
? debugger/libp2debugger.la
? debugger/libp2debugger_la-execRecord.lo
? debugger/libp2debugger_la-ruleTracer.lo
? debugger/libp2debugger_la-tableTracer.lo
? debugger/libp2debugger_la-tap.lo
? debugger/libp2debugger_la-traceTuple.lo
? elements/delay-older.C
? p2core/QUCandidate.h
? p2core/QULT.h
? p2core/QUOSH.h
? p2core/QURH.h
? p2core/parameters.h
? p2core/pel_vm_bkp.C
? p2core/val_qu_cand.C
? p2core/val_qu_cand.h
? p2core/val_qu_lt.C
? p2core/val_qu_lt.h
? p2core/val_qu_rh.C
? p2core/val_qu_rh.h
? planner/.libs
? planner/libp2planner.la
? planner/libp2planner_la-eca_context.lo
? planner/libp2planner_la-localize_context.lo
? planner/libp2planner_la-netPlanner.lo
? planner/libp2planner_la-planContext.lo
? planner/libp2planner_la-planner.lo
? planner/libp2planner_la-ruleStrand.lo
? planner/libp2planner_la-stageStrand.lo
? planner/libp2planner_la-tableStore.lo
? python/scripts/dfrun.py
? python/scripts/loadManyChords.py
? python/scripts/monolithic.py
? python/scripts/p2insert.py
? python/scripts/p2terminal.py
? python/scripts/planetlab.py
? python/scripts/psetup.py
? python/scripts/setupMonolithic.py
? stages/.libs
? stages/Makefile
? stages/Makefile.in
? stages/libp2stages.la
? stages/libp2stages_la-stageLoader.lo
? stages/libp2stages_la-tokenizer.lo
cvs diff: Diffing .
cvs diff: Diffing autom4te.cache
Index: autom4te.cache/requests
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/autom4te.cache/requests,v
retrieving revision 1.2
diff -r1.2 requests
68d67
<                         'AM_RUN_LOG' => 1,
70a70
>                         'AM_RUN_LOG' => 1,
cvs diff: Diffing dart
cvs diff: Diffing dart/bin
cvs diff: Diffing dart/doc
cvs diff: Diffing dart/lib
cvs diff: Diffing dart/lib/python2.2
cvs diff: Diffing dart/sigmod
cvs diff: Diffing dart/sosp
cvs diff: Diffing debugger
cvs diff: Diffing doc
cvs diff: Diffing elements
Index: elements/delay.C
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/elements/delay.C,v
retrieving revision 1.3
diff -r1.3 delay.C
26a27
> #include "parameters.h"
69a71
> #ifdef USE_PBFT
73a76,80
> #endif
> #ifdef USE_QU
> 	// we send one message with all the authenticators
> 	// computed once
> 	result += 1.78; 
74a82
> #endif
cvs diff: Diffing eventLoop
cvs diff: Diffing lang
cvs diff: Diffing lang/eca
cvs diff: Diffing lang/p2dl
cvs diff: Diffing lang/parse
cvs diff: Diffing lang/planner
cvs diff: Diffing lib
cvs diff: Diffing mapreduce
cvs diff: Diffing mapreduce/olg
cvs diff: Diffing net
cvs diff: Diffing overhead-eval
cvs diff: Diffing overlog
cvs diff: Diffing p2core
Index: p2core/Makefile.am
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/p2core/Makefile.am,v
retrieving revision 1.2
diff -r1.2 Makefile.am
56c56,58
< 			stageRegistry 
---
> 			stageRegistry \
> 			val_qu_lt \
> 			val_qu_cand
Index: p2core/pel_gen.py
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/p2core/pel_gen.py,v
retrieving revision 1.2
diff -r1.2 pel_gen.py
51c51,65
<   
---
>  
>   ("getOrderOfCandidate", 3, "GET_ORDER_OF_CAND", "Q/U specific: finds order of a candidate in OHS"),
>   ("getLTInCandidate", 1, "GET_LT_IN_CAND", "Q/U specific: finds LT in the candidate"),
>   ("getLTInOHS", 2, "GET_LT_IN_OHS", "Q/U specific: finds LT in OHS"),
>   ("getCandidateInOHS",  3, "GET_CAND_IN_OHS", "Q/U specific: finds Candidate in OHS"),
>   ("getLatestTimeInRH", 1, "GET_LATEST_TIME_IN_RH", "Q/U specific: find latest time in RH"),
>   ("getOID", 1, "GET_OID", "Q/U specific: find OID in the LT"),
>   ("getOHSInRH", 1, "GET_OHS_IN_RH", "Q/U specific: find OHS in RH"),
>   ("getTimeInLT", 1, "GET_TIME_IN_LT", "Q/U specific: find Time in LT"),
>   ("getOpInLT", 1, "GET_OP_IN_LT", "Q/U specific: find Op in LT"),
>   ("updateOHSWithRH", 3, "UPDATE_OHS_WITH_RH", "Q/U specific: update RH for a given replica in OHS"),
>   ("trimRH", 2, "TRIM_RH", "Q/U specific: trims RH for a given LT_CO"),
>   ("greaterThanLT", 2, "GREATER_THAN_LT", "Q/U specific comparision of LTs"),
>   ("uniformProb", 0, "UNIFORM_PROB", "Returns probability with uniform distribution"),
>  
Index: p2core/pel_vm.C
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/p2core/pel_vm.C,v
retrieving revision 1.2
diff -r1.2 pel_vm.C
44a45
> //#define QU_DEBUG 1
515a517,1044
> /***** Q/U specific methods */
> std::string Pel_VM::get_string_token(std::string s, int index, char token){
>   int i = 0;
>   std::string rem = s;
>   int to;
> #ifdef QU_DEBUG
>   std::cout <<"GetStringToken: s " << s << " index " << index << " token " << token << "\n";
> #endif
>   while(i < index){
> 	i++;
> 	to = rem.find_first_of(token);
> 	if(to == std::string::npos)
> 		return s;
> 	rem = rem.substr(to+1);
> 	//std::cout << "Remanining " << rem << " i " << i << "\n";
>   }
>   to = rem.find_first_of(token);
>   if(to == std::string::npos)
>     return rem;
>   assert(to != std::string::npos);
>   rem = rem.substr(0, to);
> #ifdef QU_DEBUG
>   std::cout << "Result " << rem << "\n";
> #endif
>   return rem;
> }
> 
> 
> std::string Pel_VM::find_latest_cand_in_rh(std::string rh){
>   int last_index = rh.find_last_of(',');
>   int length = strlen(rh.c_str()) - last_index - 1;
>   std::string lat_cand = rh.substr(last_index+1, length);
> #ifdef QU_DEBUG
>   //std::cout <<"Find_latest_cand_in_rh called with rh " << rh << " strlen " << strlen(rh.c_str()) << " index " <<  index << "\n";
>   //std::cout <<"Latest candidate is " << lat_cand << "\n";
> #endif
>   return lat_cand;
> }
> 
> std::vector<std::string> Pel_VM::find_all_cand_in_rh(std::string rh){
> #ifdef QU_DEBUG
>   std::cout << "Find_all_cand_in_rh " << rh << "\n";
> #endif
>   std::vector<std::string> result;
>   std::string inter = rh;
>   std::string rem = rh;
>   int len = strlen(rh.c_str()) - 1;
>   int index = rh.find_last_of(',');
>   int i = 0;
>   while(index != std::string::npos){
>     inter = rem.substr(index+1, len);
>     result.push_back(inter);
> #ifdef QU_DEBUG
>     std::cout << "Candidate number " << i << " is " << inter << " rem " << rem << " index " << index << "\n";
> #endif
>     i++;
>     if(index == 0)
>       break;
>     rem = rem.substr(0, index);
>     len = strlen(rem.c_str()) - 1;
>     index = rem.find_last_of(',');
>   }
>   return result;
> }
> 
> std::vector<std::string> Pel_VM::get_candidates_in_ohs(string ohs, int howMany){
> #ifdef QU_DEBUG
>   //std::cout << "Get_candidates_in_ohs called with ohs " << ohs << " with howMany " << howMany << "\n";
> #endif
>   std::vector<std::string> result;
>   for(int i = 0; i < howMany; i++){
> 	std::string rh = get_string_token(ohs, i, '!');
>         std::vector<std::string> cand = find_all_cand_in_rh(rh);
> 	for(int j = 0; j < cand.size(); j++)
> 	  result.push_back(cand.at(j));
>   }
> #ifdef QU_DEBUG
>   //std::cout << "Result of get_candidates_in_ohs done --- size " << result.size() << "\n";
> #endif
>   return result;
> }
> 
> 
> std::string Pel_VM::find_lt_in_cand(std::string cand){
> #ifdef QU_DEBUG
>   std::cout << "Find_lt_in_cand " << cand << "\n";
> #endif
>    // cand  LT1:LT2
>    int index = cand.find_first_of(':');
>    std::string lt = cand.substr(0, index);
>    return lt;
> }
> 
> int Pel_VM::find_order_of_cand_in_ohs(std::string ohs, std::string cand, int howMany){
> #ifdef QU_DEBUG
>   std::cout << "Find_order_of_cand_in_ohs " << ohs << ", cand " << cand << ", howMany " << howMany << "\n";
> #endif
>    std::vector<std::string> candidates = get_candidates_in_ohs(ohs, howMany);
>    int count = 0;
>    for(int i = 0; i < candidates.size(); i++){
> 	std::string tocomp = candidates.at(i);
> 	#ifdef QU_DEBUG
>  	std::cout << "Candidate " << cand << " tocompare " << tocomp << "\n";
> 	#endif
> 	if(cand.compare(tocomp) == 0)
> 		count++;
>    }
>    return count;
> }
> 
> std::string Pel_VM::find_latest_lt_in_ohs(std::string ohs, int howMany){
> #ifdef QU_DEBUG
>   std::cout << "Find_latest_lt_in_ohs " << ohs << " how many " << howMany << "\n";
> #endif
>   std::vector<std::string> candidates = get_candidates_in_ohs(ohs, howMany);
>   std::string lat = find_lt_in_cand(candidates.at(0));
> #ifdef QU_DEBUG
>   std::cout << "LT at index 0 is " << lat << "\n";
> #endif
>   int whichOne = 0;
>   for(int i = 1; i < candidates.size(); i++){
> 	std::string l = find_lt_in_cand(candidates.at(i));
> #ifdef QU_DEBUG
>     	std::cout << "LT at index " << i << " is " << l << "\n";
> #endif
> 	if(greater_than_lt(l, lat)){
> 		whichOne = i;
> 		lat = l;
>  	}
>   }
> #ifdef QU_DEBUG
>   std::cout << "Latest is " << lat << "\n";
> #endif
>   return lat;
> }
> 
> int Pel_VM::getTimeInLT(std::string lt){
> 
> #ifdef QU_DEBUG
>   std::cout << "GetTimeInLT " << lt << " Called\n";
> #endif
>   std::string time = get_string_token(lt, 1, '#');
> #ifdef QU_DEBUG
>   std::cout << "GetTimeInLT " << lt << " returned " << time << "\n";
> #endif
>   return atoi(time.c_str());
> }
> 
> int Pel_VM::getFlagInLT(std::string lt){
> 
> #ifdef QU_DEBUG
>   std::cout << "GetFlagInLT " << lt << " called\n";
> #endif
>   std::string flag = get_string_token(lt, 2, '#');
> #ifdef QU_DEBUG
>   std::cout << "GetFlagInLT " << lt << " returned " << flag << "\n";
> #endif
>   return atoi(flag.c_str());
> }
> 
> int Pel_VM::getCIDInLT(std::string lt){
> 
> #ifdef QU_DEBUG
>   std::cout << "GetCIDInLT " << lt << " called\n";
> #endif
>   std::string cid = get_string_token(lt, 3, '#');
> #ifdef QU_DEBUG
>   std::cout << "GetCIDInLT " << lt << " returned " << cid << "\n";
> #endif
>   return atoi(cid.c_str());
> }
> 
> int Pel_VM::getOpInLT(std::string lt){
> 
> #ifdef QU_DEBUG
>   std::cout << "GetOpInLT " << lt << " called\n";
> #endif
>   std::string op = get_string_token(lt, 4, '#');
> #ifdef QU_DEBUG
>   std::cout << "GetOpInLT " << lt << " returned " << op << "\n";
> #endif
> 
>   return atoi(op.c_str());
> }
> 
> bool Pel_VM::greater_than_lt(std::string one, std::string two){
>   // LT: Time#Flag#CID#OP#OHS
>   // return true if one.time > two.time or one.bflag == true & two.bflag = false 
>   //  one.CID > two.CID, one.OP > two.OP, one.OHS > two.OHS
> #ifdef QU_DEBUG
>   std::cout <<"Comparing two LTs: " << one << ", " << two << "\n";
> #endif
>   int time1 = getTimeInLT(one);
>   int time2 = getTimeInLT(two);
>   int flag1 = getFlagInLT(one);
>   int flag2 = getFlagInLT(two);
>   int cid1 = getCIDInLT(one);
>   int cid2 = getCIDInLT(two);
>   int op1 = getOpInLT(one);
>   int op2 = getOpInLT(two);
>   
>   if(time1 > time2){
> 	return true;
>   }
>   if(time1 == time2 && flag1 == 1 && flag2 == 0){
>  	return true;
>   }
>   if(time1 == time2 && flag1 == flag2 && cid1 > cid2){
> 	return true;
>   }
>   if(time1 == time2 && flag1 == flag2 && cid1 == cid2 &&
> 	op1 > op2){
> 	return true;
>   }
>   return false;
> }
> 
> DEF_OP(GREATER_THAN_LT){
>   ValuePtr vp1 = stackTop(); stackPop();
>   ValuePtr vp2 = stackTop(); stackPop();
> 
> 
>   std::string lt2 = Val_Str::cast(vp1);
>   std::string lt1 = Val_Str::cast(vp2);
> 
> #ifdef QU_DEBUG
>   std::cout << "GREATER_THAN_LT called with lt1 " << lt1 << ", lt2 " << lt2 << "\n";
> #endif
> 
>   int result = 0;
>   if(lt1.compare(lt2) == 0){
> 	 result = 0;
>   }
>   else  if(lt2.compare("0") == 0) {
> 	result = 1;
>   }
>   else {
>         bool s = greater_than_lt(lt1, lt2);
>         result = s;
>   }
> #ifdef QU_DEBUG
>   std::cout << "GREATER_THAN_LT retuns " << result << "\n";
> #endif
>   stackPush(Val_Int32::mk(result));
> }
> 
> DEF_OP(TRIM_RH){
>   ValuePtr vp1 = stackTop(); stackPop();
>   ValuePtr vp2 = stackTop(); stackPop();
> 
>   std::string rh = Val_Str::cast(vp2);
>   std::string ltco = Val_Str::cast(vp1);
>   
> #ifdef QU_DEBUG
>   std::cout <<"TRIM_RH called with rh " << rh << ", ltco " << ltco << "\n";
> #endif
> 
>   std::vector<std::string> cand = find_all_cand_in_rh(rh);
>   //std::vector<std::string> result;
>   std::string rhnew;
> 
>   for(int i = cand.size() - 1; i >= 0; i--){
>      std::string c = cand.at(i);
>      std::string l = find_lt_in_cand(c);
> #ifdef QU_DEBUG
>      std::cout << "Index " << i << " size of cands " << cand.size() << ", cand " << c << ", lt in cand " << l << "\n";
> #endif
>      if(!greater_than_lt(ltco, l)){
>   	// ltco is not greater than l
> 	//result.push_back(l);
> 	rhnew += ",";
> 	rhnew += c;
>      }
>   }
> #ifdef QU_DEBUG
>   std::cout << "TRIM_RH result is " << rhnew << "\n";
> #endif
>   stackPush(Val_Str::mk(rhnew));
> }
> 
> 
> DEF_OP(GET_ORDER_OF_CAND){
>   ValuePtr vp1 = stackTop(); stackPop();
>   ValuePtr vp2 = stackTop(); stackPop();
>   ValuePtr vp3 = stackTop(); stackPop();
> 
>   std::string candidate = Val_Str::cast(vp2);
>   std::string ohs = Val_Str::cast(vp3);
>   int f = Val_Int32::cast(vp1);
> #ifdef QU_DEBUG
>   std::cout << "GET_ORDER_OF_CAND cand:" << candidate << " ohs " << ohs << "\n";
> #endif
>   // candidate LT1:LT2
>   // ohs RH1!RH2!....
> 
>   int order = find_order_of_cand_in_ohs(ohs, candidate, 5*f+1);
> #ifdef QU_DEBUG
>   std::cout << "GET_ORDER_OF_CAND called with cand " << candidate << " in ohs " << ohs << " returns " << order << "\n";
> #endif
>   stackPush(Val_Int32::mk(order));
> }
> 
> DEF_OP(GET_LT_IN_CAND){
>   ValuePtr vp = stackTop(); stackPop();
>   std::string candidate = Val_Str::cast(vp);
> #ifdef QU_DEBUG
>   std::cout << "GET_LT_IN_CAND " << candidate << "\n";
> #endif
>   // candidate LT1:LT2
>   int index = candidate.find_first_of(':');
>   std::string result = candidate.substr(0, index);
> #ifdef QU_DEBUG
>   std::cout << "GET_LT_IN_CAND Candidate " << candidate << " returns " << result << "\n";
> #endif
>   stackPush(Val_Str::mk(result));
> }
> 
> DEF_OP(GET_LT_IN_OHS){
>   ValuePtr vp1 = stackTop(); stackPop(); 
>   ValuePtr vp2 = stackTop(); stackPop();
> 
>   std::string ohs = Val_Str::cast(vp2);
> 
>     //std::string ohs = pop_string();//vp1->toString();
>   int32_t f = Val_Int32::cast(vp1);
> #ifdef QU_DEBUG
>   std::cout << "GET_LT_IN_OHS ohs " << ohs << " f " << f << "\n";
> #endif
>   std::string lt = find_latest_lt_in_ohs(ohs, 5*f+1);
> #ifdef QU_DEBUG
>   std::cout << "GET_LT_IN_OHS ohs " << ohs << " returns " << lt << "\n";
> #endif
>   stackPush(Val_Str::mk(lt));
> }
> 
> DEF_OP(GET_CAND_IN_OHS){
>   ValuePtr val1 = stackTop(); stackPop();
>   ValuePtr val2 = stackTop(); stackPop();
>   ValuePtr val3 = stackTop(); stackPop();
>  
>   std::string ohs = Val_Str::cast(val3);
>   uint32_t barrierFlag = Val_UInt32::cast(val2);
>   uint32_t f = Val_UInt32::cast(val1);
>   int REPAIR_QUORUM = 2*f + 1;
> 
> #ifdef QU_DEBUG
>   std::cout << "GET_CAND_IN_OHS ohs " << ohs << " flag " << barrierFlag << " f " << f << "\n";
> #endif
>   std::vector<std::string> candidates = get_candidates_in_ohs(ohs, 5*f+1);
>   std::vector<std::string> latestCandidates;
>   // iterate over the RH of each replica, find their
>   // latest candidate and store it
> #ifdef QU_DEBUG
>   std::cout << "Got " << candidates.size() << " number of candidates \n"; 
> #endif
>   for(int i = 0; i < candidates.size(); i++){
> 	std::string cand = candidates.at(i);
> 	#ifdef QU_DEBUG
> 	std::cout << "Index " << i << ", candidate " << cand << "\n";
> 	#endif
> 	int order = find_order_of_cand_in_ohs(ohs, cand, 5*f+1);
> 	std::string lat = find_lt_in_cand(cand);
> 	std::string bflag = get_string_token(lat, 2, '#');
> 	
> 	int bflag_int;
> 	if(bflag.compare(lat) == 0){
> 		bflag_int = 0;
>   	}
> 	else
> 		bflag_int = atoi(bflag.c_str());
> 	#ifdef QU_DEBUG
> 	std::cout << "Latest candidate " << lat << " bflag " << bflag << " order " << order << " Repair quorum " << REPAIR_QUORUM << " barrierflg " << barrierFlag << "\n";
> 	#endif
> 	if(bflag_int == barrierFlag && order >= REPAIR_QUORUM){
> 	  latestCandidates.push_back(cand);
> 	  
> 	  //if(order == 5*f+1)
> 	    //break;
> 	}
>   }
> 
>   if(latestCandidates.size() == 0){
> #ifdef QU_DEBUG
>     std::cout << "GET_CAND_IN_OHS returns NULL\n";
> #endif
>     stackPush(Val_Str::mk("NULL"));
>     return;
>   }
> 
>   // now for these latest candidates, find the one with latest timestamp
>   int ind = 0;
>   std::string latest = find_lt_in_cand(latestCandidates.at(0));
>   for(int i = 1; i < latestCandidates.size(); i++){
> 	std::string lat = find_lt_in_cand(latestCandidates.at(i));
> 	if(greater_than_lt(lat, latest)){
> 	   latest = lat;
> 	   ind = i;
> 	}
>   } 
> #ifdef QU_DEBUG
>   std::cout<<"GET_CAND_IN_OHS returns  " << latestCandidates.at(ind) << "\n";
> #endif
>   stackPush(Val_Str::mk(latestCandidates.at(ind)));
> }
> 
> 
> DEF_OP(GET_LATEST_TIME_IN_RH){
>   // RH Can1,Can2,Can3...
>   ValuePtr vp = stackTop(); stackPop();
>   std::string rh = Val_Str::cast(vp);
> #ifdef QU_DEBUG
>   std::cout << "GET_LATEST_TIME_IN_RH rh " << rh << "\n";
> #endif
>   std::string lat_cand = find_latest_cand_in_rh(rh); 
>   std::string lt = get_string_token(lat_cand, 0, ':');
> #ifdef QU_DEBUG
>   std::cout << "GET_LATEST_TIME_IN_RH rh " << rh << " returns " << lt << "\n";
> #endif
>   stackPush(Val_Str::mk(lt));
> }
> 
> DEF_OP(GET_OID){
>   // LT: Time#Flag#CID#OP#OHS
>   // OP: Method$Class$ObjID
> 
>   ValuePtr vp = stackTop(); stackPop();
>   std::string lt = Val_Str::cast(vp);
>   std::cout << "GET_OID lt " << lt << "\n";
>   std::string op = get_string_token(lt, 2, '#');
>   std::string oid = get_string_token(op, 1, '$');
>   int objid = atoi(oid.c_str());
> 
> #ifdef QU_DEBUG
>   std::cout << "GET_OID returns " << objid << "\n";
> #endif
>   stackPush(Val_Int32::mk(objid));  
> }
> 
> DEF_OP(GET_OHS_IN_RH){
>   // RH Can1,Can2,Can3..
>   // OHS RH0!RH1
>   ValuePtr vp = stackTop(); stackPop();
>   std::string rhs = Val_Str::cast(vp);
> #ifdef QU_DEBUG
>   std::cout << "GET_OHS_IN_RH " << rhs << "\n";
> #endif
>   std::string latCand = find_latest_cand_in_rh(rhs);
>   std::string lt = find_lt_in_cand(latCand);
>   std::string result = get_string_token(lt, 3, '#');
> 
> #ifdef QU_DEBUG
>   std::cout << "GET_OHS_IN_RH returns " << result << "\n";
> #endif
>   stackPush(Val_Str::mk(result));
> }
> 
> 
> DEF_OP(GET_TIME_IN_LT){
>    // LT: Time#Flag#CID#OP#OHS
>   ValuePtr vp = stackTop(); stackPop();
>   std::string lt = Val_Str::cast(vp);
> #ifdef QU_DEBUG
>   std::cout << "GET_TIME_IN_LT lt " << lt << "\n";
> #endif
> 
>   /*
>   std::string rem = get_string_token(lt, 0, '#');
>   */
>   int time = getTimeInLT(lt);
> 
> #ifdef QU_DEBUG
>   std::cout << "GET_TIME_IN_LT lt " << lt << " returns " << time << "\n";
> #endif
>   stackPush(Val_Int32::mk(time));
>   
> }
> 
> 
> DEF_OP(GET_OP_IN_LT){
>    // LT: Time#Flag#CID#OP#OHS
>    ValuePtr vp = stackTop(); stackPop();
>    std::string lt = Val_Str::cast(vp);
> #ifdef QU_DEBUG
>    std::cout << "GET_OP_IN_LT lt " << lt << "\n";
> #endif
> 
>    std::string rem = get_string_token(lt, 4, '#');
> #ifdef QU_DEBUG
>    std::cout << "GET_OP_IN_LT lt  " << lt << " returns " << rem << "\n";
> #endif
>    stackPush(Val_Str::mk(rem));
> }
> 
> DEF_OP(UPDATE_OHS_WITH_RH){
>    ValuePtr vp1 = stackTop(); stackPop();
>    ValuePtr vp2 = stackTop(); stackPop();
>    ValuePtr vp3 = stackTop(); stackPop();
> 
>    std::string ohs = Val_Str::cast(vp3);
>    std::string rh = Val_Str::cast(vp2);
>    int index = Val_Int32::cast(vp1);
> #ifdef QU_DEBUG
>    std::cout <<"UPDATE_OHS_WITH_RH called with ohs " << ohs << ", rh " << rh << ", index " << index << "\n";
> #endif
>    std::string result;
>    std::string inter;
>    int i = 0;
>    inter = get_string_token(ohs, i, '!');
>    while(ohs.compare(inter) != 0){
>      if(i == index)
>        result += rh;
>      else
>        result += inter;
> #ifdef QU_DEBU
>      std::cout << "Inter " << inter << " i " << i << " index " << index << " result " << result << "\n";
> #endif
>      i++;
>      inter = get_string_token(ohs, i, '!');
>      if(ohs.compare(inter) != 0)
>        result += "!";
>    }
> #ifdef QU_DEBUG
>   std::cout << "Resulting ohs " << result << "\n";
> #endif
>    stackPush(Val_Str::mk(result));
> }
> 
> 
665c1194,1197
< 
---
> DEF_OP(UNIFORM_PROB){
>   double r = double(random()) / double(RAND_MAX);
>   stackPush(Val_Double::mk(r));
> }
Index: p2core/pel_vm.h
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/p2core/pel_vm.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 pel_vm.h
69a70,83
>   // QU related functions
>   std::string get_string_token(std::string, int, char);
>   int find_order_of_cand_in_ohs(std::string, std::string, int);
>   std::string find_latest_lt_in_ohs(std::string, int);
>   std::vector<std::string> find_all_cand_in_rh(std::string);
>   std::string find_latest_cand_in_rh(std::string);
>   std::string find_lt_in_cand(std::string);
>   int getTimeInLT(std::string);
>   int getFlagInLT(std::string);
>   int getCIDInLT(std::string);
>   int getOpInLT(std::string);
>   bool greater_than_lt(std::string, std::string);
>   std::vector<std::string> get_candidates_in_ohs(string, int);
> 
Index: p2core/value.h
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/p2core/value.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 value.h
128a129,133
>     /* Q/U specific types */
>     QU_LT,
>     QU_CAND,
>     QU_RH,
>     QU_OHS,
cvs diff: Diffing p2cpp
cvs diff: Diffing p2viz
cvs diff: Diffing p2viz/jbuilder
cvs diff: Diffing p2viz/lib
cvs diff: Diffing p2viz/scripts
cvs diff: Diffing p2viz/src
cvs diff: Diffing p2viz/src/phiviz
cvs diff: Diffing phi
cvs diff: Diffing phid
cvs diff: Diffing planner
Index: planner/rulePel.C
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/planner/rulePel.C,v
retrieving revision 1.2
diff -r1.2 rulePel.C
201a202,204
>   else if (expr->name() == "f_uniformProb"){
>     pel << "uniformProb ";
>   }
434a438,556
>   /********** Q/U related string methods ****/
>   else if( expr->name() == "f_getOrderOfCandidate"){
>     if( expr->args() != 3){
> 	PLANNER_ERROR_NOPC("Error in pel generation, need 2 args " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     expr2Pel(pc, pel, expr->arg(1));
>     expr2Pel(pc, pel, expr->arg(2));
> 
>     pel << "getOrderOfCandidate ";
>   }
>   else if( expr->name() == "f_greaterThanLT"){
>      if(expr->args() != 2){
> 	PLANNER_ERROR_NOPC("Error in pel generation for f_greaterThanLT, need 2 args " << expr->toString());
> 	exit(-1);
>      }
>      expr2Pel(pc, pel, expr->arg(0));
>      expr2Pel(pc, pel, expr->arg(1));
>      pel << "greaterThanLT ";
>   }
>   else if( expr->name() == "f_trimRH"){
>     if( expr->args() != 2){
>         PLANNER_ERROR_NOPC("Error in pel generation for f_trimRH, need 2 args " << expr->toString());
> 	exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     expr2Pel(pc, pel, expr->arg(1));
> 
>     pel << "trimRH ";
> 
>   }
> 
>   else if( expr->name() == "f_getLTInCandidate"){
>     if( expr->args() != 1){
>    	PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
> 	exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getLTInCandidate ";
>   }
> 
>   else if(expr->name() == "f_getLTInOHS"){
>     if( expr->args() != 2){
> 	PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     expr2Pel(pc, pel, expr->arg(1));
>     pel << "getLTInOHS ";
>   }
> 
>   else if( expr->name() == "f_getCandidateInOHS"){
>     if( expr->args() != 3){
>         PLANNER_ERROR_NOPC("Error in pel generation, need 2 args " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     expr2Pel(pc, pel, expr->arg(1));
>     expr2Pel(pc, pel, expr->arg(2));
>     pel << "getCandidateInOHS ";
>   }
> 
>   else if(expr->name() == "f_getLatestTimeInRH"){
>     if( expr->args() != 1){
>         PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getLatestTimeInRH ";
>   }
> 
>   else if(expr->name() == "f_getOID"){
>     if( expr->args() != 1){
>         PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getOID ";
>   }
> 
>   else if(expr->name() == "f_getOHSInRH"){
>     if( expr->args() != 1){
>         PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getOHSInRH ";
>   }
> 
>   else if(expr->name() == "f_getTimeInLT"){
>     if( expr->args() != 1){
>         PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getTimeInLT ";
>   }
>   else if(expr->name() == "f_getOpInLT"){
>     if( expr->args() != 1){
>         PLANNER_ERROR_NOPC("Error in pel generation, need only 1 arg " << expr->toString());
>         exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     pel << "getOpInLT ";
>   }
>   else if(expr->name() == "f_updateOHSWithRH"){
>     if( expr->args() != 3){
> 	PLANNER_ERROR_NOPC("Error in pel generation , need 3 args " << expr->toString());
> 	exit(-1);
>     }
>     expr2Pel(pc, pel, expr->arg(0));
>     expr2Pel(pc, pel, expr->arg(1));
>     expr2Pel(pc, pel, expr->arg(2));
>     pel << "updateOHSWithRH ";
>   }
> 
>   /********* Q/U related string methods end here *****/
> 
Index: planner/rulePlanner.C
===================================================================
RCS file: /DS/usr/atuls/source-code/ns-allinone-2.31/P2/planner/rulePlanner.C,v
retrieving revision 1.3
diff -r1.3 rulePlanner.C
81a82
> #include "parameters.h"
280c281,282
<    #define PBFT_HACK
---
> //#define QU_HACK
>   //#define PBFT_HACK
282c284
< #ifdef PBFT_HACK
---
> #ifdef USE_PBFT
335c337
< #ifdef PINGPONG_HACK 
---
> #ifdef USE_PINGPONG 
354c356
< 		pc->createElementSpec(ElementPtr(new Delay("Delay!"+ curRule->_ruleID + "!" + pc->_nodeID)));
---
> 	  pc->createElementSpec(ElementPtr(new Delay("Delay!"+ curRule->_ruleID + "!" + pc->_nodeID, false)));
364a367,392
> 
> #ifdef USE_QU
> 
>   if((curRule->_ruleID.find(string("po7000")) != string::npos) || 
>      (curRule->_ruleID.find(string("qusr000")) != string::npos) ||
>      (curRule->_ruleID.find(string("rh000")) != string::npos) ||
>      (curRule->_ruleID.find(string("qucs000")) != string::npos)
>      ){
>     std::cout << "Found rule " << curRule->_ruleID << " that needs a delay \n";
>     
>     ElementSpecPtr delayTPP =
>       pc->createElementSpec(ElementPtr(new TimedPullPush("Delay!PullPush!" + curRule->_ruleID + "!" + pc->_nodeID, 0)));
>     pc->addElementSpec(delayTPP);
>     ElementSpecPtr delayP =
>       pc->createElementSpec(ElementPtr(new Delay("Delay!"+ curRule->_ruleID + "!" + pc->_nodeID, false)));
>     
>     pc->addElementSpec(delayP);
>     ElementSpecPtr delaySlot =
>       pc->createElementSpec(ElementPtr(new Slot("Delay!Queue!" + curRule->_ruleID + "!" + pc->_nodeID)));
>     pc->addElementSpec(delaySlot);
>     
>     
>   }
>   
> #endif
> 
cvs diff: Diffing python
cvs diff: Diffing python/dfparser
cvs diff: Diffing python/dfparser/yapps
cvs diff: Diffing python/lib
cvs diff: Diffing python/p2
cvs diff: Diffing python/p2/debugger
cvs diff: Diffing python/p2/elements
cvs diff: Diffing python/p2/eventLoop
cvs diff: Diffing python/p2/net
cvs diff: Diffing python/p2/overlog
cvs diff: Diffing python/p2/p2core
cvs diff: Diffing python/p2/p2cpp
cvs diff: Diffing python/p2/pythonElements
cvs diff: Diffing python/scripts
cvs diff: Diffing python/yapps
cvs diff: Diffing pythonElements
cvs diff: Diffing rpms
cvs diff: Diffing stages
cvs diff: Diffing stages/.deps
cvs diff: Diffing swig
cvs diff: Diffing swig/elements
cvs diff: Diffing swig/elements/not_ported
cvs diff: Diffing tests
cvs diff: Diffing tests/ol_parser_tests
cvs diff: Diffing tests/scripts
cvs diff: Diffing tests/scripts/crunch
cvs diff: Diffing tests/scripts/sigmod
cvs diff: Diffing unitTests
cvs diff: Diffing unitTests/olg
cvs diff: Diffing util
