Hi,
Here is the code. I am not sure why it was omitted in the public release
(perhaps Stephen added it more recently).
Replace the existing try...catch block in StatValue_InstanceCounter<long
long>::asDouble() (search for mlp to find it):
As you noted, the mlp calculation is simply the average excluding the zero
bucket. (Which computes memory-level-parallelism if your instance counter
is counting outstanding misses every cycle).
try {
if (options.substr(0,3) == "avg") {
return static_cast<double>(weightedSum()) / sum() ;
} else if (options.substr(0,3) == "mlp") {
return static_cast<double>(weightedSum()) / (sum() -
count(0));
} else {
return asLongLong(options);
}
} catch (boost::bad_lexical_cast &) {
throw CalcException(std::string("{Unable to parse options: " +
options + " }"));
}
Regards,
-Tom Wenisch
On Mon, 16 Oct 2006, Jason Zebchuk wrote:
> Tom,
>
> Thanks for the help.
>
> I tried your suggestion, and it didn't work. I looked at the code, found
> were it checks for "avg" and there is indeed no such option.
>
> There is however an intriguing option called "mlp" which seems very close to
> the average, except it doesn't count items with a value of 0.
>
> Does "avg" exist in some other version of the code? I looked at the latest
> public release.
>
>
> Thanks,
>
> Jason
>
>
>
> Thomas Wenisch wrote:
>
>>
>>
>> On Mon, 16 Oct 2006, Jason Zebchuk wrote:
>>
>>> Another related question:
>>>
>>> If I have a Stat::InstanceCounter variable, how can I print out just the
>>> average value?
>>
>>
>> The syntax for this is:
>>
>> stat-manager format-string "{InstanceCounterName;avg}"
>>
>> You can also extract "count" "buckets" "weight" and the value of a specific
>> bucket with "val:n" where n is the desired value.
>>
>> Regards,
>> -Tom Wenisch
>>
>>>
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>>
>>>
>>> Jason Zebchuk wrote:
>>>
>>>> Hey guys,
>>>>
>>>> Do you have any documentation on stat-manager format templates over and
>>>> above what's available from using the help command?
>>>>
>>>> Specifically, I'm trying to do something like
>>>> <EXPR:<SUM:regexp1>/<SUM:regexp2>>
>>>> Is that possible? Do you think it would be hard to add if it's not
>>>> already present?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Jason
>>>> _______________________________________________
>>>> SimFlex mailing list
>>>> [email protected]
>>>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>>>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>>
>>>
>>>
>>> _______________________________________________
>>> SimFlex mailing list
>>> [email protected]
>>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>>
>> _______________________________________________
>> SimFlex mailing list
>> [email protected]
>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>
>
> _______________________________________________
> SimFlex mailing list
> [email protected]
> https://sos.ece.cmu.edu/mailman/listinfo/simflex
> SimFlex web page: http://www.ece.cmu.edu/~simflex
>
From zebchuk at eecg.toronto.edu Mon Oct 16 17:48:14 2006
From: zebchuk at eecg.toronto.edu (Jason Zebchuk)
List-Post: [email protected]
Date: Mon Oct 16 17:48:31 2006
Subject: [Simflex] stat-manager syntax
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
Tom,
I actually found that code block in core/aux_/stats/histograms.cpp.
Earlier, I was looking in core/stats/measurements.cpp, which has very
similar code except no code to calculate avg.
I played around a little, and found that doing
stat-manager format-string "<EXPR:{InstanceCounter;avg}>"
works, but simply doing
stat-manager format-string "{InstanceCounter;avg}"
does not work.
Doesn't really matter too much, but some documentation would really be
nice here :)
Jason
Thomas Wenisch wrote:
> Hi,
>
> Here is the code. I am not sure why it was omitted in the public
> release (perhaps Stephen added it more recently).
>
> Replace the existing try...catch block in
> StatValue_InstanceCounter<long long>::asDouble() (search for mlp to
> find it):
>
> As you noted, the mlp calculation is simply the average excluding the
> zero bucket. (Which computes memory-level-parallelism if your instance
> counter is counting outstanding misses every cycle).
>
>
> try {
> if (options.substr(0,3) == "avg") {
> return static_cast<double>(weightedSum()) / sum() ;
> } else if (options.substr(0,3) == "mlp") {
> return static_cast<double>(weightedSum()) / (sum() -
> count(0));
> } else {
> return asLongLong(options);
> }
> } catch (boost::bad_lexical_cast &) {
> throw CalcException(std::string("{Unable to parse options:
> " + options + " }"));
> }
>
>
> Regards,
> -Tom Wenisch
>
> On Mon, 16 Oct 2006, Jason Zebchuk wrote:
>
>> Tom,
>>
>> Thanks for the help.
>>
>> I tried your suggestion, and it didn't work. I looked at the code,
>> found were it checks for "avg" and there is indeed no such option.
>>
>> There is however an intriguing option called "mlp" which seems very
>> close to the average, except it doesn't count items with a value of 0.
>>
>> Does "avg" exist in some other version of the code? I looked at the
>> latest public release.
>>
>>
>> Thanks,
>>
>> Jason
>>
>>
>>
>> Thomas Wenisch wrote:
>>
>>>
>>>
>>> On Mon, 16 Oct 2006, Jason Zebchuk wrote:
>>>
>>>> Another related question:
>>>>
>>>> If I have a Stat::InstanceCounter variable, how can I print out
>>>> just the average value?
>>>
>>>
>>>
>>> The syntax for this is:
>>>
>>> stat-manager format-string "{InstanceCounterName;avg}"
>>>
>>> You can also extract "count" "buckets" "weight" and the value of a
>>> specific bucket with "val:n" where n is the desired value.
>>>
>>> Regards,
>>> -Tom Wenisch
>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Jason
>>>>
>>>>
>>>>
>>>> Jason Zebchuk wrote:
>>>>
>>>>> Hey guys,
>>>>>
>>>>> Do you have any documentation on stat-manager format templates
>>>>> over and above what's available from using the help command?
>>>>>
>>>>> Specifically, I'm trying to do something like
>>>>> <EXPR:<SUM:regexp1>/<SUM:regexp2>>
>>>>> Is that possible? Do you think it would be hard to add if it's not
>>>>> already present?
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jason
>>>>> _______________________________________________
>>>>> SimFlex mailing list
>>>>> [email protected]
>>>>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>>>>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SimFlex mailing list
>>>> [email protected]
>>>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>>>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>>>
>>> _______________________________________________
>>> SimFlex mailing list
>>> [email protected]
>>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>
>>
>>
>> _______________________________________________
>> SimFlex mailing list
>> [email protected]
>> https://sos.ece.cmu.edu/mailman/listinfo/simflex
>> SimFlex web page: http://www.ece.cmu.edu/~simflex
>>
> _______________________________________________
> SimFlex mailing list
> [email protected]
> https://sos.ece.cmu.edu/mailman/listinfo/simflex
> SimFlex web page: http://www.ece.cmu.edu/~simflex