Hi Sonal,
To my understanding, each socket will have its own RAPL register, which is the reason why you need multiple threads to read the registers from different socket.
In rapl-read.c, there is a parameter "-c", which let you specify which core you want to monitor. You can leverage that to monitor the socket you want.
Suppose you have a 2-socket machine, and the cores on the first socket are 0-3 and 4-7 on the second socket:
first socket: 0, 1, 2, 3
second socket: 4, 5, 6, 7
Correct me if I'm wrong but I think you can run a rapl-read with "-c 0" to measure socket 0, and another rapl-read with "-c 4" to measure socket 1. And the measurement you get from "-c 0" should be the same as "-c 1", "-c 2" and "-c 3" (any core on the same socket).
Yunqi