Submit LSF command from matlab script
조회 수: 6 (최근 30일)
이전 댓글 표시
I want to subbmit LSF command from matlab:
command = 'bsub -q normal -G example sleep 100';
% Execute the command using system
[status, result] = system(command);
in the result i get command not found
댓글 수: 2
Damian Pietrus
2024년 3월 19일
Integrating MATLAB with LSF requires a support package which can be accessed here:
Is your MATLAB client (where you're submitting the command from) on the cluster or off-cluster?
답변 (1개)
Swastik Sarkar
2024년 8월 30일
편집: Swastik Sarkar
2024년 8월 30일
The "command not found" error likely results from a PATH issue. To diagnose this, verify the directory containing bsub by executing the following in a terminal where bsub is accessible:
which bsub
Next, check if this directory is included in the PATH variable of the MATLAB Client using:
getenv("PATH")
This is likely the cause of the error being encountered. Below is a demonstration of a similar error using the ls command:
system("ls -al")
system("which ls")
getenv("PATH") % You will notice that the above directory is present here.
setenv("PATH", "") % Setting to PATH to empty string to simulate a “No command found”
system("ls -al") % Command not found
This issue can be resolved by specifying the absolute path of bsub, thereby eliminating the dependency on the PATH variable. Below is an example using ls:
getenv("PATH") % Verifying PATH is empty
system("/usr/bin/ls -al")
A more official method to communicate with LSF is to use the Parallel Computing Toolbox plugin for LSF, as mentioned by @Damian Pietrus. This approach allows MATLAB to construct the necessary bsub command. The plugin can be found here:
Hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 GPU Computing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!