07-11-2019 08:58 AM
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
07-15-2019 10:18 AM
Nobody used openmp ?
I add some infos :
I code with LabWindows/CVI 2015SP1.
The problem exists with TestStand 2010 SP1 and TestStand 2019.
Bruno
07-19-2019 02:13 AM
Up.
Could anyone test a simple example developed with cvi and called from TestStand ?
There is an openmp example in the cvi examples.
Bruno
08-02-2019 08:31 AM
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,
08-02-2019 09:59 AM
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
09-10-2019 06:28 AM
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