Calling Gurobi in Matlab from bash file












0















I would like your help to understand why I get the following error when calling a Matlab script using Gurobi from a bash file in the HPC of my university. I guess I'm messing up with paths or licenses.



1) Version 1



I have a folder called A containing the files



f.m,main.m



plus all the Gurobi files



gurobi.mexmaci64
gurobi_iis.m
gurobi_iis.mexmaci64
gurobi.read.m
gurobi_read.mexmaci64
gurobi_setup.m
gurobi_write.m
gurobi_write.mexmaci64


The chain is: main.m calls f.m which uses Gurobi to run an LP. When I run main.m in Matlab interactively in my laptop it works perfectly.



This is my bash file



#$ -S /bin/bash
#$ -l h_vmem=8G
#$ -l tmem=8G
#$ -l h_rt=480:0:0
#$ -cwd
#$ -j y

#Run 1 tasks where each task has a different $SGE_TASK_ID ranging from 1 to 1
#$ -t 1-1

#$ -N out6M
date
hostname


#Output the Task ID
echo "Task ID is $SGE_TASK_ID"

export GRB_LICENSE_FILE="/share/apps/[...].lic"

export PATH=/share/apps/[...]/matlab:/share/apps/matlabR2017b/bin:$PATH

matlab -nodisplay -nodesktop -nojvm -nosplash -r "main; ID = $SGE_TASK_ID; f; exit"


When I run this after having cd in my folder I get as error



Attempt to execute SCRIPT gurobi as a function: [...]




2) Version 2



I then thought that maybe the HPC does not like that I have the following files



gurobi.mexmaci64
gurobi_iis.m
gurobi_iis.mexmaci64
gurobi.read.m
gurobi_read.mexmaci64
gurobi_setup.m
gurobi_write.m
gurobi_write.mexmaci64


in my folder (maybe they are already exported from the path I have indicated in the bash file to my folder?). Hence I have removed them.



The folder A contains now just the files



f.m,main.m



The bash file is the same as in Version 1.



When I run this after having cd into my folder I get as error



 Error using gurobi
Gurobi error 10009: HostID mismatch (licensed to [...], hostid is [...])




What is likely to be the mistake?










