<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif"><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif">I request for advice on the following:</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<font face="arial, helvetica, sans-serif">I have a MATLAB code that uses some Linear algebra (LA) and Linear equation solver (LS) routines. I have to speed up this MATLAB code by using the i) MKL routines for LA calls and ii) Petsc routines for LS calls.</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<font face="arial, helvetica, sans-serif">I was able to achieve the step (i) using the following commands</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif"><br>
</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif"><font size="1"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">
<span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent">icc -c -I/work/apps/matlab/2013a/extern/include -I/work/apps/matlab/2013a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_64 -O -DNDEBUG "matrixMultiply.c"</span></p>
<br><span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> icc -O -pthread -shared -Wl,--version-script,/work/apps/matlab/2013a/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "matrixMultiply.mexa64" matrixMultiply.o -Wl,-rpath-link,/work/apps/matlab/2013a/bin/glnxa64 -L/work/apps/matlab/2013a/bin/glnxa64 -lmx -lmex -lmat -mkl -lm -lstdc++</span></font><br>
</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="vertical-align:baseline;font-size:15px;white-space:pre-wrap;background-color:transparent"><font face="arial, helvetica, sans-serif"><br>
</font></span></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="background-color:transparent;white-space:pre-wrap;line-height:1.15;font-family:arial,helvetica,sans-serif">The code with dgemm call runs fine. However, how to achieve the step (ii), i.e., calling the PetSc routing from MATLAB executables compiled with mex. Please provide if you are aware of any sample codes.</span><br>
</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.727272033691406px"><font face="arial, helvetica, sans-serif"><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br>
</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt">
<span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent">I wish to eventually achieve all the above functionality for the Octave code as well. I thought of trying first with MATLAB as I thought the interface and support for external library support is better with it. Please do let me know your suggestions. Thanks.</span></p>
<p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></p></font></div></div><div>Regards<br>Sudheer<br></div>
</div>