LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multithread blocking

Solved!
Go to solution

On a side note, wouldn't a parallel FOR loop be much better here? (no need for the STOP message, for example).

 

ParQueue.png

 

(Fully scales to the actual number of available cores. In my case (16 code xeon), the entire thing always completes in about 8ms automatically)

 

0 Kudos
Message 11 of 23
(896 Views)

@altenbach wrote:

On a side note, wouldn't a parallel FOR loop be much better here? (no need for the STOP message, for example).


If going that far, why even have the queue?  Autoindex the commands or maybe even just have 1 loop (not sure how i behaves as I have ~0 experience using a parallel FOR loop).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 23
(892 Views)

@crossrulz wrote:

@altenbach wrote:

On a side note, wouldn't a parallel FOR loop be much better here? (no need for the STOP message, for example).


If going that far, why even have the queue?  Autoindex the commands or maybe even just have 1 loop (not sure how i behaves as I have ~0 experience using a parallel FOR loop).


Yes, of course. I tried to keep it close to the original idea, because I don't know how much unparallelizable efforts it may take to fill the queue in the real application. The way I wrote it, only the dequeue operation is the critical section.

0 Kudos
Message 13 of 23
(890 Views)

crunch is a licensed application and I only have 3 licenses.  So I can only have upto 3 instances at any one time.  Hence the queue and 3 parallel loops.

Ian

0 Kudos
Message 14 of 23
(884 Views)

@macsmithAgain wrote:

crunch is a licensed application and I only have 3 licenses.  So I can only have upto 3 instances at any one time.  Hence the queue and 3 parallel loops.

Ian


Work to rule out Crunch as the culprit.

 

I would not be surprised if Crunch will inhibit more invocations once the limit is reached until all previous instances have exited.

 

Try getting rid of one of the licenses and see if the same behavior happens when only tow are running.

 

OR

 

Open four cmnd prompt windows and enter the command line for crunch and then quickly hit "enter" in each of the windows.

 

See if the forth hangs until the first three complete.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 23
(873 Views)

I still get the same behaviour when only two are running.

The actual runtimes range from 2 minutes to 50 minutes, so it's frustrating that it won't run another instance for 48 minutes, waiting on the others.

Ian

0 Kudos
Message 16 of 23
(868 Views)

@macsmithAgain wrote:

crunch is a licensed application and I only have 3 licenses.  So I can only have upto 3 instances at any one time.  Hence the queue and 3 parallel loops.

Ian


In this case you would configure the parallel FOR loop for 3 parallel instances. 😄

 

(Assuming you can find a way to run multiple instances in parallel, of course)

0 Kudos
Message 17 of 23
(867 Views)

What is the mechanism that keeps track of how many instances you are running versus how many licenses you have?  Is it a license server on this PC?  A license server on another PC acting as a server?  How does it report that you are trying to run one instance vs. two instances on the same PC?

 

I'm thinking if the application is requesting permission from the license server by sending an IP address or perhaps a process ID, that it is not allowing the 2nd and 3rd instances to run because it is seeing the same IP or process ID as the first one that is running.

 

Pure speculation.

0 Kudos
Message 18 of 23
(837 Views)

Hi Ravensfarn,

there's a license server which runs on the same machine as my vi.  When I'm running the vi, I have the license server gui open and can see realtime reports of licenses being issued and released.  In the scenario I posted, I can see three licenses being issued at the beginning, one being returned at 10 seconds, one being returned at 20 seconds and one being returned at 30 seconds followed immediately with the issue of 3 licenses.  So I don't think the licenses are causing the problem.

Ian

0 Kudos
Message 19 of 23
(818 Views)

@macsmithAgain wrote:

Hi Ravensfarn,

there's a license server which runs on the same machine as my vi.  When I'm running the vi, I have the license server gui open and can see realtime reports of licenses being issued and released.  In the scenario I posted, I can see three licenses being issued at the beginning, one being returned at 10 seconds, one being returned at 20 seconds and one being returned at 30 seconds followed immediately with the issue of 3 licenses.  So I don't think the licenses are causing the problem.

Ian


I think you described what I outlined in post #15 above with the server not giving out new until it has gathered all of the old.

 

Try using a .bat file and prior to invoking the command line, write a text file to get a time stamp of when the Sys exec starts running prior to invoking the crunch code.

 

I suspect the sys exec is running but the hang is waiting for the license.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 23
(778 Views)