R中"用户","系统"和"过去"时间的含义是什么

ali*_*boy 4 parallel-processing r

我在R中采用并行计算,并做一些基准工作.我注意到,当使用多个内核,system.time节目增加了时间usersystem,但elapsed时间减少.这是否表明并行计算是有效的?谢谢.

Dir*_*tel 7

如果你这样做,help(system.time)你也会得到一个提示help(proc.time).我引用其帮助页面:

值:

 An object of class ‘"proc_time"’ which is a numeric vector of
 length 5, containing the user, system, and total elapsed times for
 the currently running R process, and the cumulative sum of user
 and system times of any child processes spawned by it on which it
 has waited.  (The ‘print’ method uses the ‘summary’ method to
 combine the child times with those of the main process.)

 The definition of ‘user’ and ‘system’ times is from your OS.
 Typically it is something like

 _The ‘user time’ is the CPU time charged for the execution of user
 instructions of the calling process.  The ‘system time’ is the CPU
 time charged for execution by the system on behalf of the calling
 process._

 Times of child processes are not available on Windows and will
 always be given as ‘NA’.

 The resolution of the times will be system-specific and on
 Unix-alikes times are rounded down to milliseconds.  On modern
 systems they will be that accurate, but on older systems they
 might be accurate to 1/100 or 1/60 sec.  They are typically
 available to 10ms on Windows.
Run Code Online (Sandbox Code Playgroud)

  • 一个由R调用触发的,有助于“系统”时间而不是“用户”时间的东西的好例子是什么?并且,为了具体起见,是否存在特定的R函数,通常会在“系统”时间内比“用户”时间内花费更多的成本? (2认同)