How could we write a job summary report to stdout that reports total cputime and max memory usage to stdout at the completion of the job? It would need to be resilient to job timeouts and cancellation.
There is an email wrapper here with this functionality that may satisfy your requirements: http://bugs.schedmd.com/show_bug.cgi?id=1611 Rather than the slurm daemon spawning the mail program directly, it spawns an email wrapper that waits for the accounting information to be collected and sent to the user. This will be in the next major release of Slurm, version 16.05 in May 2016. Here is the commit with that code: https://github.com/SchedMD/slurm/commit/93d9189c35be9d603cfedb09b55c4110a9b5779a