mahmood
mahmood

Reputation: 24685

utilizing multiple cores in a multicore/multithread application

In Linux, I see two approaches for running multicore applications. Assume a program utilizes 2 cores. With the first approach, by using top, I see two processes and each each core is 100% utilized

22213 mahmood  20   0 1951m 180m  21m R 101.4  0.3 575:58.46 fluent_mpi.17.0
22214 mahmood  20   0  660m 167m  22m R 101.2  0.3 365:54.85 fluent_mpi.17.0

With the second approach, I see one process but the utilization is 200%.

23286 mahmood  20   0 17.3g  13g 6776 R 203.2 21.5  17200:56 l1002.exe

What is the difference between these two approaches? Is it possible to change the second approach to be seen similar to the first approach?

Upvotes: 0

Views: 54

Answers (1)

Shachar Shemesh
Shachar Shemesh

Reputation: 8563

The second approach, as you call it, is using multiple threads. Threads are shown in top under the same process, so the process is seen as consuming 200% of CPU time.

Pressing "H" in top will show you threads, as opposed to processes. This should allow you to see the display you are looking for.

Upvotes: 1

Related Questions