share|improve this question



























    0















    I would like your help to understand why I get the following error when calling a Matlab script using Gurobi from a bash file in the HPC of my university. I guess I'm messing up with paths or licenses.



    1) Version 1



    I have a folder called A containing the files



    f.m,main.m



    plus all the Gurobi files



    gurobi.mexmaci64
    gurobi_iis.m
    gurobi_iis.mexmaci64
    gurobi.read.m
    gurobi_read.mexmaci64
    gurobi_setup.m
    gurobi_write.m
    gurobi_write.mexmaci64


    The chain is: main.m calls f.m which uses Gurobi to run an LP. When I run main.m in Matlab interactively in my laptop it works perfectly.



    This is my bash file



    #$ -S /bin/bash
    #$ -l h_vmem=8G
    #$ -l tmem=8G
    #$ -l h_rt=480:0:0
    #$ -cwd
    #$ -j y

    #Run 1 tasks where each task has a different $SGE_TASK_ID ranging from 1 to 1
    #$ -t 1-1

    #$ -N out6M
    date
    hostname


    #Output the Task ID
    echo "Task ID is $SGE_TASK_ID"

    export GRB_LICENSE_FILE="/share/apps/[...].lic"

    export PATH=/share/apps/[...]/matlab:/share/apps/matlabR2017b/bin:$PATH

    matlab -nodisplay -nodesktop -nojvm -nosplash -r "main; ID = $SGE_TASK_ID; f; exit"


    When I run this after having cd in my folder I get as error



    Attempt to execute SCRIPT gurobi as a function: [...]




    2) Version 2



    I then thought that maybe the HPC does not like that I have the following files



    gurobi.mexmaci64
    gurobi_iis.m
    gurobi_iis.mexmaci64
    gurobi.read.m
    gurobi_read.mexmaci64
    gurobi_setup.m
    gurobi_write.m
    gurobi_write.mexmaci64


    in my folder (maybe they are already exported from the path I have indicated in the bash file to my folder?). Hence I have removed them.



    The folder A contains now just the files



    f.m,main.m



    The bash file is the same as in Version 1.



    When I run this after having cd into my folder I get as error



     Error using gurobi
    Gurobi error 10009: HostID mismatch (licensed to [...], hostid is [...])




    What is likely to be the mistake?










    share|improve this question

























      0












      0








      0








      I would like your help to understand why I get the following error when calling a Matlab script using Gurobi from a bash file in the HPC of my university. I guess I'm messing up with paths or licenses.



      1) Version 1



      I have a folder called A containing the files



      f.m,main.m



      plus all the Gurobi files



      gurobi.mexmaci64
      gurobi_iis.m
      gurobi_iis.mexmaci64
      gurobi.read.m
      gurobi_read.mexmaci64
      gurobi_setup.m
      gurobi_write.m
      gurobi_write.mexmaci64


      The chain is: main.m calls f.m which uses Gurobi to run an LP. When I run main.m in Matlab interactively in my laptop it works perfectly.



      This is my bash file



      #$ -S /bin/bash
      #$ -l h_vmem=8G
      #$ -l tmem=8G
      #$ -l h_rt=480:0:0
      #$ -cwd
      #$ -j y

      #Run 1 tasks where each task has a different $SGE_TASK_ID ranging from 1 to 1
      #$ -t 1-1

      #$ -N out6M
      date
      hostname


      #Output the Task ID
      echo "Task ID is $SGE_TASK_ID"

      export GRB_LICENSE_FILE="/share/apps/[...].lic"

      export PATH=/share/apps/[...]/matlab:/share/apps/matlabR2017b/bin:$PATH

      matlab -nodisplay -nodesktop -nojvm -nosplash -r "main; ID = $SGE_TASK_ID; f; exit"


      When I run this after having cd in my folder I get as error



      Attempt to execute SCRIPT gurobi as a function: [...]




      2) Version 2



      I then thought that maybe the HPC does not like that I have the following files



      gurobi.mexmaci64
      gurobi_iis.m
      gurobi_iis.mexmaci64
      gurobi.read.m
      gurobi_read.mexmaci64
      gurobi_setup.m
      gurobi_write.m
      gurobi_write.mexmaci64


      in my folder (maybe they are already exported from the path I have indicated in the bash file to my folder?). Hence I have removed them.



      The folder A contains now just the files



      f.m,main.m



      The bash file is the same as in Version 1.



      When I run this after having cd into my folder I get as error



       Error using gurobi
      Gurobi error 10009: HostID mismatch (licensed to [...], hostid is [...])




      What is likely to be the mistake?










      share|improve this question














      I would like your help to understand why I get the following error when calling a Matlab script using Gurobi from a bash file in the HPC of my university. I guess I'm messing up with paths or licenses.



      1) Version 1



      I have a folder called A containing the files



      f.m,main.m



      plus all the Gurobi files



      gurobi.mexmaci64
      gurobi_iis.m
      gurobi_iis.mexmaci64
      gurobi.read.m
      gurobi_read.mexmaci64
      gurobi_setup.m
      gurobi_write.m
      gurobi_write.mexmaci64


      The chain is: main.m calls f.m which uses Gurobi to run an LP. When I run main.m in Matlab interactively in my laptop it works perfectly.



      This is my bash file



      #$ -S /bin/bash
      #$ -l h_vmem=8G
      #$ -l tmem=8G
      #$ -l h_rt=480:0:0
      #$ -cwd
      #$ -j y

      #Run 1 tasks where each task has a different $SGE_TASK_ID ranging from 1 to 1
      #$ -t 1-1

      #$ -N out6M
      date
      hostname


      #Output the Task ID
      echo "Task ID is $SGE_TASK_ID"

      export GRB_LICENSE_FILE="/share/apps/[...].lic"

      export PATH=/share/apps/[...]/matlab:/share/apps/matlabR2017b/bin:$PATH

      matlab -nodisplay -nodesktop -nojvm -nosplash -r "main; ID = $SGE_TASK_ID; f; exit"


      When I run this after having cd in my folder I get as error



      Attempt to execute SCRIPT gurobi as a function: [...]




      2) Version 2



      I then thought that maybe the HPC does not like that I have the following files



      gurobi.mexmaci64
      gurobi_iis.m
      gurobi_iis.mexmaci64
      gurobi.read.m
      gurobi_read.mexmaci64
      gurobi_setup.m
      gurobi_write.m
      gurobi_write.mexmaci64


      in my folder (maybe they are already exported from the path I have indicated in the bash file to my folder?). Hence I have removed them.



      The folder A contains now just the files



      f.m,main.m



      The bash file is the same as in Version 1.



      When I run this after having cd into my folder I get as error



       Error using gurobi
      Gurobi error 10009: HostID mismatch (licensed to [...], hostid is [...])




      What is likely to be the mistake?







      bash matlab gurobi






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 20:54









      user3285148user3285148

      631526




      631526
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308564%2fcalling-gurobi-in-matlab-from-bash-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308564%2fcalling-gurobi-in-matlab-from-bash-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Vorschmack

          Quarantine