Questions tagged [multiprocessing]
Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system.
97 questions
4
votes
1
answer
57
views
Consuming each Kafka partition in a separate proccess
I'm reimplementing functionality originally written in Kotlin. It uses Dispatchers.Default which is recommended for CPU-intensive tasks like JSON parsing to start ...
1
vote
0
answers
56
views
Bi-Directional A* function in MATLAB
I am currently working on my thesis for 3D path planning involving external elements, and I have completed about 1/5 of the total trials that I am doing. For each 1/5 of the trials I am increasing the ...
3
votes
1
answer
88
views
Designing Multiprocess signaling and communication
Originally I meant to discuss my entire project on stepper motors for Raspberry Pi. But I see that's out of scope. If you'd like to provide high level feedback, welcome to do so in github.
The lack of ...
1
vote
2
answers
66
views
bucketsort with multiprocessing
I want to compare the procedure time for each number of process. I made 5000000 numbers in input.txt in random order. I read it and do bucket sorting with ...
2
votes
0
answers
172
views
0
votes
0
answers
91
views
Multiple classes getting the output of a parallel process performing heavy computations
I have a python script with different classes performing various tasks. There is one class that performs heavy computations that are needed by other classes. I am using multiprocessing in order to do ...
4
votes
2
answers
2k
views
Multi-threading Class in C++
I wrote a C++ class which can take a vector of functions and their respective arguments and execute them in parallel and return a vector of results from its respective functions.
...
2
votes
2
answers
546
views
Code for asynchronous data stream processing with multistage pipelines
I am trying to write some code for processing streams of asynchronous data from multiple sources (Producer Nodes), process them ...
0
votes
1
answer
150
views
Training a Reinforcement Learning algorithm
Problem:
I'm trying to reduce the computation time and optimize specific functions of a Reinforcement Learning algorithm in the training phase and observed that one block of code takes too much ...
4
votes
1
answer
300
views
Polyominoes generator
This is my first Python program. It is not very user friendly, but it works. I used some code snippets and tricks I found in various places. And generous people at Stack Overflow helped me with ...
4
votes
1
answer
557
views
Prime factorization algorithm by using the multiprocessing module of Python
I may introduce a Python code of prime factorization which is from my personal project that I'm working on.
...
1
vote
0
answers
54
views
Process to continuously delete resources
I have created a function that creates a multiprocessing.Process to continuously delete "resources" (instances from a certain class) from my application. When I kill one of these resources, ...
1
vote
1
answer
141
views
Timeit multithreading/multiprocessing C++
Given a Timeit method which runs for n times the provided function, which approach between multithreading and multiprocessing should be better to speed up the execution of all iterations and avoid the ...
0
votes
1
answer
61
views
streaming / low memory groupby in julia
I am working on a groupby-aggregation function that will work without RAM overflow issues. Essentially, I want it to run as fast as possible, while not necessarily loading the entire data structure ...
0
votes
1
answer
52
views
Treat a list by generating a dataframe and sending the data to function via multiprocessing
To collect the list with the data from an API, I need to do these steps:
...
2
votes
0
answers
30
views
Brand generator script using multiprocessing
I have two indices in Elasticsearch which are brands, and categories, and I have a very ...
1
vote
0
answers
676
views
TCP socket management using multiprocessing
I wrote a Python code for a device that generates an hotspot and communicates with an app using a TCP socket. The communication is managed by a process that opens a socket and uses two threads to send ...
1
vote
1
answer
130
views
Efficient way to build random undirected graphs without self loops given total number of graph nodes and associated node degree
I wrote an algorithm to build 1000 different random graphs given number of nodes and node degree. Node degree is maintained between the random graphs. I am building these random graphs to input to a ...
2
votes
1
answer
516
views
My code creates a soundboard that can assign a sound to a key on a keyboard while listening to keyboard strokes in parallel
My code works but I am looking for an efficient way to implement the idea with out having to repeat the same code block inside the function Recin() (record Input function is stated in the code) in ...
0
votes
1
answer
69
views
Showcase difference multiprocessing and threading in Python
This week I dived into the issue of speeding up my program by either threading or multiprocessing. I did not understand well the difference between the two, but that became quite clear when I got the ...
2
votes
1
answer
123
views
Multithread or multiprocess [closed]
This is my code:
...
3
votes
0
answers
51
views
Nearest neighbor search algorithm of quantization
I'm doing some research on Nearest Neighbor Search of quantization, where running speed is very important. As I've just started using Python, I wonder if the following code for multi-processes can be ...
4
votes
0
answers
464
views
Subclass of Python's multiprocessing.Pool which allows progress reporting
For context, the whole of the project code can be found here. This question was created specifically for the progress.py file.
The goal behind it is to allow ...
2
votes
1
answer
313
views
Multi-core OpenCV denoising
I have ~40,000 JPEG images from the Kaggle melanoma classification competition. I created the following functions to denoise the images:
...
4
votes
0
answers
1k
views
PyQt load images in background process
I am building an application that needs to load 100-200 images (really only limited by performance) and display them to the user in a sort of gallery. A good analogy would simply be Google Images. In ...
3
votes
1
answer
261
views
benchmarking requests to localhost
I am writing a benchmarking tool from scratch in Python.
However I can't get the performance of other benchmarking tools like wrk or ...
6
votes
1
answer
6k
views
Compute the outputs of a generator in parallel
I am processing an unknown "length" of generator object.
I have to keep things "lazy" because of memory management.
The processing is compute heavy, so writing it multiproc style ...
1
vote
0
answers
142
views
Python/Mongo - Generating dummy data
I wrote below piece of code generating dummy data loaded to MongoDB.
2 issues :
1.customer class has subscriber class so it nested with one level customer--> subsciber.
I think i'm not doing right:
...
2
votes
0
answers
836
views
Assigning parallel workers to predict from keras model using concurrent.futures
I am working on a Reinforcement learning project, where I have to gather a lot of data using a TensorFlow model. During the data gathering, the weights of the model do not change. So, I am using ...
2
votes
1
answer
52
views
Hardware driven data processing and ploting in need of better control flow
This is code for a measurement setup that receives a steady stream of UDP data, finds the trigger in one channel and operates on the data in the other channel to enhance the signal and remove noise, ...
2
votes
0
answers
22
views
Implementation of Policy Gradient Reward Design paper
I've implemented the first experiment from the Reward Design via Online Gradient Ascent paper. I don't have any specific concerns, but it's my first time using multiprocessing or doing reinforcement ...
-4
votes
1
answer
341
views
How can I reduce the TIme Complexity. of the python program
I have 7000 CSV files that I want to do operation on. but the problem is that it takes to much time like it takes 13 seconds to process these files.
What I need to know is which operation take more ...
3
votes
1
answer
5k
views
python flask spawn jobs with multiprocessing
I have a python flask app that waits for requests from user app and than spawns a process with job based on the request it receives.
It keeps the status and queue of the jobs in memory.
The requests ...
5
votes
3
answers
176
views
Analysing a Huge Codebase with Python
I've written a Python program to analyse a huge C++ code base in excess of millions of lines of code. The job of the program is simply to search for all C and C++ style comments and extract all the ...
3
votes
1
answer
140
views
Divide and Conquer Password Bruteforcer
My program brute-forces a password. The password is a string composed of a key and a four digit numeric code. The key is known so we are basically brute-forcing between 0000 through to 9999
An example ...
4
votes
2
answers
417
views
Class with multiple workers
I am building a tool that interacts with a batched stream of incoming data. This data needs to be processed and the result returned. To split up the work I have created a class that has inbound (...
1
vote
1
answer
126
views
Parallel image segmentation [closed]
Follow up question Image processing using Python OOP library
I want to use multiprocessing to analyze several images in parallel:
...
-2
votes
1
answer
194
views
Python code refactor to use multiprocessing [closed]
I have written some Python code that opens files one by one, does some work, and writes data onto the filesystem. I figured, I want to make use of my cores.I've refactored the program into this.
<...
2
votes
1
answer
28
views
Join ArcGIS tables in Python of plant greenness in response to prior month's rainfall
I am using Python 3.8 with ArcGIS Pro 2.5. This code creates a joined table where I match values for plant greenness in the current month with rainfall X number of months into the past. Each loop ...
3
votes
1
answer
110
views
Data segmentation and optimization for Multi-threaded/Multi-core use (In Python)
I have written a very basic algorithm, that counts the amount of times sub-string appears in a string.
The algorithm is given:
seq - a string sequence
k - length of a sub-string
L - a window of a ...
3
votes
0
answers
78
views
Monitored parallel mapping across a Pandas dataframe
This code maps a function over a dataset in parallel in a monitored fashion, and returns the result in the variable out.
...
5
votes
1
answer
96
views
Create 1% Sample Using Multiprocessing in Python
I'm trying to process a large dataset (300GB, myfile.txt in the script) line by line using multiprocessing. I want to define a 1% random sample based one variable (contained in unique_ids_final.txt). ...
3
votes
1
answer
101
views
Plot timings for a range of inputs MkII
To celebrate questions getting more reputation points per upvote, I revisited my previous question, Plot timings for a range of inputs.
Since the time of that original question (more than two years!),...
3
votes
2
answers
2k
views
hash image url and if valid store image url
I am trying to get all image urls which are valid and unique.To make sure i wont end up using the same image again i calculate hash of the image and store it in a text file and read the text file ...
5
votes
1
answer
205
views
Gamblers ruin, parallel compute trials
Context
The following script is a quick implementation of the gambler's ruin problem. For each given upper bound on the number of rounds in a game max_iter, ...
3
votes
1
answer
58
views
Monitor a web page for when a desired price is met
I have a code that keeps checking a webpage with a price on it and when the price meets a number I set it to, the thing is purchased. I am looking for ways to increase the speed of it.
I have added ...
3
votes
1
answer
576
views
Simple sharding of delimited files to more sophisticated
A while back I came across the issue of having a large delimited file where I wanted to simply parallelize my python code across each line of the file. However, doing so all at once either took up too ...
11
votes
2
answers
909
views
Parallelized for loop in Bash
I am using a Bash script to execute a Python script multiple times. In order to speed up the execution, I would like to execute these (independent) processes in parallel. The code below does so:
<...
1
vote
0
answers
981
views
First readers-writers problem using a single condition
For the first readers-writers problem, in which readers can access a given resource simultaneously, is the following Python3 solution correct?
Problem parameters:
One set of data is shared among a ...
2
votes
0
answers
1k
views
Image processing using multiprocessing in Python
I have an image stack. I am trying to use multiprocessing to do some process on each image in stack to get new image, and then bitwise_or with the old image.
Since ...