omp.h unable to access all processors.

Hi! I'm running a pod with 8 vCPUs, but it seems like omp.h can only access 1 of them while thread can access all of them. For example,
c++
#include <omp.h>
#include <thread>
#include <iostream>
using namespace std;

int main(){
cout << omp_get_max_threads() << endl;
cout << thread::hardware_concurrency() << endl;
}
c++
#include <omp.h>
#include <thread>
#include <iostream>
using namespace std;

int main(){
cout << omp_get_max_threads() << endl;
cout << thread::hardware_concurrency() << endl;
}
will print out 1 9
8 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
||dank-memer||
||dank-memer||OP10mo ago
c++
omp_get_num_procs()
c++
omp_get_num_procs()
also returns 1 for me i was just wondering if the restriction on nproc could be somehow affecting omp
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
||dank-memer||
||dank-memer||OP10mo ago
ok thanks!
Madiator2011 (Work)
looks like cpu pod limitations
||dank-memer||
||dank-memer||OP10mo ago
is there a way to multithread with omp on a cpu pod then? I cant seem to utilize more than one core at a time
Madiator2011 (Work)
I suspect might be not. I was able to get it work on gpu though
||dank-memer||
||dank-memer||OP10mo ago
ah thats unfortunate thanks tho

Did you find this page helpful?