LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

9068 and run code faster and use dual core

Solved!
Go to solution

Hi eveyone,

I am working on a project where a C library is called from a Labview vi on the target machine. I have two Crio platforms namely 9082 and 9068 which have two different operating systems and hardware. I have compiled my  code with Labwindows and run successfully in Crio 9082 within 70 ms. When I check with distributed systems manager tool, both of the cpu cores are active taking about %50 percent load.

For the second Crio platform, namley 9068, I compiled the same code with Eclipse and run it on 9068. It works and generate the same output but within 1400 ms. When I check the cpu usage, one cpu takes almost %100 load and the other is about %7. It seems that the cpu allocation is different than 9082. I have tried timed loop to manually adjust the cpu's but it does not work (namely it only allows 1 cpu use). My basic problem is to run my code faster in 9068 and obviously the problem might be different than inefficient use of dual core in 9068. I tried different code optimizations (namely, -O2, -O3, -Os) in Eclipse build and they make almost no difference. Any suggestion is appreciated. Thanks in advance.

 

Engin

0 Kudos
Message 1 of 6
(3,608 Views)

Hello Engin,

 

The 9082 is going to be higher performance than the 9068, but I wouldn't expect it to be 20x faster. Can you share a few more details about your application? A couple of questions in particular:

- Does the C library contain a lot of floating point math?

- Are there multiple threads in the C library? Or maybe are there multiple parallel calls to the C library from LabVIEW?

 

Anything else you can share about how it all works would also be helpful.

 

Sebastian

0 Kudos
Message 2 of 6
(3,571 Views)

Hi Sebastian,

-The C library is composed of several functions each one of them doing some kind of floating point operation.

-Labview vi calls the C library only once and the functions inside the library call the other functions.

 

When I look at the memory allocation in the profiler the program needs about 7MB. There are some large 1D arrays in the library. But it seems that

9068 has enough memory for that. The only point is 9068 uses virtual memory allocation  (I have no idea how to control it) and if there are several swaps

ongoing it may be time consuming. The other thing about the 9068 I am using is it has several programs (some possibly not required for this particular project) installed. I had resetted the 9068 but not formatted (which I would avoid to the last point) to free memory and make a fresh start (no change).

I have attempted to remove some of the for loops to decrease the computational load (even though the efffect may be small (probably I can try a larger change)) but it made no change as if there is a much bigger latency involved.

 

Engin

0 Kudos
Message 3 of 6
(3,553 Views)
Solution
Accepted by topic author tetego

Ok, so it sounds like you only have one execution thread then, is that accurate?

 

There are some compile flags that can significantly improve floating point performance on ARM. If you aren't already doing this, I recommend the following (from http://www.ni.com/tutorial/14625/en/#toc5)


(ARM-based targets) Complete the following steps to improve the performance of floating-point operations:
  1. Select Settings under C/C++ Build in the left pane of the Properties dialog box.
  2. Select Miscellaneous under Cross GCC Compiler in the Tool Settings tab.
  3. In the Other flags text box, add a space after the existing text, and then enter -mfpu=vfpv3 -mfloat-abi=softfp


 

 

 

 

0 Kudos
Message 4 of 6
(3,542 Views)

Thanks a lot Sebastian,

I have overlooked that part of the tutorial which cost me couple of days already. I will try this compiler setting and let you know the outcome as soon as possible (in my case tommorow since 9068 is in my office).

 

Engin

0 Kudos
Message 5 of 6
(3,529 Views)

Hi Sebastian,

It worked! The program now runs about 340ms on Crio 9068. Thanks again.

 

Engin

0 Kudos
Message 6 of 6
(3,497 Views)