11-01-2019 12:42 PM - edited 11-01-2019 12:53 PM
On a side note, wouldn't a parallel FOR loop be much better here? (no need for the STOP message, for example).
(Fully scales to the actual number of available cores. In my case (16 code xeon), the entire thing always completes in about 8ms automatically)
11-01-2019 12:49 PM
@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).
11-01-2019 12:58 PM
@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.
11-01-2019 01:04 PM
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
11-01-2019 01:16 PM - edited 11-01-2019 01:21 PM
@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
11-01-2019 01:20 PM
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
11-01-2019 01:21 PM - edited 11-01-2019 01:24 PM
@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)
11-01-2019 03:20 PM
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.
11-01-2019 05:45 PM
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
11-04-2019 07:55 AM
@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