multiprocessing Questions
1
I want to use multiprocessing module with sqlAlchemy in my custom class.
Here is the code:
from sqlalchemy import create_engine
engine = create_engine(f'mysql+pymysql://a:b@localhost:3306/', serv...
Pennyweight asked 20/9, 2019 at 6:33
1
Running two threads with the Multiprocessing library in Python, putting items into a queue in the daughter thread and getting them from the parents, hangs on the last item.
The question is why is t...
Penthouse asked 29/8 at 0:33
1
I got the error whenever I use the torch.multiprocessing.spawn to parallelize over multiple GPUs, including the code examples in Parallel and Distributed Training tutorials.
Exception: process 0 t...
Heti asked 13/8, 2020 at 9:59
3
consider the following server code :
from multiprocessing.managers import BaseManager, BaseProxy
def baz(aa) :
print "aaa"
l = []
for i in range(3) :
l.append(aa)
return l
class SolverMana...
Vida asked 17/5, 2011 at 10:30
5
Solved
I want to execute the following two functions at exactly the same time.
from multiprocessing import Process
import os
import datetime
def func_1(title):
now = datetime.datetime.now()
print "hel...
Metronymic asked 20/11, 2012 at 14:14
3
Solved
I am trying to migrate a bash script to Python.
The bash script runs multiple OS commands in parallel and then waits for them to finish before resuming, ie:
command1 &
command2 &
.
command...
Orometer asked 6/6, 2015 at 18:36
2
I have the following class that is shared between multiple consumers (using producer/consumer methodology). My question involves the methods called on this class. Do I need to implement locks or is...
Miosis asked 26/7, 2017 at 3:10
2
I want to parallelize a task (progresser()) for a range of input parameters (L). The progress of each task should be monitored by an individual progress bar in the terminal. I'm using the tqdm pack...
Estey asked 19/6, 2019 at 10:33
1
To identify the step that is using most of the computation time, I ran cProfile and got the following result:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.014 0.014 216.0...
Theadora asked 22/8, 2019 at 21:56
8
My question is how change this code so it will use only 4 sub-processes?
TESTS="a b c d e"
for f in $TESTS; do
t=$[ ( $RANDOM % 5 ) + 1 ]
sleep $t && echo $f $t &
done
wait...
Ison asked 28/6, 2011 at 19:13
3
I'm having this problem in python:
I have a queue of URLs that I need to check from time to time
if the queue is filled up, I need to process each item in the queue
Each item in the queue must be...
Knowling asked 21/6, 2013 at 18:7
3
Solved
I am trying to implement this tutorial on mutliprocessing in python, but when I tried to do my own task I get the following error:
Traceback (most recent call last):
>>> File "C:\Python27...
Dicky asked 28/9, 2013 at 19:4
0
I'm basically following the last code from this thread Is there any faster way for downloading multiple files from s3 to local folder?.
I adapted it to my problem which is extract files from s3 int...
Reest asked 4/4 at 14:38
4
Solved
I expect the following code to print [{0: 100}],
since it do the plus in updateList for a hundred time
In turn, it prints [{0: 0}]
what's the problem and how to rectify it?
from multiprocessing im...
Showpiece asked 25/10, 2014 at 12:19
13
Solved
Background:
I'm working a project which uses Django with a Postgres database. We're also using mod_wsgi in case that matters, since some of my web searches have made mention of it. On web form sub...
Palenque asked 23/11, 2011 at 13:18
6
I'm using Python 3.6 and am trying to follow along with the very first example at the website below (full code also below) and am getting the below error:
https://docs.python.org/3.6/library/multip...
Pereira asked 16/8, 2017 at 17:56
2
I have a python function that takes in a multiprocessing.Lock object as an input and uses the acquire and release functions on it. Evaluating it with mypy returns the error Function multiprocessing...
Ralston asked 20/12, 2021 at 15:50
4
Solved
I am very new to python and I encounter this error.
CODE 1 :
import multiprocessing as mp
import os
def calc(num1, num2):
global addi
def addi(num1, num2):
print(num1+num2)
m = mp.Process(tar...
Endodontics asked 27/6, 2022 at 1:53
2
Solved
I'm a go-newbie, so please be gentle.
So I've been using mutexes in some of my code for a couple weeks now. I understand the concept behind it: lock access to a certain resource, interact with it...
Shuttering asked 22/6, 2019 at 21:39
12
Solved
I found that in Python 3.4, there are few different libraries for multiprocessing/threading: multiprocessing vs threading vs asyncio.
But I don't know which one to use or is the "recommended o...
Minne asked 12/12, 2014 at 1:3
2
Solved
I am struggling to correctly parallelise a function using Cython. Basically, the problem is to bin some data. The actual code is a bit long, but in the end it does something like this:
def bin_var(...
Edmond asked 20/12, 2017 at 14:21
3
Solved
I'm doing a Django project and try to improve computing speed in backend.
The task is something like a CPU-bound conversion process
Here's my environment
Python 3.6.1
Django 1.10
PostgreSQL 9.6...
Catt asked 24/10, 2017 at 10:23
6
Solved
I have three large lists. First contains bitarrays (module bitarray 0.8.0) and the other two contain arrays of integers.
l1=[bitarray 1, bitarray 2, ... ,bitarray n]
l2=[array 1, array 2, ... , ar...
Sikhism asked 2/1, 2013 at 15:28
5
Solved
What are the fundamental differences between queues and pipes in Python's multiprocessing package?
In what scenarios should one choose one over the other? When is it advantageous to use Pipe()? Wh...
Breakaway asked 11/12, 2011 at 9:28
2
Solved
How do I pass a dictionary to a function with Python's Multiprocessing? The Documentation: https://docs.python.org/3.4/library/multiprocessing.html#reference says to pass a dictionary, but I keep g...
Patterson asked 12/8, 2016 at 1:54
1 Next >
© 2022 - 2024 — McMap. All rights reserved.