Skip to contentSkip to conversation

Use a saner variant for computing the number of groups in cpuctl tests

PATCH Subrata Modak 1 participant 1 message Nov 2, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Thanks.

Regards--
Subrata

Quoted 25 lines · Jiri Palecek

Hello,

this patch changes the calculation of numer of groups in cpuctl test.

The new code doesn't need bc, and is more comprehensible IMHO

Regards
Jiri Palecek

---
 testcases/kernel/controllers/cpuctl/parameters.sh |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
testcases/kernel/controllers/cpuctl/parameters.sh +0 -4
index a23dbe5..502944e 100755
@@ -61,16 +61,7 @@ set_def_group() #default group spinning a task to create ideal scenario
 
 get_num_groups()        # Number of tasks should be >= number of cpu's (to check scheduling fairness)
 {
-        num_grps=$(echo "$NUM_CPUS * 1.5"|bc)   # temp variable num_grps
-        int_part=`echo $num_grps | cut -d"." -f1`
-        dec_part=`echo $num_grps | cut -d"." -f2`
-

testcases/kernel/controllers/cpuctl/parameters.sh set_def_group() #default group spinning a task to create ideal scenario · line 67

Quoted 10 lines
testcases/kernel/controllers/cpuctl/parameters.sh +1 -6
-        if [ $dec_part -gt 0 ]
-        then
-                NUM_GROUPS=$(echo "$int_part + 1"|bc)
-        else
-                NUM_GROUPS=$int_part;
-        fi
+        NUM_GROUPS=$(( (NUM_CPUS*3 + 1)/2 ))
 }
 
 	# Write the cleanup function

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list