| 1 | Pleiades only has about 15 MATLAB licenses on the cluster and does not allow to run MATLAB on batch jobs (submitted through qsub). The alternative is to compile your MATLAB functions for deployment using mcc (https://www.mathworks.com/help/compiler/mcc.html) |
| 2 | |
| 3 | == Precompile your MATLAB code == |
| 4 | |
| 5 | {{{#!matlab |
| 6 | %Get dependencies |
| 7 | files = matlab.codetools.requiredFilesAndProducts(filename); |
| 8 | |
| 9 | %Creaste long string |
| 10 | deps = []; |
| 11 | for i=1:numel(files) |
| 12 | deps = [deps ' ' files{i}]; |
| 13 | end |
| 14 | |
| 15 | %Create command |
| 16 | command = ['mcc -m ' filename deps ' -o testMCC'] |
| 17 | |
| 18 | %Create executable |
| 19 | system(command); |
| 20 | }}} |
| 21 | |
| 22 | Potential Problems: |
| 23 | * mcc needs to see all the m files and will not be able to interpret a new m file created on the fly (like we do with ``parameterize``) |
| 24 | * other issues? |
| 25 | |
| 26 | == Submit a job == |
| 27 | |
| 28 | Make sure to change .... |
| 29 | {{{#!sh |
| 30 | #PBS -S /bin/bash |
| 31 | #PBS -l select=1:ncpus=28:model=bro |
| 32 | #PBS -l walltime=100 |
| 33 | #PBS -q devel |
| 34 | #PBS -W group_list=s1690 |
| 35 | #PBS -m e |
| 36 | #PBS -o /home1/mmorligh/issm/trunk-jpl/test/NightlyRun/run.outlog |
| 37 | #PBS -e /home1/mmorligh/issm/trunk-jpl/test/NightlyRun/run.errlog |
| 38 | |
| 39 | . /usr/share/modules/init/bash |
| 40 | |
| 41 | #load modules |
| 42 | module load comp-intel/2016.2.181 |
| 43 | module load mpi-sgi/mpt |
| 44 | module load matlab |
| 45 | |
| 46 | #Export some variables |
| 47 | export PATH="$PATH:." |
| 48 | export MPI_LAUNCH_TIMEOUT=520 |
| 49 | export MPI_GROUP_MAX=64 |
| 50 | |
| 51 | #ISSM stuff |
| 52 | export ISSM_DIR="/u/mmorligh/issm/trunk-jpl/" |
| 53 | source $ISSM_DIR/etc/environment.sh |
| 54 | |
| 55 | #move and start simulation |
| 56 | cd /home1/mmorligh/issm/trunk-jpl/test/NightlyRun |
| 57 | |
| 58 | ##OPTION 1 |
| 59 | #/u/scicon/tools/bin/check_licenses -m |
| 60 | #matlab -r "addpath $ISSM_DIR/src/m/dev; temp; devpath; exit" > TEMP |
| 61 | |
| 62 | #OPTION2 |
| 63 | ./run_testMCC.sh $ISSM_DIR/lib:$ISSM_DIR/externalpackages/gsl/install/lib:$ISSM_DIR/externalpackages/petsc/install/lib:/nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/:/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/:/nasa/sgi/mpt/2.15r20/lib:/nasa/matlab/2017b |
| 64 | }}} |