Hi,<br><br>in smalloc %u is used for size_t. This is not correct. Is it OK to change this to the correct %z? I&#39;m asking, because I don&#39;t know whether it is supported by all compilers.<br><br>Roland<br><br><div class="gmail_quote">

On Mon, Jul 13, 2009 at 4:36 AM, Berk Hess <span dir="ltr">&lt;<a href="mailto:hess@cbr.su.se">hess@cbr.su.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi,<br>
<br>
long long int might not exist on some architectures.<br>
To be really on the safe side, you should define a new type using<br>
the same checks as for gmx_step_t, or simply define a new type using<br>
gmx_step_t.<br>
<font color="#888888"><br>
Berk<br>
</font><div><div></div><div class="h5"><br>
Berk Hess wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; There is a gmx_step_t defined in include/types/simple.h which is 64 bit<br>
&gt; when possible.<br>
&gt; But for this case I would simply use long long int for the moment,<br>
&gt; which will be 64 bit in nearly all cases.<br>
&gt;<br>
&gt; Berk<br>
&gt;<br>
&gt; Erik Lindahl wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; Gromacs 4.1 won&#39;t require 64 bit support, but Gromacs 5 will (we will<br>
&gt;&gt; have gmx_int64_t, etc.).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Jul 10, 2009, at 6:42 PM, Roland Schulz wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; which integer type should be used for integers that should be 64bit<br>
&gt;&gt;&gt; if available.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; My current problem: ndim*ndim*4 in gmx_covar overflows for more than<br>
&gt;&gt;&gt; 7723 atoms.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; One could use:<br>
&gt;&gt;&gt; - long (is only 32bit on windows)<br>
&gt;&gt;&gt; - long long (is always 64bit, not defined in C89)<br>
&gt;&gt;&gt; - size_t (is the size of pointer)<br>
&gt;&gt;&gt; - same typedef<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - One shouldn&#39;t use long, since it wouldn&#39;t solve it on windows.<br>
&gt;&gt;&gt; - Using &quot;long long&quot; is slow (in this case unimportant) and will give<br>
&gt;&gt;&gt; warning when passed to snew or memcpy.<br>
&gt;&gt;&gt; - size_t doesn&#39;t seem very clean and will give warnings when passed<br>
&gt;&gt;&gt; to printf (unless first upcasting to &quot;unsigned long long&quot; and then<br>
&gt;&gt;&gt; using %llu).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is C89 support required?<br>
&gt;&gt;&gt; Is it OK to use size_t for those integers?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; What is the best option?<br>
&gt;&gt;&gt;<br>
&gt;&gt; I would use size_t since that is ISO C at least. Check<br>
&gt;&gt; include/types/simple.h - Berk has added some formats for printing<br>
&gt;&gt; steps, that we should also augment to include windows, and change so<br>
&gt;&gt; they aren&#39;t so step-specific.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; BTW: Is it OK to change save_calloc and save_realloc to size_t<br>
&gt;&gt;&gt; (currently &quot;unsigned&quot;)?<br>
&gt;&gt;&gt;<br>
&gt;&gt; Yes, that would agree better with ISO C.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;&gt; Erik<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; gmx-developers mailing list<br>
&gt;&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&gt; <a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
&gt;&gt; Please don&#39;t post (un)subscribe requests to the list. Use thewww<br>
&gt;&gt; interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gmx-developers mailing list<br>
&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt; <a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
&gt; Please don&#39;t post (un)subscribe requests to the list. Use the<br>
&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;<br>
<br>
_______________________________________________<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <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<br>