{"id":1048,"date":"2021-08-19T15:35:36","date_gmt":"2021-08-19T13:35:36","guid":{"rendered":"http:\/\/cdc.cyu.fr\/?page_id=1048"},"modified":"2025-01-17T15:26:41","modified_gmt":"2025-01-17T14:26:41","slug":"job-script-matlab","status":"publish","type":"page","link":"https:\/\/cdc.cyu.fr\/index.php\/documentations-main\/job-script-matlab\/","title":{"rendered":"Script de job Matlab"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Tapez <code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">lmstat<\/code> pour connaitre le nombre et l&rsquo;utilisation des jetons de licence.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Job utilisant un jeton<\/h2>\n\n\n\n<p>R\u00e9servation d&rsquo;un job s\u00e9quentiel utilisant 1 Go de RAM et 1 jeton de licence Matlab.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#$ -N job-jeton\n#$ -q seq_medium\n#$ -l m_mem_free=1G\n#$ -m esa\n#$ -M prenom.nom@u-cergy.fr\n#$ -cwd\n#$ -j y\n## Demande de jeton matlab \n#$ -soft\n#$ -l matlab=1\nmodule load matlab\nmatlab -nodesktop -nosplash -batch program.m\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Job utilisant une toolbox<\/h2>\n\n\n\n<p>R\u00e9servation d&rsquo;un job parall\u00e8le 4 coeurs utilisant 2 Go de RAM (4 * 500 Mo), 1 jeton de licence Matlab et un jeton de licence pour la toolbox \u00ab\u00a0Image\u00a0\u00bb.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#$ -N job-jeton\n#$ -pe openmp 4\n#$ -l m_mem_free=500M\n#$ -m esa\n#$ -M prenom.nom@u-cergy.fr\n#$ -cwd\n#$ -j y\n## Demande de jetons matlab et toolbox\n#$ -soft\n#$ -l matlab=1\n#$ -l image_tbx=1\nmodule load matlab\nmatlab -nodesktop -nosplash -batch parallel-program.m\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Job compil\u00e9 sans jeton<\/h2>\n\n\n\n<p>En compilant son programme matlab il est possible de se passer de jeton de licence. Il est alors possible de lancer beaucoup d&rsquo;instances de ce programme en m\u00eame temps (voir aussi <a href=\"https:\/\/cdc.cyu.fr\/index.php\/supports-main\/job-script-array\/\" data-type=\"page\" data-id=\"1041\">job array<\/a>).<\/p>\n\n\n\n<p>Exemple de fichier makefile permettant de compiler un programme matlab :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dockerfile\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SRC = my_program.m  dependancy1.m  dependancy2.m  path\/to\/dependancy3.m\nCOMP = mcc\nFLAGS = -mv\nall : my_program\nmy_program : $(SRC)\n    $(COMP) $(FLAGS) $(SRC)  # !!! tabulation\nclean :\n    \\rm my_program run_my_program.sh  # !!! tabulation<\/pre>\n\n\n\n<p>Exemple de script de job pour un programme matlab compil\u00e9<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#$ -N my_program\n## Job s\u00e9quentiel\n#$ -q seq_long\n#$ -l m_mem_free=1G\n#$ -m esa\n#$ -M prenom.nom@u-cergy.fr\n#$ -cwd\n#$ -j y\n## Pas de demande de jeton ni de chargement de module\n.\/run_my_program.sh \/usr\/local\/matlab<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tapez lmstat pour connaitre le nombre et l&rsquo;utilisation des jetons de licence. Job utilisant un jeton R\u00e9servation d&rsquo;un job s\u00e9quentiel utilisant 1 Go de RAM et 1 jeton de licence Matlab. Job utilisant une toolbox R\u00e9servation d&rsquo;un job parall\u00e8le 4 &hellip; <a href=\"https:\/\/cdc.cyu.fr\/index.php\/documentations-main\/job-script-matlab\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":124,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1048","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/pages\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1048"}],"version-history":[{"count":4,"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/pages\/1048\/revisions"}],"predecessor-version":[{"id":1853,"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/pages\/1048\/revisions\/1853"}],"up":[{"embeddable":true,"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/pages\/124"}],"wp:attachment":[{"href":"https:\/\/cdc.cyu.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}