How can I get mpiprofile information from a parfor script?
2 views (last 30 days)
Show older comments
I have been unable to launch the parallel profiler outside of an spmd block, which prevents usage of parfor. I always get the same error when I try to turn on the profiler, both with and without a parallel pool running. Is there something obvious that I am missing, or is there something more nuanced about how mpiprofile is used?
>> mpiprofile on
Error using mpiprofile (line 162)
MPIPROFILE on must run in pmode or as part of a parallel job.
See doc for MPIPROFILE in the Parallel Computing Toolbox.
0 Comments
Answers (1)
Raymond Norris
on 8 Sep 2020
Hi John,
Prior to R2020a, you need to call mpiprofile within pmode or a parallel job, as shown in this example:
In R2020a, we began sunsetting pmode. With that we also allow for mpiprofile to be called either inside or outside of an spmd block, such as with this contrived example
p = parpool('local',4);
Starting parallel pool (parpool) using the 'local' profile ...
Connected to the parallel pool (number of workers: 4).
mpiprofile on
A = distributed.rand(400);
b = distributed.rand(400,1);
x = A\b;
mpiprofile off
mpiprofile viewer
Raymond
See Also
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!