[slurm-users] slurm and dates?

Jessica Nettelblad jessica.nettelblad at gmail.com
Sat Feb 24 05:20:38 MST 2018


Hi Michael,

I also got curious where the conversion is done, so I looked into the code.

Scontrol gets dates like submit time in unix time from slurmctld, then
converts it to local time on the machine where the command scontrol show
job is executed.

This is seen in the code. Slurmctld uses unix time without conversions, for
example job_mgr.c: detail_ptr->submit_time = time(NULL);
The conversion to local time for scontrol show job I find through
scontrol.c, where the function scontrol_print_job from info_job.c is
called. It calls slurm_make_time_str, which eventually converts the time
from UTC to local time, rc = localtime_r(timep, result);
Slurmdbd also uses unix time, as seen in src/plugins/accounting_
storage/mysql/accounting_storage_mysql.c, and for example as_mysql_acct.c.

So it seems to me, unix time is used for dates, which is then converted
with localtime for certain output to be readable for humans. Since Slurm is
a C program run in a Unix environment, that is also what I would expect.

We have users all over the world, and they can set their own time zone as
an environment variable in their .profile. Then Slurm displays their local
time for them when they run scontrol, squeue, and other Slurm commands with
date information. Else they get server default local time.

Best regards,
Jessica Nettelblad, UPPMAX
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20180224/b3664c14/attachment.html>


More information about the slurm-users mailing list