由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 如何确保多线程程序在 multicore server 用所有 core
相关主题
openMP or boost::thread (pthread) for multithreading ?谁有配置NUMA的经验
when should use multiprocess not multithread: embedded multicore linuxCPU温度很高 (转载)
Redhat6 正式发布了cluster上提交50+的interactive job算不算奇葩?
OpenMP 求救。。。 (转载)有没有vim给程序员的入门教程?主要用c.
Firefox 4 RC 不错How to debug "broken pipe" in linux programming ?
in what case you still want to use process instead of thread in linux ?xterm got kill when i run my application, how come ?
job scheduling questionlinux下面有没有能并行网络copy的工具?
Process and Thread求教gdb下多线程调试问题
相关话题的讨论汇总
话题: cores话题: multicore话题: cpu话题: thread话题: core
进入Linux版参与讨论
1 (共1页)
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
8
set cpu affinity
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一下程序吗,我们老板不给买这
么好的机器。
1 (共1页)
进入Linux版参与讨论
相关主题
求教gdb下多线程调试问题Firefox 4 RC 不错
FreeBSD越来越好用了in what case you still want to use process instead of thread in linux ?
is it possible to combine two threads into one in gmail?job scheduling question
CPU确实可以留后门 (转载)Process and Thread
openMP or boost::thread (pthread) for multithreading ?谁有配置NUMA的经验
when should use multiprocess not multithread: embedded multicore linuxCPU温度很高 (转载)
Redhat6 正式发布了cluster上提交50+的interactive job算不算奇葩?
OpenMP 求救。。。 (转载)有没有vim给程序员的入门教程?主要用c.
相关话题的讨论汇总
话题: cores话题: multicore话题: cpu话题: thread话题: core