Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
YOGENDRA SINGH BHANDARI
YOGENDRA SINGH BHANDARI 2020년 8월 15일
마감: MATLAB Answer Bot 2021년 8월 20일
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.

답변 (1개)

Raymond Norris
Raymond Norris 2020년 8월 16일
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!

Translated by