macOs version: 10.13.5 (17F77)
XGBoost does not work in parallel. I set nthread to 8, but nothing changes. I searched on the internet and learn that it is common problem. This is what I did so far.
I installed gcc by using brew. So, I have gcc-8 now. I followed official documentation, but I still could not make it work.
I saw this example here.
#include <iostream>
#include <cstdint>
#include <omp.h>
int main(void) {
const uint64_t N = 100000000000;
uint64_t sum[8] = {0};
#pragma omp parallel for
for (uint64_t i = 0; i < N; ++i) {
sum[omp_get_thread_num()] += i;
}
for (uint64_t i = 0; i < omp_get_max_threads(); ++i) {
std::cout << sum[i] << std::endl;
}
return 0;
}
I tried to compile it by running gcc -o main main.cc -fopenmp -O3 -msse2. It did not work.
Then I tried g++ -o main main.cc -fopenmp -O3 -msse2 . This one worked.
What am I doing wrong?
You can also see the question on stackoverflow that I opened today. That includes more info.