LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Hyperthreading and CVI compiler compatibility

Hello,

I have observed that with Hyperthreading ON (Dual processors)the CVI application created in CVI 6.0 do not behave as desired, esp. in Motion control applications.
Does anybody know about the relationship between the Hyperthreading and the CVI applications performance?
If there was a problem with CVI 6.0, has that been taken care of in CVI 7.1?

Any suggestions would be helpful.

regards,

Dwivedi
0 Kudos
Message 1 of 5
(3,536 Views)
Hello Dwivedi,

Specifically, what kind of incorrect behavior are you seeing when you switch to hyperthreading? Your application crashes, hangs, etc? Also, does your application behave incorrectly at a particular section of the code, or after a certain set of user interface actions?

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 5
(3,510 Views)
Hello Wendy,
Thanks for the reply.

Well, in this case, the software does not crash and neither hangs. The specific problem that we see is mostly during the process of data communication between the code and the hardware. From our perspective, a timer function that ticks in at every 300ms acquires data from the motion control hardware through DAQ cards: is the only function that might be causing it. The data read from the piece of hardware is not what is expected. This application has been developed in CVI 6.0. This does not occur at every instance of the application either.
We have seen this problem on more than one computer and each of these computers have hyperthreading ON.
Literature on the NI website, on somekind of relationship between the LabView compilers and Hyperthreading led us to start thinking in terms of similar factors in this case too. Is there a relationship between the CVI compiler and the Hyperthreading. Any thing in particular with 6.0? If yes, then has NI taken care of such issues in CVI 7.1?

regards,

Dwivedi
0 Kudos
Message 3 of 5
(3,506 Views)
Hi Dwivedi,
I haven't used any DAQ cards in a long time, but I have written data acquisition software for use with FieldPoint that worked equally reliably on P3 boxes, P4 boxes (legacy and HT), and a dual Xeon box. I started my early installations as CVI 6 projects, and have since recompiled and redistributed CVI 7.1 code. I never had one lick of problem. If you are using DAQ, or DAQmx, admittedly you may have issues that I don't have.

I did a very specific redesign for the dual Xeon box installation, to pull all inbound data through a single callback and then put it into a thread-safe queue as directly and quickly as possible. NI suggests that you generally not channel multiple DAQ callbacks through a single function, but my personal experience is that a 'big-iron' box can handle almost 950 FieldPoint callbacks per second, and 'baby-iron' box can handle about half of that. I have never been able to log a true inbound DAQ misbehavior with the single callback style, even though I had a few false scares initially. Using undocumented or unsuggested approaches is always done at your own risk, of course.

If you are extremely diligent in not permitting multiple threads (and therefore multiple logical processors) from accessing the same variables simultaneously, and if you heed warnings in the function panels about a status variable or return value not being thread-safe, you generally should be OK. If any function calls that you use are not thread-safe, then use thread locks or similar.
It doesn't sound like you are sampling too quickly, so you might run some speed tests of just the DAQ portion of your code to see what the limit is on the different types of boxes. You may find that at extremely high DAQ rates, you can't log any malfunctions, this would mean that you probably have a glitch or timing issue with some other portion of your code.

I would also mention that all of the software that runs in conjunction with your code can have a profound impact on performance. Even though the dual Xeon boxes might have about 200% more 'power' than a single legacy P4, my CVI code can handle almost 10x the load. Since I have lots of disk I/O to a database engine, the hyperthreading picks up all of the blocks and stalls and lets other portions of my code continue to run. I'm not saying that your install will be the same, but I am saying that some really unpredictable results can occur with hyperthreading, even moreso with multi-processor hyperthreading.

Orlan
0 Kudos
Message 4 of 5
(3,487 Views)
Hello Dwivedi,

I think the question is really going to be dependent on the hardware and drivers you are using. Could you specify which function is returning unexpected behavior, and mainly what hardware and software drivers you are using?

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 5 of 5
(3,452 Views)