--- /home/jsapp/src/parallel-20180322/src/parallel	2018-03-22 03:37:56.000000000 -0400
+++ parallel	2018-04-17 13:24:25.591359995 -0400
@@ -6301,15 +6301,21 @@
     #   Number of physical CPUs on GNU/Linux
     #   undef if not GNU/Linux
     my $no_of_cpus;
+    my $no_of_sockets;
     my $no_of_cores;
     my $no_of_active_cores;
     if(-e "/proc/cpuinfo") {
         $no_of_cpus = 0;
+        $no_of_sockets = 0;
         $no_of_cores = 0;
+        my %phy_seen;
         my %seen;
         if(open(my $in_fh, "<", "/proc/cpuinfo")) {
 	    while(<$in_fh>) {
-		if(/^physical id.*[:](.*)/ and not $seen{$1}++) {
+		if(/^physical id.*[:](.*)/ and not $phy_seen{$1}++) {
+		    $no_of_sockets++;
+		}
+		if(/^core id.*[:](.*)/ and not $seen{$1}++) {
 		    $no_of_cpus++;
 		}
 		/^processor.*[:]/i and $no_of_cores++;
@@ -6330,7 +6336,7 @@
 	    close $in_fh;
 	}
     }
-    return (::min($no_of_cpus || $no_of_cores,$no_of_active_cores));
+    return (::min(($no_of_cpus * $no_of_sockets) || $no_of_cores,$no_of_active_cores));
 }
 
 sub no_of_cores_gnu_linux {
