<div dir="auto">Dear Loris, <div dir="auto"><br></div><div dir="auto">When we grep it by the user name "j.mira" it will strike out the multiple counts. Again sacct is showing fewer gpu minutes than sreport. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 1 Sep, 2021, 6:03 PM Loris Bennett, <<a href="mailto:loris.bennett@fu-berlin.de">loris.bennett@fu-berlin.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Jeherul,<br>
<br>
Jeherul Islam <<a href="mailto:jeherul@gmail.com" target="_blank" rel="noreferrer">jeherul@gmail.com</a>> writes:<br>
<br>
> Dear Loris, <br>
><br>
> Thanks for your reply. Here is the output for the same period but the result is not matching.<br>
><br>
> #sacct --account=chemistry --format=jobid,user,ElapsedRaw,state,AllocGRES,ncpus --starttime=2021-05-01 --endtime=2021-08-31  | grep j.mira| grep gpu| awk '{sum += $3} END {print sum}'<br>
<br>
I think you need the option '-X' for 'sacct'.  This will give you one<br>
line per job rather than including the steps.  Without '-X' you are<br>
counting the usage multiple times for each job.<br>
<br>
Cheers,<br>
<br>
Loris   <br>
<br>
<br>
> 6835053          (6835053/60 = 113917 )<br>
><br>
> # sreport cluster AccountUtilizationByUser cluster=**** user=j.mira start=2021-05-01 end=2021-08-31 --tres="gres/gpu" <br>
> --------------------------------------------------------------------------------<br>
> Cluster/Account/User Utilization 2021-05-01T00:00:00 - 2021-08-30T23:59:59 (10540800 secs)<br>
> Usage reported in TRES Minutes<br>
> --------------------------------------------------------------------------------<br>
>   Cluster         Account     Login     Proper Name      TRES Name     Used <br>
> --------- --------------- --------- --------------- -------------- -------- <br>
> ********       chemistry    j.mira          j.mira       gres/gpu   149434 <br>
><br>
> On Wed, Sep 1, 2021 at 5:27 PM Loris Bennett <<a href="mailto:loris.bennett@fu-berlin.de" target="_blank" rel="noreferrer">loris.bennett@fu-berlin.de</a>> wrote:<br>
><br>
>  Dear Jeherul,<br>
><br>
>  Jeherul Islam <<a href="mailto:jeherul@gmail.com" target="_blank" rel="noreferrer">jeherul@gmail.com</a>> writes:<br>
><br>
>  > Dear All, <br>
>  ><br>
>  > Please share the correct way of calculating the GPU usages.<br>
>  > I am confused with sreport and sacct cmd. I am getting a different result. <br>
>  ><br>
>  > # sreport cluster AccountUtilizationByUser cluster=**** user=j.mira start=2021-05-01 end=2021-08-31 --tres="gres/gpu" <br>
><br>
>  Here you have:<br>
><br>
>    end=2021-08-31<br>
><br>
>  > --------------------------------------------------------------------------------<br>
>  > Cluster/Account/User Utilization 2021-05-01T00:00:00 - 2021-08-30T23:59:59 (10540800 secs)<br>
>  > Usage reported in TRES Minutes<br>
>  > --------------------------------------------------------------------------------<br>
>  >   Cluster         Account     Login     Proper Name      TRES Name     Used <br>
>  > --------- --------------- --------- --------------- -------------- -------- <br>
>  > ****       chemistry    j.mira          j.mira       gres/gpu   149434 <br>
>  ><br>
>  > # sacct --account=chemistry --format=jobid,user,ElapsedRaw,state,AllocGRES,ncpus --starttime=2021-05-01 --endtime=2021-08-01  | grep j.mira| grep gpu| awk '{sum += $3} END {print sum}'<br>
><br>
>  whereas here you have<br>
><br>
>    --endtime=2021-08-01<br>
><br>
>  > 4957060<br>
>  ><br>
>  > Please share the correct way.<br>
>  ><br>
>  > With Thanks and regards<br>
><br>
>  so, without having checked your sacct/awk logic I would not expect the results to be the same.<br>
><br>
>  Cheers,<br>
><br>
>  Loris<br>
><br>
>  -- <br>
>  Dr. Loris Bennett (Hr./Mr.)<br>
>  ZEDAT, Freie Universität Berlin         Email <a href="mailto:loris.bennett@fu-berlin.de" target="_blank" rel="noreferrer">loris.bennett@fu-berlin.de</a><br>
-- <br>
Dr. Loris Bennett (Hr./Mr.)<br>
ZEDAT, Freie Universität Berlin         Email <a href="mailto:loris.bennett@fu-berlin.de" target="_blank" rel="noreferrer">loris.bennett@fu-berlin.de</a><br>
<br>
</blockquote></div>