Answered
How does an active parpool influence serial / threaded mex computation? (runtime/memory)
Simply: an idle parpool should be doing nothing very much other than sitting there consuming some memory. It should consume only...

2 years ago | 1

| accepted

Answered
Separating subtables from a larger table by using the variable values in a column
Rather than looping, you might be able to use findgroups and splitapply to do what you need. Imagine you wish to compute the max...

2 years ago | 1

| accepted

Answered
Shared memory in parfor genetic algorithm
If you're using R2022a or later, you could use ValueStore to allow workers to share values. The main requirement here is for you...

2 years ago | 1

| accepted

Answered
How to input global variables in function that is in parloop?
Another option is to use parallel.pool.Constant to arrange for the data to be loaded and then accessed. This can be a bit simple...

2 years ago | 1

Answered
How to change the parameter in Mask and run the simulation parallel
Given a simple model like this which has a mask with a parameter named gain_val You need to do something like this: mdl = 'm...

2 years ago | 1

Answered
Setting up parallel computations for a single dataset, as opposed to spmd
This is precisely the sort of thing that parallel.pool.Constant was designed for. You build a Constant once on the client, the d...

2 years ago | 0

| accepted

Answered
How to work with nested containers.Map()s inside a parfor loop
containers.Map instances are MATLAB handle objects. These get copied to the workers, and so when you try to modify them on the w...

2 years ago | 1

Answered
unable to classify the variable 'F' in the body of the parfor-loop
This use of F creates an order depdency between loop iterations. (You're modifying F on each loop iteration). I'm not entirely s...

3 years ago | 0

| accepted

Answered
How to repeat/continue iteration of a parfor loop without incrementing the loop counter untill condition is satisfied
It's not entirely clear how your "do something" chooses what to do. I think we need to see a little more detail there. Setting t...

3 years ago | 0

| accepted

Answered
Parallel Toolbox to write many Excel files: How to assign specific job to Workers?
The function xlswrite is no longer recommended, and you should use writematrix instead. The problem you're seeing is because sev...

3 years ago | 2

| accepted

Answered
How to create data file and copying data on it for parallel programing in MATLAB?
You are quite right that trying to write to the same file from multiple workers will cause problems. Here's one way that you cou...

3 years ago | 1

Answered
How do you remove rows from tall arrays?
As the error message states, the only way to remove specific rows from a tall array is with a logical vector. In other words, th...

3 years ago | 1

| accepted

Answered
"parameter {0} must be a real scalar" error when using parfor
I think you need to use createConnectionForPool to make your database connection object and have it work correctly inside your p...

3 years ago | 3

| accepted

Answered
How to let a lab tell if another lab is idle or not in a spmd block at that time : isidle(labindex)
I can think of a few ways around this: As you suggest, labProbe can tell you if there's an incoming message ready to be receive...

3 years ago | 1

Answered
When I use parfor in the program, the program seems to fall into an endless loop in the remoteparfor.m file, resulting in the program's delay in output.What's going on?
The file "remoteparfor.m" is part of the implementation of a parfor loop. The main job of this piece of code is to wait for resu...

3 years ago | 0

Answered
reproducible and independent random stream generation in parfor loop
This topic is covered here in the documentation. You should not mix setting 'Seed' with setting 'Substream'. (The 'Seed' value s...

3 years ago | 2

| accepted

Answered
Running parfor loop in R2013a
Yes, Parallel Computing Toolbox was available for R2013a. Yes, in R2013a, you need to explicitly create the parallel pool using ...

3 years ago | 0

| accepted

Answered
parfor for movie writeVideo
The problem is that you're trying to send a VideoWriter object to the workers, and that's not allowed. A secondary problem is th...

3 years ago | 0

Answered
Dramatic but intermittent slow down of parallel system calls
This sort of sporadic slowness can be extremely hard to track down. I'm not an expert on how MATLAB manages system calls, but I'...

3 years ago | 0

| accepted

Answered
Access composite variables after parallelpool shutdown
Unfortunately there is not. The contents of Composite (and distributed arrays) are always left on the workers until you explicit...

3 years ago | 0

| accepted

Answered
Multiple Parallel Jobs on Server
You say that "main.m" script uses 4 cores to do parallel computing. I presume this means that it contains a parfor loop. One way...

3 years ago | 0

Answered
parfor treats variable as function
This is a limitation of parfor. The documentation here describes the principle reason, but doesn't quite show an example exactly...

3 years ago | 1

Answered
How can I make more efficient use of parallel workers?
A couple of suggestions: you could consider using DataQueue rather than writing files to track progress on the workers. Yes, it ...

3 years ago | 0

| accepted

Answered
Passing composite variable to mex file
Unfortunately, there is no way to access the elements of a Composite from a MEX file. Is there any way you could run the MEX fil...

3 years ago | 0

| accepted

Answered
Move from parfor to parfeval?
To run using parfeval, you basically need to pull out the body of your parfor loop into a function, something like this: cellli...

3 years ago | 0

| accepted

Answered
Force CPU Parallel pool
There's no direct way to specify this using trainingOptions, but what you can do is disable the GPUs on the workers by running t...

3 years ago | 0

Answered
How to use libpointer inside parfor loop?
I think you should be able to do this using parallel.pool.Constant. I think you might need 2 of them in fact - one to manage the...

3 years ago | 0

Answered
Parfeval, Backgroundpool and Webread
Unfortunately, as you suspect, right now the only way to do this is to use a process pool via parpool('local') or similar.

3 years ago | 0

| accepted

Answered
How to specify GPU devices for parallel computing using "parfor"?
The documentation here describes how you might do this in general. Things get a little more complicated if you want to run more ...

3 years ago | 1

| accepted

Answered
pass Python object as argument to function in "parfeval"
One of the limitations of the MATLAB->Python support is that Python objects cannot be serialized. parfeval (and other parallel c...

3 years ago | 0

| accepted

Load more