I'm implementing a simulated annealing algorithm in matlab using spmd. I will compare different implentation types. One of them is asynchronous paralellism. 12 workers will run the code. if one of them meets the criteria(error<0.01) code will stop the search. Is there any command to do that? If I use labBroadcast or labsend/labreceive it will be synchronus.
Matlab Spmd Termination
365 views Asked by sakkas At
2
There are 2 answers
0
Edric
On
Further to @Daniel's suggestion, in MATLAB releases R2013b and later, you can use parfeval to do this. Something like this:
% First, kick off the asynchronous work:
N = 12;
for idx = 1:N
f(idx) = parfeval(@myFcn, 1, args);
end
% Next, consume the results
for idx = 1:N
% fetchNext blocks until one of 'f' has completed,
% returning the index into 'f' that completed, as
% well as the result.
[idxInF, result] = fetchNext(f);
if result < 0.01
% we're done!
cancel(f); % Cancel all outstanding work
break; % stop looping and calling fetchNext
end
end
Related Questions in MATLAB
- How to open and read video stream in Matlab
- Interpolation and replace zeroes
- How can I fix my code to do line by line conditional statements in Matlab
- matlab crash during acquisition of pointgrey images
- Calling text file
- Apply gaussian filter on text
- re-plotting of data on same GUI axes in matlab
- Issue with nume1 in MATLAB
- Multiply two variables in Matlab with vpa - high precision
- ODE - Solving Parameter Dependent on Variable [Matlab]
- Need help in detecting multiple blobs
- How does TIC TOC in matlab work?
- Image based steganography that survives resizing?
- lowering computaional cost in finding the location of minimum distance
- FFT Filtering of signal
Related Questions in PARALLEL-PROCESSING
- Async vs Horizontal scaling
- Scattered indices in MPI
- How to perform parallel processes for different groups in a folder?
- Julia parallel programming - Making existing function available to all workers
- Running scala futures somewhat in parallel
- running a thread in parallel
- How to make DGEMM execute sequentially instead of in parallel in Matlab Mex Function
- Running time foreach package
- How to parallelize csh script with nested loop
- SSIS ETL parallel extraction from a AS400 file
- Fill an array with spmd in Matlab
- Distribute lines of code to workers
- Java 8 parallelStream for concurrent Database / REST call
- OutOfRangeException with Parallel.For
- R Nested Foreach Parallelization not Working
Related Questions in SIMULATED-ANNEALING
- How to efficiently select neighbour in 1-dimensional and n-dimensional space for Simulated Annealing
- Simulated Annealing for graph coloring
- Job shop scheduling using simulated annealing metaheuristic
- N queens problem using Simulated Annealing
- Allocating resources according to rules -- is simulated annealing appropriate?
- What is the time complexity of the Hill Climbing Algorithm?
- Annealing on a multi-layered neural network: XOR experiments
- Very large data sets to train a neural network using simulated annealing
- Solving sudoku with heuristics: a good idea?
- OutOfMemory issue with simulated annealing code
- Solve a MILP model with Simulated Annealing in Python
- Adding maximum group size to a simulated annealing algorithm without slowing down the process
- Adding simulated annealing to a simple hill climbing
- Netlogo simulated annealing
- Simulated Annealing - How to set up an appropriate neighbourhood configuration for a complex problem?
Related Questions in SPMD
- Error using parfor inside spmd block - matlab
- Using matlab's spmd to compute simple triple integral is giving me incorrect solution, any thoughts on what I am doing wrong?
- Discrete Difference on Sharded JAX Arrays
- Can I use mpiexec to run the same executable with different command line arguments for the executable each time?
- How do I index codistributed arrays in a spmd block
- Proceacmiento distributed images with matlab
- Sending data to workers
- Generate random numbers inside spmd in matlab
- Matlab: Shut down parallel pool - only working for parfeval() but not spmd
- Why is SPMD running time bigger than sequential - matlab
- JAX vmap vs pmap vs Python multiprocessing
- Asynchronous Parallel Computing in MATLAB?
- MatLab Parallel computing toolbox: using more cores for same task
- What is the reason behind parfeval's time overhead compared to a serial implementation?
- Matlab Spmd Termination
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I would start all 12 Processes using jobs. You can check if one of the already completed jobs matches your criteria, then cancel the other jobs.
http://www.mathworks.com/help/distcomp/cancel.html http://www.mathworks.com/help/distcomp/create-simple-independent-jobs.html