[PATCH] D85531: [SystemZ/ZOS] Add support for getHostNumPhysicalCores()

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 07:38:20 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Support/Host.cpp:1334
+      static_cast<uintptr_t>(reinterpret_cast<unsigned int &>(CVT[CVTCSD])));
+  return reinterpret_cast<int &>(CSD[CSD_NUMBER_ONLINE_STANDARD_CPS]);
+}
----------------
Kai wrote:
> MaskRay wrote:
> > If z/OS supports something similar to `taskset -c 0-3 $program`, make sure the function returns a number less than or equal to 4. 
> Thanks for the hint. This kind of command is not supported on z/OS.
> The reason is the fault tolerance available in z/OS: if a defect in a CP is detected, then this CP can go offline and a spare CP can continue to run the code exactly at the point where the former CP went offline. This does not work if the process is tied to a certain set of CPs, and therefore it's not supported.
@MaskRay, I think the test you propose imposes an additional restriction that I am not sure the existing implementations of the function adhere to. Namely, I believe the test that you proposed indicates that the intent is to return a number that is one greater than the highest processor index number on the system. I think this might differ from the count of available processors. My understanding is that the function is meant to return the latter.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85531/new/

https://reviews.llvm.org/D85531



More information about the llvm-commits mailing list