<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.textwrapper
{mso-style-name:textwrapper;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1169716716;
mso-list-type:hybrid;
mso-list-template-ids:-202765258 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:27.0pt;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">To activate Matlab on head node which does not have access to the internet. (see also:
<span style="color:#02A7FF">https://www.mathworks.com/matlabcentral/answers/259627-how-do-i-activate-matlab-or-other-mathworks-products-without-an-internet-connection</span>)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">First ssh into the head node using the command:
<span style="color:red">ssh node_name</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">Obtain the Host Id using the command:
<span style="color:red">ip addr | grep ether </span>(More details found on:
<span style="color:#00B0F0"><a href="http://www.mathworks.com/matlabcentral/answers/101892" target="_blank"><span class="textwrapper"><span style="color:#00B0F0">http://www.mathworks.com/matlabcentral/answers/101892</span></span></a></span>)<o:p></o:p></li></ol>
<p class="MsoListParagraph">You will see something like this: link/ether xx:xx:xx:xx:xx:xx ABC yy:yy:yy:yy:yy:yy<o:p></o:p></p>
<p class="MsoListParagraph">Note down the given: xx:xx:xx:xx:xx:xx<o:p></o:p></p>
<ol style="margin-top:0in" start="3" type="1">
<li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">Login to your MathWorks Account from a computer which has internet access. You will see the available license that your account has. Select a license from the list.
<o:p></o:p></li></ol>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:1.5in"><img border="0" width="514" height="270" style="width:5.3541in;height:2.8125in" id="Picture_x0020_1" alt="Graphical user interface, text, application, email
Description automatically generated" data-outlook-trace="F:0|T:1" src="cid:image001.png@01D6B83D.FAE907A0"><o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:27.0pt">Then, select <span style="color:#92D050">
Install and Activate </span>option and select the <span style="color:#92D050">Activate to Retrieve License File option.</span><o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><img border="0" width="517" height="266" style="width:5.3854in;height:2.7708in" id="Picture_x0020_2" alt="Graphical user interface, text, application
Description automatically generated" data-outlook-trace="F:0|T:1" src="cid:image002.png@01D6B83D.FAE907A0"><o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><o:p> </o:p></p>
<ol style="margin-top:0in" start="4" type="1">
<li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">Enter the information and click
<span style="color:#92D050">Continue</span>.<o:p></o:p></li></ol>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><img border="0" width="309" height="319" style="width:3.2187in;height:3.3229in" id="Picture_x0020_4" alt="Graphical user interface, application
Description automatically generated" data-outlook-trace="F:0|T:1" src="cid:image003.png@01D6B83D.FAE907A0"><o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><o:p> </o:p></p>
<ol style="margin-top:0in" start="5" type="1">
<li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">An option to download the License file will appear. Download it and copy the license file to the cluster (your home directory).<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">Now, launch matlab when you have ssh into your head node.
<o:p></o:p></li></ol>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><img border="0" width="551" height="323" style="width:5.7395in;height:3.3645in" id="Picture_x0020_5" alt="Graphical user interface, text, application
Description automatically generated" data-outlook-trace="F:0|T:1" src="cid:image004.png@01D6B83D.FAE907A0"><o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:.5in">Select the <span style="color:#92D050">
Activate manually without the internet</span> option and click <span style="color:#92D050">
Next ></span>.<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<ol style="margin-top:0in" start="7" type="1">
<li class="MsoListParagraph" style="margin-left:-9.0pt;mso-list:l0 level1 lfo1">Browse and locate the license file.<o:p></o:p></li></ol>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:99.0pt;text-indent:9.0pt"><img border="0" width="555" height="325" style="width:5.7812in;height:3.3854in" id="Picture_x0020_6" alt="Graphical user interface, text, application
Description automatically generated" data-outlook-trace="F:0|T:1" src="cid:image005.png@01D6B83D.FAE907A0"><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">Matlab is activated and ready to use.<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:27.0pt"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Amneet Bhalla <mail2amneet@gmail.com><br>
<b>Date: </b>Tuesday, November 10, 2020 at 6:10 PM<br>
<b>To: </b>Barry Smith <bsmith@petsc.dev><br>
<b>Cc: </b>Kaustubh Khedkar <kkhedkar9879@sdsu.edu>, "petsc-users@mcs.anl.gov" <petsc-users@mcs.anl.gov><br>
<b>Subject: </b>Re: [petsc-users] Using Petsc-Matlab engine on a cluster<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you Barry! We will definitely try this out and let you know.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">We also found an inconvenient work around. We registered the ip of a head compute node on Mathworks.com, which generated a license file. Then we activated Matlab on this compute node offline by pointing it to the license file. This allowed
us to run Matlab engine on the head compute node (we run Matlab on only rank 0 which is mapped to the head compute node).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Kaustubh, can you write the exact instructions for registering an ip on Mathworks.com here, so as to benefit other PETSc users.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Nov 10, 2020 at 5:22 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"> In the git branch <b><span style="font-size:12.0pt;font-family:Menlo;color:#C814C9">barry/2020-11-10/add-matlab-engine-host </span></b> I have added the option -matlab_engine_host hostname <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Note this does require you have ssh access to hostname from where your PETSc program is running which may require setting up some ssh files<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Good luck<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Barry<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Nov 9, 2020, at 5:35 PM, Kaustubh Khedkar <<a href="mailto:kkhedkar9879@sdsu.edu" target="_blank">kkhedkar9879@sdsu.edu</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hello,<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I am using PETSc with Matlab engine. I have built an application that uses Matlab engine through PETSc interface. I am trying to run this application on a cluster which has Matlab installed on a network drive (nas drive). I have made sure
that I am able to access Matlab using my university details on the cluster (by activating Matlab license through <a href="http://mathworks.com/" target="_blank">Mathworks.com</a> account). I am also able to run this application using mpirun on the head node
(master) which starts the Matlab engine but if I try to run this application using slurm on compute node then the Matlab engine does not start. I have also confirmed that if I login into one of the compute nodes and do a mpirun the Matlab engine does not start
there. If I try to launch Matlab on a compute node it asks for Matlab license which the compute node is unable to activate possibly because it is not connected to the internet directly.<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Is there a way start matlab engine on the head node through Petsc interface even though the application is running on compute nodes or is there any other work around this issue?<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Thanks,<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Kaustubh Khedkar<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">--Amneet <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>