threaded user_cpu_time

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

threaded user_cpu_time

Domhnall Carlin

Hi


I'm comparing classifiers for performance using their overheads.  Can I check, when using a multithreaded classifier (e.g. randomForest with 4 execution slots) is the user_cpu_time figure given by the Experimenter an average over all threads used by that classifier?  Similarly, when a classifier is used with an embedded RandomForest with 4 threads, how is this user_time calculated?


thanks


Domhnall


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: threaded user_cpu_time

Eibe Frank-2
Administrator
Good question. The relevant code is this:

-----

trainTimeStart = System.currentTimeMillis();
if (canMeasureCPUTime) {
  CPUStartTime = thMonitor.getThreadUserTime(thID);
}
m_Classifier.buildClassifier(train);
if (canMeasureCPUTime) {
  trainCPUTimeElapsed = thMonitor.getThreadUserTime(thID) - CPUStartTime;
}
trainTimeElapsed = System.currentTimeMillis() - trainTimeStart;

// testing classifier
testTimeStart = System.currentTimeMillis();
if (canMeasureCPUTime) {
  CPUStartTime = thMonitor.getThreadUserTime(thID);
}
predictions = eval.evaluateModel(m_Classifier, test);
if (canMeasureCPUTime) {
  testCPUTimeElapsed = thMonitor.getThreadUserTime(thID) - CPUStartTime;
}
testTimeElapsed = System.currentTimeMillis() - testTimeStart;

-----

where

ThreadMXBean thMonitor = ManagementFactory.getThreadMXBean();

m_Classifier is whatever classifier you are evaluating, whether it includes a base classifier or not.

Let me know if you find a good explanation of what is actually measured as CPU time when multi-threading is used. I’ve only been looking at elapsed time in the multi-threaded case (on a machine that was only used for the experiment and nothing else).

Cheers,
Eibe

> On 9/05/2017, at 11:23 PM, Domhnall Carlin <[hidden email]> wrote:
>
> Hi
>
> I'm comparing classifiers for performance using their overheads.  Can I check, when using a multithreaded classifier (e.g. randomForest with 4 execution slots) is the user_cpu_time figure given by the Experimenter an average over all threads used by that classifier?  Similarly, when a classifier is used with an embedded RandomForest with 4 threads, how is this user_time calculated?
>
> thanks
>
> Domhnall
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html