No `grep 'physical id' /proc/cpuinfo |wc -l` (the sort is superfluous) is equivalent to `grep processor /proc/cpuinfo | wc -l` producing the number of SMT logical cores.  So you can see how this looks, here's a cpuinfo extract from a 4 socket, 6 core/socket, SMT system:
```
$ egrep 'cores|processor|physical id' /proc/cpuinfo
processor	: 0
physical id	: 0
cpu cores	: 6
processor	: 1
physical id	: 0
cpu cores	: 6
processor	: 2
physical id	: 0
cpu cores	: 6
processor	: 3
physical id	: 0
cpu cores	: 6
processor	: 4
physical id	: 0
cpu cores	: 6
processor	: 5
physical id	: 0
cpu cores	: 6
processor	: 6
physical id	: 1
cpu cores	: 6
processor	: 7
physical id	: 1
cpu cores	: 6
processor	: 8
physical id	: 1
cpu cores	: 6
processor	: 9
physical id	: 1
cpu cores	: 6
processor	: 10
physical id	: 1
cpu cores	: 6
processor	: 11
physical id	: 1
cpu cores	: 6
processor	: 12
physical id	: 2
cpu cores	: 6
processor	: 13
physical id	: 2
cpu cores	: 6
processor	: 14
physical id	: 2
cpu cores	: 6
processor	: 15
physical id	: 2
cpu cores	: 6
processor	: 16
physical id	: 2
cpu cores	: 6
processor	: 17
physical id	: 2
cpu cores	: 6
processor	: 18
physical id	: 3
cpu cores	: 6
processor	: 19
physical id	: 3
cpu cores	: 6
processor	: 20
physical id	: 3
cpu cores	: 6
processor	: 21
physical id	: 3
cpu cores	: 6
processor	: 22
physical id	: 3
cpu cores	: 6
processor	: 23
physical id	: 3
cpu cores	: 6
processor	: 24
physical id	: 0
cpu cores	: 6
processor	: 25
physical id	: 0
cpu cores	: 6
processor	: 26
physical id	: 0
cpu cores	: 6
processor	: 27
physical id	: 0
cpu cores	: 6
processor	: 28
physical id	: 0
cpu cores	: 6
processor	: 29
physical id	: 0
cpu cores	: 6
processor	: 30
physical id	: 1
cpu cores	: 6
processor	: 31
physical id	: 1
cpu cores	: 6
processor	: 32
physical id	: 1
cpu cores	: 6
processor	: 33
physical id	: 1
cpu cores	: 6
processor	: 34
physical id	: 1
cpu cores	: 6
processor	: 35
physical id	: 1
cpu cores	: 6
processor	: 36
physical id	: 2
cpu cores	: 6
processor	: 37
physical id	: 2
cpu cores	: 6
processor	: 38
physical id	: 2
cpu cores	: 6
processor	: 39
physical id	: 2
cpu cores	: 6
processor	: 40
physical id	: 2
cpu cores	: 6
processor	: 41
physical id	: 2
cpu cores	: 6
processor	: 42
physical id	: 3
cpu cores	: 6
processor	: 43
physical id	: 3
cpu cores	: 6
processor	: 44
physical id	: 3
cpu cores	: 6
processor	: 45
physical id	: 3
cpu cores	: 6
processor	: 46
physical id	: 3
cpu cores	: 6
processor	: 47
physical id	: 3
cpu cores	: 6
```