<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 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:JA;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:249972924;
        mso-list-type:hybrid;
        mso-list-template-ids:1382594162 1779604348 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:"MS Mincho";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Ronald,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for your reply!&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>There is no intrinsic requirement for double precision and I should add the option for single precision.&nbsp; I will replace my calls to BLAS / LAPACK following your suggestion and get back to you.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I understand that 5.0 is going to be in C++, and I haven&#8217;t looked at the most current revision yet.&nbsp; When I do submit the code I will make sure that it&#8217;s compatible with the existing objects (e.g. if the neighbor list is now an object).&nbsp; I will consider converting the fluctuating charge code to something that&#8217;s more object-oriented, but for the purposes of compatibility it may be okay to simply enclose all of the C code using extern &#8220;C&#8221; { } .<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have done some development in Q-Chem and TeraChem (commercial quantum chemistry codes) and they have rather natural vector / matrix interfaces in C++.&nbsp; I think it&#8217;s a cool idea and I&#8217;ll take a look at your thread.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Lee-Ping<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> gmx-developers-bounces@gromacs.org [mailto:gmx-developers-bounces@gromacs.org] <b>On Behalf Of </b>Roland Schulz<br><b>Sent:</b> 10 November 2012 10:23<br><b>To:</b> Discussion list for GROMACS development<br><b>Subject:</b> Re: [gmx-developers] Question about Gromacs BLAS / LAPACK.<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Hi,<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Sat, Nov 10, 2012 at 11:59 AM, Lee-Ping Wang &lt;<a href="mailto:leeping@stanford.edu" target="_blank">leeping@stanford.edu</a>&gt; wrote:<o:p></o:p></p><div><div><p>On my local machine, I migrated my fluctuating charge code from Gromacs 4.0.7 to 4.5.5.&nbsp; It took a bit of time, but I think the implementation is now a lot cleaner.&nbsp; At some point, I would like to create a branch on the Gromacs repository, but first I need to solve a few issues with BLAS and LAPACK. &nbsp;Basically, when I was originally writing the code I used the Intel headers and libraries, but now I want to convert this to something more compatible.<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>If you want to submit this code at some time you will have to submit it against the master branch which is going to be 5.0. 5.0 is suppose to be partially migrated to C++. And I personally think that this should include a C++ vector/matrix interface. I started this discussion here:&nbsp;<a href="http://redmine.gromacs.org/issues/1017">http://redmine.gromacs.org/issues/1017</a>. &nbsp;So the interface might be changed when this is decided. Feel free to comment on the issue.<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p><span style='font-family:"Courier New"'>cblas_dgemm(101,111,111,N,N,N,1,VT,N,A1,N,0,Ai,N);</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>dgelss(&amp;N,&amp;N,&amp;nrhs,A1,&amp;N,x,&amp;N,S,&amp;rcond,&amp;rank,work,&amp;lwork,&amp;info);</span><o:p></o:p></p></div></blockquote><div><p class=MsoNormal>Is your code not accurately enough in single precision? Or could you benefit as the rest of Gromacs from using single precision (with the user having the choice to compile with GMX_DOUBLE)?<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p>However, when Gromacs calls its own BLAS and LAPACK functions it looks quite different:<o:p></o:p></p><p>&nbsp;<o:p></o:p></p><p><span style='font-family:"Courier New"'>#ifdef GMX_DOUBLE</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; F77_FUNC(dsyevr,DSYEVR)(jobz,&quot;I&quot;,&quot;L&quot;,&amp;n,a,&amp;n,&amp;vl,&amp;vu,&amp;index_lower,&amp;index_upper,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;abstol,&amp;m,eigenvalues,eigenvectors,&amp;n,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isuppz,&amp;w0,&amp;lwork,&amp;iw0,&amp;liwork,&amp;info);</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>#else</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; F77_FUNC(ssyevr,SSYEVR)(jobz,&quot;I&quot;,&quot;L&quot;,&amp;n,a,&amp;n,&amp;vl,&amp;vu,&amp;index_lower,&amp;index_upper,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;abstol,&amp;m,eigenvalues,eigenvectors,&amp;n,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isuppz,&amp;w0,&amp;lwork,&amp;iw0,&amp;liwork,&amp;info);</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>#endif</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal>I would write a macro (untested!)<o:p></o:p></p></div><div><p class=MsoNormal>#ifdef GMX_DOUblE<br>#define GMX_BLAS(A,B) &nbsp;F77_FUNC(d ## A, D ## B)<br>#else<br>#define GMX_BLAS(A,B) &nbsp;F77_FUNC(s ## A, S ## B)<br>#endif<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>So that you can call it as&nbsp;<o:p></o:p></p></div><div><p><span style='font-family:"Courier New"'>GMX_BLAS(syevr,SYEVR)(jobz,&quot;I&quot;,&quot;L&quot;,&amp;n,a,&amp;n,&amp;vl,&amp;vu,&amp;index_lower,&amp;index_upper,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;abstol,&amp;m,eigenvalues,eigenvectors,&amp;n,</span><o:p></o:p></p><p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isuppz,&amp;w0,&amp;lwork,&amp;iw0,&amp;liwork,&amp;info);</span><o:p></o:p></p></div><div><p class=MsoNormal>without having to worry about the #ifdef GMX_DOUBLE at the callsite. Of course if you always want to use double you don't need to worry about it.<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p style='margin-left:36.0pt'>2)<span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>How should I write my code so that a user can compile and link using Intel headers / libraries if they want to?&nbsp; I imagine it&#8217;s related to the --use-external-blas and --use-external-lapack command line options to the configure script, but I don&#8217;t know how to use this.<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal>That should automatically work.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div><p class=MsoNormal>Roland<br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<o:p></o:p></p></div></div></body></html>