11-06-2012 12:29 PM
We are trying to figure a way force execution to a single core of a sub-section of our code. What has been purposed, or more correctly asked of me, is whether putting a few of our vi's together in a time loop will force their execution to run on a selected core? I'm not sure, so have thrown the question out here.
Thanks, as usual.
11-06-2012 12:32 PM - edited 11-06-2012 12:33 PM
That is the understanding I have. I don't know of any way other than using the timed loop. There is an input for "processor" affinity to the loop. The tests I have performed in the past (8.5 or 8.6?) showed that it works for the RT and Windows systems.
11-06-2012 12:34 PM
Timed seq will have the same effect.
Ben
11-06-2012 12:41 PM
ditto that. that is what the prophets say and the only way to "Pick" your core that I know of.
Do you really need to be selective of the core or do you simply need a set of functions to operate atomically? If the exact core is not the issue there are other methods
11-06-2012 12:42 PM
@Ben wrote:
Timed seq will have the same effect.
Ben
I have not used those. Good to know same options are there too.
11-06-2012 12:45 PM
@JÞB wrote:
Do you really need to be selective of the core or do you simply need a set of functions to operate atomically? If the exact core is not the issue there are other methods
I have ran into situations where I had two processes that just needed to stay out of each other's hair core. The exact core didn't matter, as long as they were on different ones. I used the timed loops for that situation.
11-06-2012 01:29 PM
Ok, to refine the question, if a few sub-vi's, which themselves run essentially autonomously, can they be coerced to run on a common core this way?
Thanks for the rapid response, am at a new gig, where I have been brought in as someone knowledgeable in LabVIEW and of course get asked the more esoteric questions.
11-06-2012 01:54 PM
In theory yes.
Ben
11-06-2012 01:54 PM
By using a timed sequence around each of your "Automomous pieces" and wiring the same core into each timed structure you will force all pieces to be on the same core HOWEVER, they will each be in thier own execution systems since each timed structure creates it own threadpool. What does this mean for your code and code effeciency IDNK Thats as far under that hood as I've ever had to dig. I suspect that unless this is a very wonkey project (And I almost bet it is) there will be far lower-hanging fruit to optomize the code than eliminating contentions between execution systems running on a common core.
But I'll listen if anyone's got more to offer
11-06-2012 01:59 PM
As has been said, any VIs that are called inside of the timed loop/sequence will run in the same core. I also agree that this as a true need is very rare and a code cleanup may be in order.