Merge pull request #4513 from ChipKerchner/fixNumCoresAIX

Fix get_num_cores for AIX.
This commit is contained in:
Martin Kroeker
2024-02-22 12:42:15 +01:00
committed by GitHub

View File

@@ -90,7 +90,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/sysinfo.h>
#include <unistd.h>
#endif
#if defined(AIX)
#if defined(_AIX)
#include <unistd.h>
#include <sys/systemcfg.h>
#include <sys/sysinfo.h>
#endif
@@ -1870,11 +1872,13 @@ static int get_num_cores(void) {
return count;
#elif defined(AIX)
#elif defined(_AIX)
//returns the number of processors which are currently online
count = sysconf(_SC_NPROCESSORS_ONLN);
if (count <= 0) count = 2;
return count;
#else
return 2;
#endif