Jump to content
Sign in to follow this  
VilasG

Multicore execution in Labview8.5

Recommended Posts

Hi,

For a couple of days now i have been studying the behaviour of labview 8.5 on a multicore processor machine. I recently upgraded from labview 7.1 and a single core processor to an 8 core machine with labview 8.5. My application was responsible for doing a very big math which took more time on 7.1 and single cpu. So my team decided to move to the multicore solution with 8.5. As suggested by NI white papers i split my input data depending on the number of cpu cores available(8 in my case) and have 8 parallel loops work independently on diff cpus and finally join the result. Before putting my actual code on this experiment i made a small vi just to investigate the behaviour. i am attaching the same here. I am puzzled by the fact that after 4 cpus the execution time increases and decreses again.

If replace while loops with timed loops and manually assign different cpus then my computer freezes intermitently. Is this a known issue with labview8.5? This happens also if i have more than 2 timed loops in a vi. Please help.

Vilas G

Share this post


Link to post
Share on other sites

There are a couple of NI forum topics that discuss setting up LabVIEW to work with multicore/multiprocessor systems. They commonly refer to the LabVIEW VI

vi.lib\Utility\sysinfo.llb\threadconfig.vi

Fully utilizing all CPU's for a LabVIEW application

Core 2 Duo, Core 2 Duo Quad, and Labview 8.2

From the second link, it seems that threadconfig.vi queries the OS capabilities. I recall that there are versions of Windows that only support a single CPU socket, a quick Google returned this. LabVIEW may be limiting your CPU load distribution as a result of what your OS reports.

I just read on another link in the same Google search that Vista includes something called the Next Generation TCP/IP stack. I was interested in this:

New support for scaling on multi-processor computers

The architecture of NDIS 5.1 and earlier versions limits receive protocol processing to a single processor. This limitation can inhibit scaling to large volumes of network traffic on a multi-processor computer. Receive-side Scaling resolves this issue by allowing the network load from a network adapter to be balanced across multiple processors. For more information, see
.

It sounds like this might be a useful option for me. Can you tell me a bit about the computer and OS you are using?

Share this post


Link to post
Share on other sites

Well,...

It should be better if you use the timed loop instead of the while loop...While loop in parallel seems to run in parallel but it is not...(this is an automatic distribution on the core...)this is greatly accurate to use timed loop and select manual (when double click) choose appropriate core for each timed , loop...

I'm not certain yet, but it seems to be 0 to 7 for your 8 cores...0 the firts core, 1 the second core...etc...

Try this ...

unfortunately I'm not using a 8 cores processor...so I'm not able to run and test the exact configuration for your program...nevertheless, I run a dual core program with no problem...

Hope this help

(try to bundle your XY graph instead of the express VI...Express VI are Dummy! To many fonction inside for nothing...This will optimize your application for sure!)

Fakstory

Share this post


Link to post
Share on other sites

Do you have to run Thread config.vi in your code everytime? Or just once and LV will maintain the thread configs internally?

Neville.

Share this post


Link to post
Share on other sites

QUOTE(Neville D @ Oct 11 2007, 12:10 PM)

<br />Do you have to run Thread config.vi in your code everytime? Or just once and LV will maintain the thread configs internally?<br /><br /><br />Neville.<br />
<br /><br /><br />

That configuration should be stored in the LabVIEW INI file and reused on each load. Not sure about the current version of LabVIEW but you actually needed to restart LabVIEW in order to get that configuration active when Thread support was introduced in LabVIEW 5.0.

Rolf Kalbermatter

Share this post


Link to post
Share on other sites

QUOTE(rolfk @ Oct 12 2007, 01:11 AM)

That configuration should be stored in the LabVIEW INI file and reused on each load. Not sure about the current version of LabVIEW but you actually needed to restart LabVIEW in order to get that configuration active when Thread support was introduced in LabVIEW 5.0.

Rolf Kalbermatter

Thanks Rolf. I was wondering why changing the threads didn't seem to make a darned bit of difference to my "multi-threaded" multi-loop application!!

That also answers my second question as to how to set up threads for an executable.

Neville.

Share this post


Link to post
Share on other sites

VilasG,

I think I can explain the spike you see at 5 CPUs. It appears that your array-splitting VI is not splitting the array into equally-sized pieces. For example, in the five-CPU case, the VI splits the array into four pieces that are one-eighth the size of the original array, and one piece that's one-half the size. This is also true for the 3, 6 and 7-CPU cases (though the sizes of the pieces differ). When I changed the VI to split the array evenly, I got the expected performance improvements.

Also, instead of using Rotate Array for an experiment like this, I recommend doing something like incrementing each array element. That way, you know that the same amount of work is getting done. As it is, you see a 4x performance improvement when going from 1 CPU to 2, and this is because your Rotate Arrays are only doing half as much total work when you split the original array in half and rotate each half.

Share this post


Link to post
Share on other sites

Thanks LV rhino

even i had figured out that i made mistake in equally splitting the array.

After splitting the array equally, i found that the least time taken is the case when 6 cpus are in use. At 7 and 8 there seems to be a problem, i think the processor resource management by windows doesnt allow labview to use all the 8 cpus at full. maybe cpu 8 and 7 are required for handling other tasks.

correct me if i am wrong

By the way thanks for your diagnosis and all others who replied too...

Cheers!

Share this post


Link to post
Share on other sites

That is possible. You might also have some other software running in the background that's sharing those last two CPUs with LabVIEW. Which version of Windows are you running? I ran your VIs on an 8-core machine with Vista installed, and still got speedup going to 7 and 8 CPUs.

Share this post


Link to post
Share on other sites

LV Rhino,

I my OS was XP. Maybe vista does a better management.

Thanks for the update will consider this point in our dept meeting.

Thanks Again.

Vilas G

QUOTE(LV Rhino @ Oct 17 2007, 07:03 PM)

That is possible. You might also have some other software running in the background that's sharing those last two CPUs with LabVIEW. Which version of Windows are you running? I ran your VIs on an 8-core machine with Vista installed, and still got speedup going to 7 and 8 CPUs.

Share this post


Link to post
Share on other sites

Just like a Labview8.5 VI is capable of doing multicore operation, the same VI when complied as a dll will have the same functionality ( in terms of multicore)?

If this is possible then one can use that dll in a 7.1 application( if one doesnt want to entirely port his code to 8.5)

Any ideas?

Vilas G

QUOTE(Vilu @ Oct 29 2007, 11:02 AM)

LV Rhino,

I my OS was XP. Maybe vista does a better management.

Thanks for the update will consider this point in our dept meeting.

Thanks Again.

Vilas G

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.