NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI module using openmp

Hi,

I'm trying to use openmp in a cvi dll.

If the dll is called from TestStand (CVI adapter), the function works but when I want to quit TestStand, TestStand hangs.

If the dll is called from a cvi project (executable), there is no problem (executable worked fine and ended well).

 

Did anyone use openmp in a CVI module called from Teststand ?

 

Bruno

 

 

0 Kudos
Message 1 of 6
(2,346 Views)

Nobody used openmp ?

 

I add some infos :

I code with LabWindows/CVI 2015SP1.

The problem exists with TestStand 2010 SP1 and TestStand 2019.

 

Bruno

0 Kudos
Message 2 of 6
(2,314 Views)

Up.

 

Could anyone test a simple example developed with cvi and called from TestStand ?

There is an openmp example in the cvi examples.

 

Bruno

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

Hello Bruno_p,

 

It seems like that a thread is still running when you try to shutdown TestStand.

Is the problem reproducible with the CVI examples you spoke about ?

 

Could you give us more informations about how to reproduce it with these example ?

 

Maybe you should try to configure the step with Unload after sequence executes in the Unload Option field.

 

Regards,

 

 

 

 

0 Kudos
Message 4 of 6
(2,251 Views)

Hello Salah_I,

 

You're maybe right : a thread is probably still running.

 

With the options "Unload after sequence executes" TestStand crashes at the end of the sequence execution.

So the unload action seems to be the cause of the crash.

 

I tried a very simple example :

void DLLEXPORT __stdcall tryOpenmp ()
{
    #pragma omp parallel
    {
        int ID = omp_get_thread_num();
    }
}

The function does...nothing, but use openmp to get the thread ID.

In the original example the function print "hello world" with the thread id.

With my computer this example creates 8 threads.

 

I tried this function in a cvi executable and it works like a charm.

 

Thanks for your help

Bruno

0 Kudos
Message 5 of 6
(2,237 Views)

Hello,

 

Anybody could test it ?

1. Create a dll with the code above.

2. Test the dll with a cvi executable => no problem

3. Test the dll with TestStand => crash when the dll is unloaded

 

Regards,

Bruno

0 Kudos
Message 6 of 6
(2,187 Views)