OpenMP and CPU usage

asked 2014-07-22 09:42:38 -0500

Neph gravatar image

updated 2014-07-22 14:07:29 -0500

smaffulli gravatar image

I was using a program in C on my personnal computer which used parallelization with OpenMP. It worked fine until i tried to use it on an Openstack instance.

Here's what i get when i use top command on my personnal computer when using the program (12 cores Intel(R) Xeon(R) CPU X5650 @ 2.67GHz). This is the expected behaviour

Normal behaviour

Here's what i get when i use top command on the openstack machine when using the program (8 cores Intel Xeon E312xx (Sandy Bridge) @ 2599.998 Mhz)

Unexpected behaviour

Multiple questions here:

  1. When i do a cat /proc/cpuinfo on the openstack machine, it tells me that the proc is a Xeon E312xx. Isn't it a cpu family? because that's what i get when i look it up on google. How can i know the exact model?

  2. We can see that threads are not using full CPU usage and are sometimes put to sleep, which never happened on my computer (always have 99.9~% on each threads). How come they are put to sleep. It's not due to memory usage or swaping since i'm barely using them.

Sorry, my knowledge is really low on UNIX systems and even lower on openstack.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-22 10:26:50 -0500

dasp gravatar image

The fact that your threads are put to sleep is an immediate effect of virtualization. The virtual machine will yield to the host once in a while. It all depends on the CPU shares configured by your virtualization hypervisor.

The processor family visible to your instance is slightly modified and can be configured globally in nova. You can either completely change the model your instances see or just "unify" its capabilities. This is useful if you have multiple compute nodes with slightly different physical CPUs and you want to do online migrations - you need a common denominator across all compute nodes or else the migration will fail.

To get the exact same CPU visible to the instance, on your compute node set in /etc/nova/nova.conf: libvirt_cpu_mode=host-passthrough

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-07-22 09:42:38 -0500

Seen: 379 times

Last updated: Jul 22 '14