thu-pacman / GeminiGraph

A computation-centric distributed graph processing system.
Apache License 2.0
316 stars 129 forks source link

Number of cpus #3

Open danghvu opened 7 years ago

danghvu commented 7 years ago

Hi,

I'm using Gemini and find out that the number of threads is set to the number of hardware threads. This is suboptimal in my experiment. It's better to set it to an entire core.

Can you confirm if it will work OK if I set number of threads to number of cores or is there any side effect ?

coolerzxw commented 7 years ago

Hi. In your case, as long as the thread affinity is properly set, this change (to the number of threads) should not introduce side effects. You can use OpenMP environmental variables to ensure threads are allocated as expected.

danghvu commented 7 years ago

Yes, my changes are simply:

-    threads = numa_num_configured_cpus();
+    threads = omp_get_max_threads();

And set the number of threads using OMP_NUM_THREADS and affinity with OMP_PLACES=cores

Is this your intention to use numa_num_configured_cpus for targeting hardware threads ? Or you didn't consider that case ?

danghvu commented 7 years ago

Personally I think it's better to allow the user to chose how many threads to run and the binding accordingly.