l******9 发帖数: 579 | 1 如何确保多线程程序在 multicore server 上确实使用了 所有的 core
to do computing in parallel physically (not logically)
I have a multicore server, which has 24 CPU, each CPU has 6 cores.
It is Intel xzeon X5650 2.67GHz
cpu cores : 6 (support 6 threads)
cpu MHz : 1596.000
totally, I have 24 * 6 = 144 cores.
I designed a multithreaded C++ program with boost/thread.
How to make sure that my program is run by all 144 cores ?
Any help is really appreciated.
thanks |
y****e 发帖数: 23939 | 2 这是操作系统的活儿,你只要fork就行了吧。不然用openMP改一下程序。 |
l******9 发帖数: 579 | 3 May I do this by boost/thread ?
thanks
【在 y****e 的大作中提到】 : 这是操作系统的活儿,你只要fork就行了吧。不然用openMP改一下程序。
|
j******a 发帖数: 1599 | 4 fork? pthread_create ba
【在 y****e 的大作中提到】 : 这是操作系统的活儿,你只要fork就行了吧。不然用openMP改一下程序。
|
M********u 发帖数: 42 | 5 如果是简单的for loop,就用openmp包在loop外。如果logic比较复杂,需要手动
create thread。没有一个简单的办法把一个单线程的程序改成多线程的 |
C**5 发帖数: 202 | 6 您的问题我也很感兴趣啊 有解决方案一定给我发一份? |
l******9 发帖数: 579 | 7 I am also thinking about openMP.
But, how to make sure that openMP take full use of available
cores ?
Suppose that I have 24 CPUs, each of them has 6 cores (each core
supports hyperthreading).
I have 10,000 computing tasks, each of them needs 0.001 second.
Some of the tasks need to exchange data, which is very small.
Which task needs to send/receive data to/from which task is pre-defined. It
is known before the program in run.
But, the exchange frequency may be very high.
I want to schedule tasks such that
(1) all cores are always kept busy.
(2) all cores' workload is balanced.
(3) communication overhead from the data exchange is kept as small as
possible.
Can openMP help me do this ? or I have to use boost/thread do this
manually ?
Any comments or ideas are appreciated.
Thanks
【在 M********u 的大作中提到】 : 如果是简单的for loop,就用openmp包在loop外。如果logic比较复杂,需要手动 : create thread。没有一个简单的办法把一个单线程的程序改成多线程的
|
a****n 发帖数: 1887 | |
S*A 发帖数: 7142 | 9 You just need to make sure your program has at least 144 threads.
The kernel will try to schedule to each core depend on the need. |
f******y 发帖数: 2971 | 10 Is this a multicore server? I think it should be called a cluster.
【在 l******9 的大作中提到】 : 如何确保多线程程序在 multicore server 上确实使用了 所有的 core : to do computing in parallel physically (not logically) : I have a multicore server, which has 24 CPU, each CPU has 6 cores. : It is Intel xzeon X5650 2.67GHz : cpu cores : 6 (support 6 threads) : cpu MHz : 1596.000 : totally, I have 24 * 6 = 144 cores. : I designed a multithreaded C++ program with boost/thread. : How to make sure that my program is run by all 144 cores ? : Any help is really appreciated.
|
l*****o 发帖数: 473 | 11 好像pthread_setaffinity_np是唯一的方法吧。
I think that for the case here, it would be hard to ask OS to assign a
different core for a thread.
In linux, thread will be assigned to the same core in the beginning. But it
will be migrated to other cores if the thread is a long-lived thread.
If a thread is too short, then it possibly stay in the same core. I have an
experience that using process can be faster than threads for this short
lived threads. |
l*****o 发帖数: 473 | 12 lz的机器好cool,是NUMA的吗? 什么时候可以借来Try一下程序吗,我们老板不给买这
么好的机器。 |