specifying the number of cores
Hi, I was wondering if there is a way to specify the number of cores that graph-tool uses for OpenMP algorithms? I couldn't find it looking through documentation and the mailing list. It would be nice if you could set n_cores=1 when running graph-tool on a cluster, for example, and set n_cores=4 when running on a local machine. Thanks, and sorry if this has been asked before, Alexey -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 26.08.2015 23:26, ostrokach wrote:
Hi,
I was wondering if there is a way to specify the number of cores that graph-tool uses for OpenMP algorithms? I couldn't find it looking through documentation and the mailing list.
It would be nice if you could set |n_cores=1| when running graph-tool on a cluster, for example, and set |n_cores=4| when running on a local machine.
There are a couple of different ways to do this. For any OpenMP program (not only graph-tool), you can specify the following environment variable OMP_NUM_THREADS=n before the program is run. If you want to modify the number of threads during the program, you can use the the function graph_tool.openmp_set_num_threads(). Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Great, thanks a lot! -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
participants (2)
-
ostrokach -
Tiago de Paula Peixoto