01-17-2013 11:35 PM
I have some code which isn't utilizing all of the processors on my system, but it should be, so I profiled the execution of the compiled executable code using "Intel VTune Amplifier". That program told me that my code is spending a lot time in synchronization or threading overhead, and that the main function that its constantly executing (>50%) is called "EventLoggingEnumLogEntry", and it's contained in lvrt.dll. It's also spending a fair amount of time executing a function "LvVariantCStrSetUI8Attr".
Can anyone tell me what these functions are and what in my LV code would activate them? I can't even start to find where the bottleneck is in my code with the information I currently have...
Thanks!
01-21-2013
10:33 AM
- last edited on
03-12-2025
09:46 AM
by
Content Cleaner
Hi Rothloup,
If you have multiple loops that you want to run on separate cores, you can set them to run parallel iterations.
Are you using an event structure in your code? EventLoggingEnumLogEntry may be referring to an event structure. It sounds like your program may be polling for event structures more frequently than it needs to.
Also, for more meaningful information that can be translated directly to the LabVIEW development system, why don't you try using the Profile Performance and Memory window available in LabVIEW?
I hope this helps!
01-21-2013 11:04 AM
Joey,
Thanks for the reply!
I've already parrallelized the loops, and the problem is that each core is only using about 25-40% of its capacity. I can't figure out what is limiting the speed of execution on each core. One of the papers I read suggested that I can find the bottleneck using the Intel VTune program. I used that instead of the Labview native profiler because the LV profiler will tell me where my code is spending most of its time, but it doesn't tell me if there is some other bottleneck (like perhaps one thread is waiting for another or something like that). I had already taken the information in the profiler as far as I know how to, by finding and optimizing the most commonly executed code in my application.
There is an event structure in my application, but once I press the "GO" button, which kicks off the intensive computing, I have the event structure disabled by placing it within a case structure and using a boolean to keep LV from executing the event structure. Under certain conditions (like completion of the computing), the boolean will be flipped and enable the event structure, but that only happens AFTER the computation is complete. I've confirmed that LV is not executing the event structure with breakpoints.
Does the mere presence of the event structure, even without execution, cause LV to spend extra resources checking for events? I also tried seperating the application into two while loops - one containing the event structure, and one containing the processing code. When the first while loop terminates (again, when pressing the "GO" button), the second will execute with no case structure in the loop. That did not seem to relieve the bottleneck.
This thread is the first thread that I posted regarding this topic. One of the last replies includes some of my code, if you are curious to look at it.
Thanks!
01-21-2013 04:58 PM
rothloup wrote:
Does the mere presence of the event structure, even without execution, cause LV to spend extra resources checking for events? I also tried seperating the application into two while loops - one containing the event structure, and one containing the processing code. When the first while loop terminates (again, when pressing the "GO" button), the second will execute with no case structure in the loop. That did not seem to relieve the bottleneck.
An event structure anywhere on a diagram (except inside a diagram disable) will queue events for which it has registered. I don't know if this adds much load when there are no events.
Going back to your original post, have you disabled debugging on all your VIs? I didn't see that in the list of things you'd tried; it does make a large difference in execution speed.
01-21-2013 07:07 PM
I just checked all the events that the event structure is monitoring, and none of them are occuring during the computation. So I wouldn't figure that it is accumulating events...
Yeah, I have disabled debugging in most of the VIs which are run frequently - I haven't disabled it in the outer loop, because I figure that's not bottleneck. But I'll try it out and see if that helps...
Thanks!
01-21-2013 08:33 PM
@rothloup wrote:
I just checked all the events that the event structure is monitoring, and none of them are occuring during the computation.
What do you mean by "occuring"?
Earlier, you said that: "There is an event structure in my application, but once I press the "GO" button, which kicks off the intensive computing, I have the event structure disabled by placing it within a case structure and using a boolean to keep LV from executing the event structure"
This means that the event structure is active and is accumulating event. It just cannot repond to them. (event are queued up even if the event structure is currently not in the dataflow!)
01-21-2013 11:57 PM
What I mean is that the events that are listed in the event structure (i.e. the events for which I have defined an event case) do not happen, so there is no event to accumulate.
I have just 5 event cases defined, all of which are for "Value Change" for various front panel controls/indicators. Those front panel objects are not updated or changed in any way (except through user activity, of course) during the execution of the intensive computation in the program.
Perhaps I misunderstand how an event structure works, but I would be surprised if the structure must execute in order to flush out a queue of ignored events. If that were the case, wouldn't the case structure have to process every event that occcurs, regardless of whether it has an event case defined or not? That seems very inefficient, but I've been surprised and perplexed before...
01-22-2013 06:39 PM
Rothloup,
Is your event actually inside a Diagram Disable structure right now?
When you delete the event structure, does that EventLoggingEnumLogEntry term consume less processor resources in Intel VTune Amplifier?
The Event Structure processes the events it is configured for provided it is on the block diagram and compiled with the code. Simply placing it in a case structure that is not visited does not remove it from the system. If you are not engaging any of the events (Value Change, etc) during the program, then there should not be a queue developing. There will, however, be polling of the event structure to determine if new events have been called. You might also try adding a 1 ms Wait in your containing loop for the event structure to free resources to focus on other computations.
Best,