It seems to work fine, it definitely creates the right number of threads and goes much faster than the original serial version.
However, the %CPU usage is huge, making me worry that the threads are being concentrated on just one or two cores (as opposed to examples I've seen online where each thread appears with its own PID).
- Code: Select all
$ export omp_num_threads=12
$ nohup ./z90nr&
$ ps aurx
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ty 25350 7771 0.0 1564928 26868 pts/9 Rl 14:18 169:40 ./z90nr
Is this a problem, and if so, how can I fix it?
I tried setting GOMP_CPU_AFFINITY, this did not solve the problem - also I'd rather not have to manually say which cores to use, since I am on a shared machine that is running all kinds of things. My understanding was that the default would be one thread per core, as long as there were enough cores (which there are).