Issue with Eric7 and Parallel Processing

Detlev Offenbach detlev at die-offenbachs.de
Fri Nov 17 10:50:26 GMT 2023


Hi Jamie,

I hope you commented out the right line. That line appears twice in the 
file but only the one shown in the changeset must be commented 
out/deleted. That did the trick over here (at least on Linux). I'll have 
to re-test your script on Windows to see, if that makes a difference.

Furthermore, I would like you to post a screenshot of the 'Start 
Debugging' dialog.

Regards,
Detlev

Am 16.11.23 um 23:39 schrieb Jamie Riotto:
> Ok, so I have Eric7 loaded into a virtual environment, 
> 'eric7_qt6_venv', which has eric7-23.11(rev.e075C8fe07fd).
> I went to 
> c:\Users\jamie\eric7_qt6_venv\Lib\site-packages\eric7\Debugger\DebuggerInterfacePython.py 
> anc
> commented out the line:
>
> #self.__autoContinued.append(debuggerId)
>
> When I reran the script I submitted, I had the same behavior as 
> before, i.e. no change. Did I miss something?
> - j
>
> On Thu, Nov 16, 2023 at 10:28 AM Detlev Offenbach 
> <detlev at die-offenbachs.de> wrote:
>
>     Hi Jaimie,
>
>     it is actually a one line change. If you visit
>     https://hg.die-offenbachs.homelinux.org/eric/rev/1e498581a094 you
>     will see, which line needs to be removed.
>
>     Regards,
>     Detlev
>
>     Am 16.11.23 um 19:10 schrieb Jamie Riotto:
>>     Detlev,
>>     Excuse my ignorance, but I'm not sure how to obtain a changeset
>>     through mercurial. Is there an easy way?
>>     - j
>>
>>     On Thu, Nov 16, 2023 at 9:12 AM Detlev Offenbach
>>     <detlev at die-offenbachs.de> wrote:
>>
>>         Hi,
>>
>>         I just committed changeset 1e498581a094, which should fix the
>>         issue. Please give it a try and let me know. Otherwise, it
>>         will be contained in release 23.12 as is.
>>
>>         Regards, Detlev
>>
>>         Am 15.11.23 um 16:33 schrieb Jamie Riotto:
>>>         import multiprocessing
>>>         from time import time
>>>         import random
>>>
>>>
>>>         def parallelSim(job_queue, output_queue):
>>>             for data in iter(job_queue.get, 'STOP'):
>>>                 choices = random.choices(data, k=10)
>>>                 total = 0
>>>                 for i, c in enumerate(choices):
>>>                     sign = 1 if i%2==0 else -1
>>>                     total += c * c * sign
>>>
>>>                 output_queue.put(total)
>>>
>>>         if __name__ == '__main__':
>>>             start_time = time()
>>>
>>>             job_queue = multiprocessing.Queue()
>>>             output_queue = multiprocessing.Queue()
>>>
>>>             # create some data
>>>             data = list(range(1, 1000))
>>>
>>>             # DEBUG
>>>             #numCPUs = multiprocessing.cpu_count()
>>>             numCPUs = 4
>>>             iterations = 10
>>>             numjobs = numCPUs * iterations
>>>
>>>             # load up the job queue
>>>             for sim in range(numjobs):
>>>                 job_queue.put(data)
>>>
>>>             # add Stops to the job queue
>>>             for x in range(numCPUs):
>>>                 job_queue.put('STOP')
>>>
>>>             serialDebug = False
>>>             if serialDebug is True:
>>>                 # Debug the Parallel Process
>>>                 parallelSim(job_queue, output_queue)
>>>
>>>             else:
>>>                 # parallelize processing using a pool of processes
>>>                 for i in range(numCPUs):
>>>         multiprocessing.Process(target=parallelSim, args=(job_queue,
>>>         output_queue)).start()
>>>
>>>             results = []
>>>             for r in range(numjobs):
>>>                 results.append(output_queue.get())
>>>
>>>             avg_result = sum(results) / numjobs
>>>             print("")
>>>             print(f'Average Results = {avg_result}')
>>>
>>>             end_time = time()
>>>             elapsed = end_time - start_time
>>>             print(f"Finished in: {elapsed:.3f} seconds")
>>
>>         -- 
>>         Detlev Offenbach
>>         detlev at die-offenbachs.de
>>
>     -- 
>     Detlev Offenbach
>     detlev at die-offenbachs.de
>
-- 
Detlev Offenbach
detlev at die-offenbachs.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/eric/attachments/20231117/5f4eb3de/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xBD1F26A5DA8A6150.asc
Type: application/pgp-keys
Size: 660 bytes
Desc: OpenPGP public key
URL: <https://www.riverbankcomputing.com/pipermail/eric/attachments/20231117/5f4eb3de/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://www.riverbankcomputing.com/pipermail/eric/attachments/20231117/5f4eb3de/attachment-0001.sig>


More information about the Eric mailing list