Go to Post See, the boyfriend/girlfriend IS the robot. :D - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-12-2010, 01:32
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Dynamically parallel

Quote:
Originally Posted by kamocat View Post
Hi Folks,

Here's how I'm trying to execute them in parallel:
Hi, You only have one VI ref here. You will need a new ref for each VI instance that you want to run. Secondly, you specify to open as a re-entrant VI as the option when opening the reference.
<Hint>Open VI Reference primitive</hint>

Edit: While this is "legal" LabVIEW code, I would recommend against it if you can avoid it. There is some overhead when opening VI's in this manner. (Dynamic calling) If calling parallel code statically, (IE. Specifying at edit time on the block diagram) the overhead is very minimal.

Last edited by SuperS_5 : 22-12-2010 at 01:35.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-12-2010, 09:20
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Dynamically parallel

As others have mentioned, you need to get a new vi ref for each run. What I'd recommend is to in advance, loop through doing the opens and putting the refs into an array, same size as the CAN IDs. Then your timing will not include data space cloning and mgmt overhead. Personally, I've only used this a few times, and for profiling, tend to drop the reentrant code N times. If much code is involved, I wrap it into another reentrant subVI. If I need hundreds, I drop ten, make a subVI, and drop ten of those, etc.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 22-12-2010, 17:02
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Dynamically parallel

Hi again. I just want to add an extra note. The performance of parallel code will greatly depend upon the target. Single core targets will likely not benefit from parallel code. (Massively multi-core targets obviously benefit greatly) The exception would be if a piece of code must wait for a response from another device, then parallel coding MAY benefit. Usually LabVIEW's compiler can generate more efficient code that is serial then code that is parallel, and therefore, parallel code may potentially be worse in terms of performance. There are a number of articles on the NI site that describe this. Parallel "engines" like what I think you are trying to build can introduce race conditions.
__________________
Mike B

Last edited by SuperS_5 : 22-12-2010 at 17:27.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel Batteries DiehardCybercard Electrical 14 06-11-2009 07:15
Batteries in Parallel ubermeister Electrical 20 10-04-2008 08:58
Parallel Tanks AdamC Pneumatics 12 13-11-2007 20:14
Parallel Processor rohandalvi Kit & Additional Hardware 25 27-10-2004 20:21
Working in Parallel dubya404 3D Animation and Competition 7 28-01-2003 11:48


All times are GMT -5. The time now is 21:20.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi