matlab parfor loops in unix

Hi everybody, i have a matlab script with parfor loop used. in my local personal PC, the script works in a parallel fashion. however, after i submitted it to unix, it seems the script runs in "for" loop (not in parallel way) as first of all, the time of run is even more than that in my personal PC. Can somebody help me with this? Thanks. Best, J.

9 commentaires

Rik
Rik le 16 Nov 2017
Are you getting any warning or error?
Looking at the documentation and the system requirements, I see no reason why parfor shouldn't work on a Unix system.
Adam
Adam le 16 Nov 2017
Does the computer running the Unix system have the Parallel Toolbox?
Code with a parfor that is run on a machine that does not have the Parallel Toolbox thankfully doesn't simply crash, but it does revert to just using a standard for loop.
Julie G
Julie G le 16 Nov 2017
Modifié(e) : Walter Roberson le 16 Nov 2017
@Rik Wisselink. no warnings or errors. I found something online but do not know whether it applies to my case. Can you help?
job = batch('blackjack_script_parfor', ... % Run the script containing parfor
'Profile', 'local', ... % using the 'local' profile
'Matlabpool', 5); % with a Matlabpool of size 5
% Wait for the job to complete execution.
wait(job);
% Load the results of executing the job into the MATLAB workspace
load(job);
Thanks. J.
Julie G
Julie G le 16 Nov 2017
Hi Adam. The "parfor" code runs well in my machine but not in unix.
Adam
Adam le 16 Nov 2017
So you have unix on the same machine? I don't use Matlab on Unix, but again, does it have the required parallel toolbox license in the Unix version?
On the unix machine, inside MATLAB do
ver('distcomp')
If it does not show Parallel Computing Toolbox in the output then the parallel computing toolbox is not installed.
If it is installed, there is still the possibility that you do not have a license for it:
license('test', 'Distrib_Computing_Toolbox')
will return 1 if there is a license for the parallel computing toolbox.
Julie G
Julie G le 17 Nov 2017
Hi Walter. i tested what you said and in the output file in Unix, it shows the following.
< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016b (9.1.0.441655) 64-bit (glnxa64)
September 7, 2016
For online documentation, see http://www.mathworks.com/support For product information, visit www.mathworks.com.
-------------------------------------------------------------------------------------------- MATLAB Version: 9.1.0.441655 (R2016b) MATLAB License Number: 980861 Operating System: Linux 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 Java Version: Java is not enabled -------------------------------------------------------------------------------------------- Parallel Computing Toolbox Version 6.9 (R2016b)
so i think i have the toolbox installed. or is it because Java not installed? Thanks.
J.
Walter Roberson
Walter Roberson le 17 Nov 2017
I know that at least some parts of the Parallel Computing Toolbox require java. I do not know if parfor is one of them.
Edric Ellis
Edric Ellis le 20 Nov 2017
To run in parallel, parfor does require Java to be enabled.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Question posée :

le 16 Nov 2017

Commenté :

le 20 Nov 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by