Info

This question is closed. Reopen it to edit or answer.

Does the following .sh script qualify to be processed parallely?

1 view (last 30 days)
Hi there,
So I generated the compiled executable of a matlab script using -mcc command to be able to run the executable using unix environment so as to not query the matlab license server. I believe the executable doesn't require license requirements.
To see if what I am trying to do is along the right lines, I tried doing what I want to for a toy matlab script(Called sineplot). In the image attached, the script calls the mcc generated sineplot.sh thousand times. I am also passing two input arguments to the script which are as follows:-
1. Loop Count: Basically the matlab script loads a .mat file which contains a 1*1000 array. Depending on the loop count, a distinct value from the array is picked for different amplitude sine wave. That is why the loop count information is being passed.
2. File Name: To save the output of each count distinctly, I am passing a different file name.
Being fairly new to this, I have a question: If I submit this script to be run parallelly in different machines(using the LSF), will the different runs be all executed parallelly? Is the script potent enough to do that? Or something else needs to be done too.

Answers (1)

Raymond Norris
Raymond Norris on 16 Aug 2020
Hi,
Correct, an executable generated by MATLAB Compiler or MATLAB Coder will not require a license at runtime. You can simplify things a bit with a for loop
#!/bin/bash
echo "This scripts is about to call another"
for lc in {1..1000}
do
$HOME/run_sinplot.sh /apps/mathworks/matlab/R2018a $lc out${lc}.mat
done
echo "Another Script called"
Also, you could probably make things much simplier with an LSF job array.
Raymond

Community Treasure Hunt

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

Start Hunting!