Hi Purvesh,
With some caveats, you can do:
$ sacct -N <nodename> -X -S <start date> -E <end date> -P format=jobid,alloctres
And then post process the results with a scripting language.
The caveats? . . The -X above is returning the job allocation, which in your case it appears to be everything you need. However for a job or step that spans multiple nodes Slurm doesn’t save in the database what specific resources were allocated on each node.
“scontrol show job <jobid> -d” does display the node specific resource allocations, but this information is discarded during summarisation to Slurmdbd.
-Greg