0

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?

mahmood
  • 23,197
  • 49
  • 147
  • 242

1 Answers1

1

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.

Shachar Shemesh
  • 8,193
  • 6
  • 25
  • 57
  • OK thank you very much. Problem is that in the second approach, the torque (PBS job manager) understand that as one job with one core! However, it has to understand actually two cores are occupied. Currently, it will wrongly think about free cores. – mahmood Jul 06 '16 at 14:52
  • Then your job manager has a bug. Multiple threads as a very common way of utilizing more than one core. – Shachar Shemesh Jul 06 '16 at 15:17