runTime-class {mspath}R Documentation

Class "runTime"

Description

This low-level class captures the time it takes to run a particular job. This is for further analysis by runAnalyzer.

Objects from the Class

Create with runTime(job). It automatically records the time it was created, so don't make it until you're ready.

The sequence of events is that the job is created locally, started remotely, finished remotely, and completed locally. Scheduling and transmission delays may occur.

Slots

job:
Some indicator of the job whose time is being described. Could be the job object itself or, in current application, the id of the case being analyzed. Object of class "ANY"
start:
time in seconds since start of process that job began. Object of class "numeric"
end:
time in seconds since start of process that job ended (set when remote<- is called). Object of class "numeric"
remote:
seconds of user, system, wall clock, and wait time on the remote system. wall clock time is between start of remote computation and end of main computations; wait time is time waiting for response from root. Object of class "numeric"
rank:
MPI rank of job. Object of class "numeric"

Methods

addResult
signature(analyzer = "runAnalyzer", runTime = "runTime"): Once a runTime object is complete, use this method to add it to an analyzer for later analysis. This uses the R idiom in which the return value is the updated runAnalyzer object.
cpuTime
signature(runTime = "runTime"): CPU seconds the job took. If the job executed remotedly, this is only the remote CPU time.
endTime
signature(runTime = "runTime"): time in seconds since start of process that job ended (set when remote<- is called). Object of class "numeric"
job
signature(runTime = "runTime"): Get the job that goes with this runTime.
mpirank<-
signature(runTime = "runTime", value = "numeric"): Sets the MPI rank of the job, once it is known. The return value is the runTime object with the updated rank.
mpirank
signature(runTime = "runTime"): Get the MPI rank of the job.
remoteTime<-
signature(runTime = "runTime", value = "numeric"): Return a runTime object updated with the vector of time values from the remote job. See slot remote for the exact form the argument should take. This also sets the endTime of the object as a side-effect.
startTime
signature(runTime = "runTime"): time in seconds since start of process that job began. Object of class "numeric".
waitTime
signature(runTime = "runTime"): Number of wall-clock seconds the remote jobs was waiting for a response from root after the remote job's completion.
wallTime
signature(runTime = "runTime"): Number of seconds from the time the master process initiated the job to the time it was finished with it (i.e. endTime - startTime).

Note

Resolution of time is system-dependent; it's whatever proc.time can get.

The creator of the object is responsible for assuring that the method definitions above are true. In particular,

  1. Create the runTime object only when the corresponding job is started.
  2. Populate mpirank with a proper value.
  3. Set appropriate values with remoteTime<- and make this call exactly when all processing on the job is done.

In order to retain the updated values, you must capture the return value of the update methods, in keeping with the general functional style of R.

Author(s)

Ross Boylan

See Also

runTime constructor, runAnalyzer, proc.time

Examples

### Make a runTime object
# at the start of the job
rt <- runTime("Job1")
# in real life, remote computations would then ensue
mpirank(rt) <- 3
Sys.sleep(1.5) # time passes
# when we get the job back
# next line is c( user cpu, system cpu, wall clock time, wall clock wait)
remoteTime(rt) <- c(.05, .01, 1.0, .15)

### Use it
cat("Job", job(rt), "executed on MPI rank", mpirank(rt))
cat("It took", wallTime(rt),
    "seconds, out of which remote waited for master",
    waitTime(rt), "seconds.") 

[Package mspath version 0.9-9 Index]