Skip to content

Multithreading in Python#171

Merged
baffelli merged 65 commits intomainfrom
new-material/parallelism-1
Dec 13, 2023
Merged

Multithreading in Python#171
baffelli merged 65 commits intomainfrom
new-material/parallelism-1

Conversation

@baffelli
Copy link
Member

Closes #10

baffelli and others added 26 commits November 6, 2023 17:13
…-it/python-tutorial into new-material/parallelism
…-it/python-tutorial into new-material/parallelism
…-it/python-tutorial into new-material/parallelism
…-it/python-tutorial into new-material/parallelism
@baffelli baffelli requested a review from despadam December 11, 2023 15:06
@baffelli baffelli self-assigned this Dec 11, 2023
@baffelli baffelli changed the title New material/parallelism 1 Mutlithreading in python Dec 11, 2023
@yakutovicha
Copy link
Member

I set the PR "ready for review" since in fact it has been reviewed.

@yakutovicha yakutovicha marked this pull request as ready for review December 12, 2023 09:04
@baffelli
Copy link
Member Author

I set the PR "ready for review" since in fact it has been reviewed.

Wait, there are a couple of things that should be fixed still. Some of the problems with running the code that @despadam had should be investigated.

@yakutovicha
Copy link
Member

Wait, there are a couple of things that should be fixed still. Some of the problems with running the code that @despadam had should be investigated.

But "Ready for review" means only that it is ready for review, nothing more than that. We merge things only when they are approved.

@despadam
Copy link
Contributor

Yes, just reviewing for now. Not merging yet, but it shouldn't be a draft anymore.

Copy link
Contributor

@despadam despadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small typo in the Quiz

Co-authored-by: Despina Adamopoulou <16343312+despadam@users.noreply.github.com>
@despadam
Copy link
Contributor

For me the examples in the section High-level interface: Process pools cannot run. I get the following error in the console:

Process SpawnPoolWorker-1: Traceback (most recent call last): File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\pool.py", line 114, in worker task = get() File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\queues.py", line 367, in get return _ForkingPickler.loads(res) AttributeError: Can't get attribute 'task' on <module '__main__' (built-in)> Process SpawnPoolWorker-3: Traceback (most recent call last): File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\pool.py", line 114, in worker task = get() File "C:\Users\adde\AppData\Local\miniconda3\envs\python-tutorial\lib\multiprocessing\queues.py", line 367, in get return _ForkingPickler.loads(res) AttributeError: Can't get attribute 'task' on <module '__main__' (built-in)>

despadam
despadam previously approved these changes Dec 12, 2023
@despadam
Copy link
Contributor

As agreed with @baffelli, it is best to merge and see if the examples and exercises will work on Binder, as this is the most pressing matter. It appears that the errors as OS dependent, so let's make sure that it will work online and then we can discourage the participants from running the tutorial locally, for this section at least.

@baffelli
Copy link
Member Author

Let's try it here

@edoardob90
Copy link
Member

Binder is unfortunately down now, and the error @despadam mentioned happens on my two machines as well. Not sure what we can do.

@baffelli
Copy link
Member Author

Binder is unfortunately down now, and the error @despadam mentioned happens on my two machines as well. Not sure what we can do.

That's really unfortunate. It seems to be highly OS dependent or maybe it's just a special case that runs on VSCode with the Jupiter extension. It might be that they implement a different Ipython kernel. I hope it works on Binder tomorrow, if not I'll try to walk people through examples in order to fill at least 1.5 hours

@edoardob90
Copy link
Member

Minor changes to the text. Still, I cannot make the notebook work with any Python version I tested. I'm sure I'm missing something in the setup, but for me the entire notebook is in a "broken" state.

@edoardob90 edoardob90 changed the title Mutlithreading in python Multithreading in Python Dec 12, 2023
yakutovicha and others added 4 commits December 12, 2023 23:52
Applied sugestions on text

Co-authored-by: Edoardo Baldi <edoardo.baldi@empa.ch>
* Make notebook work.

* Added warning on different modules.

---------

Co-authored-by: Simone Baffelli <simone.baffelli@empa.ch>
Copy link
Contributor

@despadam despadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fingers crossed

@baffelli baffelli merged commit cafd088 into main Dec 13, 2023
@baffelli baffelli deleted the new-material/parallelism-1 branch December 13, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multithreading in Python

4 participants