在多处理器机器上执行C ++程序 [英] Executing C++ program on multiple processor machine
问题描述
我开发了一个用于研究目的的C ++程序。需要几天才能完成。
I developed a program in C++ for research purpose. It takes several days to complete.
现在我在我们的实验室8core服务器机器上执行它,以快速获得结果,但我看到机器只分配一个处理器到我的程序,它
Now i executing it on our lab 8core server machine to get results quickly, but i see machine assigns only one processor to my program and it remains at 13% processor usage(even i set process priority at high level and affinity for 8 cores).
(这是一个简单的面向对象的程序,没有任何并行性或多处理器使用(即使我在高级别设置进程优先级,线程)
(It is a simple object oriented program without any parallelism or multi threading)
我如何从强大的服务器机器真正受益?
提前感谢。
How i can get true benefit from the powerful server machine? Thanks in advance.
推荐答案
将您的代码分成可以并行执行的块。
Partition your code into chunks you can execute in parallel.
Then you can use OpenMP or MPI to break up your program.
这篇关于在多处理器机器上执行C ++程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!