To use matlab on the cluster, the first problem we have to solve is to compile the matlab code into a standalone application. Because it not only speeds up the computation time but also is not limited by the restriction of maximum licenses for the matlab software we can use at the same time.
To compile the matlab, we have to configure the environment at the beginning. The command is
module add mcc
This command sets the lib path for matlab standalone executable. Without this setting, you may get the error saying that some shared library is missing. Next, we call
mcc -m -v main.m -a \sourcecode\
which not only compiles your main matlab codes but also the codes in the folder and subfolder of sourcecode.
Now we can talk about how to submit the executable file to clusters.
1 条评论:
to include all the files that will be used, put the files in the directory ./libraries, then
mcc -m -v main.m -a ./libraries
发表评论