How to run matlab on a cluster with Ubuntu

15 Ansichten (letzte 30 Tage)
Pierrot10
Pierrot10 am 19 Jul. 2017
Hello, I am very new and I have to find a solution for tomorrow :o(...
I have 8 Ubuntu nodes. I create a share folder name /scratch. The /scratch folder is avaiable on all nodes.
I create a matlab script on my mac. The script resize high reslution image from a folder (named source)and move the resized images to another folder name target. The script works fine.
Then I scp the source and target folders and the resize_img.m script to /scratch/pierre/exercise/ of my first node. Matlab is installed in all of my node. Then I ssh my node and I cd to /scratch/pierre/exercise/. From there I run the following command
matlab -nodisplay -r redim_img
< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016b (9.1.0.441655) 64-bit (glnxa64)
September 7, 2016
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
Starting resizing High resolution images ...
Resizing BlueMarble.jpg
Resizing DSC00004.jpg
Resizing DSC00013.jpg
Resizing DSC00014.jpg
Resizing IMAG0063.jpg
Resizing IMAG0064.jpg
Resizing IMAG0065.jpg
Resizing IMAG0066.jpg
Resizing IMAG0067.jpg
Resizing IMAG0068.jpg
Resizing IMAG0069.jpg
Resizing IMAG0070.jpg
Resizing IMAG0071.jpg
Resizing IMAG0072.jpg
Resizing IMAG0073.jpg
Resizing IMAG0074.jpg
Resizing IMAG0075.jpg
Resizing IMAG0076.jpg
Resizing IMAG0077.jpg
Resizing IMG_0251.jpg
Resizing IMG_0252.jpg
Resizing IMG_0253.jpg
Resizing IMG_0254.jpg
Resizing IMG_0255.jpg
Resizing IMG_0256.jpg
Resizing IMG_0257.jpg
Resizing IMG_0259.jpg
Resizing IMG_0261.jpg
Resizing IMG_0262.jpg
Resizing IMG_0263.jpg
Resizing IMG_0264.jpg
Resizing IMG_0265.jpg
Resizing IMG_0266.jpg
Resizing IMG_0267.jpg
Resizing IMG_0269.jpg
Resizing PICT0417.jpg
Resizing PICT0418.jpg
Resizing PICT0421.jpg
Resizing paysage.jpg
Complete => Elapsed time: 11.5222ms
That fine, but now I would like to run the script to all of my nodes to see how long does take the script to resize the images with 1,2,4,6 nodes.
I am a novice and I absoluetly have no idea how to run my script in parallel computing.
Which command should I use to run the split the script on all nodes? Some one fo you can give a way to do my experience? Should I configure my node with a plugin?
FYI: OpenMPI is installed and I can use OpenMPI to run C++ script on all the nodes
many thank for your help

Antworten (1)

Sangeetha Jayaprakash
Sangeetha Jayaprakash am 24 Jul. 2017
In order to run MATLAB scripts in parallel you might need:
1. a Parallel Computing toolbox license - if its a desktop with 8 nodes or
2. MATLAB Distributed Computing Server license - if its a cluster

Community Treasure Hunt

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

Start Hunting!

Translated by