dis_cpu_time(7rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– dis_cpu_time β€” bestie edition πŸ’–

okay so this is dis_cpu_time, a page from the rheolef manual, and it lives in the 7rheolef section of your man pages (yes the same name twice, that's just how man headers vibe, don't worry about it πŸ’…). rheolef is at version 7.2, and this whole page is about timing your distributed computations. we're talking clocks, bestie. let's go ✨


πŸ•°οΈ NAME

dis_cpu_time β€” cumulated cpu for distributed computations (rheolef-7.2)


✨ SYNOPSIS

double dis_cpu_time();
double dis_wall_time();
double seq_cpu_time();
double seq_wall_time();

four little functions, all of them handing you back a double. that's it. that's the whole menu πŸŽ€


🌸 EXAMPLE

okay here's how you actually use these in the wild, and honestly? it's giving "stopwatch energy" ⏱️

double t_start = dis_wall_time();
...stuff to be timed...
double t_end   = dis_wall_time();
derr << 'That took ' << t_end - t_start << ' seconds' << endl

double cpu_start = dis_cpu_time();
...stuff to be timed...
double cpu_end   = dis_cpu_time();
derr << 'That needs ' << cpu_end - cpu_start << ' CPU seconds' << endl

you grab a timestamp, you do the stuff to be timed (iconic placeholder tbh), you grab another timestamp, you subtract, you print. subtraction is the moment fr fr 🫢

and for the derr of it all? see also diststream(2). that's where derr comes from, iykyk.


πŸ‘‘ DESCRIPTION

dis_cpu_time

returns the accumulated CPU for all processes linked together via the default communicator. like, everybody's CPU time, pooled. teamwork makes the dream work πŸ’œ

seq_cpu_time

similar vibe, BUT it returns the computing time per user for the current process only. just you. solo. main character energy, but make it CPU seconds 🌟

dis_wall_time

returns a floating-point number of seconds, representing elapsed wall-clock time since some time in the past. and here's the tea: that time in the past is guaranteed not to change during the life of the process. so it's a stable reference point, no cap πŸ•°οΈ

the user is responsible for converting large numbers of seconds to other units if they are preferred. that's on you, bestie, not on the function πŸ™ˆ

but listen, this function is genuinely iconic for three reasons:

  • it is portable β€” it returns seconds, not ticks
  • it allows high resolution
  • it carries no unnecessary baggage

and in a distributed environment? dis_wall_time clocks are synchronized: different nodes return the same time value at the same instant. same instant, same value, across the whole crew. that's harmony 🌈

seq_wall_time

similar, but the time returned is local to the node that called them, and the clocks are not synchronized. in a distributed environment, different nodes can return different local times, at different instants when the call to seq_wall_time is reached.

so lowkey: dis_wall_time = everybody agrees on what time it is πŸ’–, seq_wall_time = every node has its own little opinion πŸ™ˆ

πŸ”§ IMPLEMENTATION

this documentation has been generated from file linalg/lib/dis_cpu_time.h


πŸŽ€ AUTHOR

Pierre Saramito <Pierre.Saramito@imag.fr>


Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>

GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.


and that's the whole page, bestie πŸ’– this was rheolef, Version 7.2 β€” and the page itself is dis_cpu_time(7rheolef), right at the bottom like a little signature. slay, go time your code, periodt βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from