ok. I&#39;ll change it then.<br><br><div class="gmail_quote">On Sun, Sep 6, 2009 at 4:58 PM,  <span dir="ltr">&lt;<a href="mailto:hess@sbc.su.se">hess@sbc.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;">

Both names are not good.<br>
I guess gmx_large_int_t is best.<br>
After 4.1 we will replace it with int64_t.<br>
<br>
Berk<br>
<div><div></div><div class="h5"><br>
&gt; The hack is cool. I guess the best is:<br>
&gt; size_t sz;<br>
&gt; printf(gmx_step_pfmt,(gmx_step_t)sz);<br>
&gt;<br>
&gt; (We will rename gmx_step_t in gmx_long_t or gmx_int64_t. This might upcast<br>
&gt; it from 32 to 64bit but that does not hurt. I wrote this before but<br>
&gt; without<br>
&gt; example it was not understanble)<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Sep 6, 2009 at 9:57 AM, Sander Pronk &lt;<a href="mailto:pronk@cbr.su.se">pronk@cbr.su.se</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Oops.. that only works in hexadecimal.<br>
&gt;&gt; Sander<br>
&gt;&gt;<br>
&gt;&gt; On Sep 6, 2009, at 15:55 , Sander Pronk wrote:<br>
&gt;&gt;<br>
&gt;&gt; you&#39;re right; if it&#39;s only found in smalloc.c, you could try, as a real<br>
&gt;&gt; hack:<br>
&gt;&gt; size_t sz;<br>
&gt;&gt;<br>
&gt;&gt; #if (SIZEOF_SIZE_T &gt; SIZEOF_INT)<br>
&gt;&gt; printf(&quot;%u%u&quot;, sz &gt;&gt; (SIZEOF_INT*8), (unsigned int)sz);<br>
&gt;&gt; #else<br>
&gt;&gt; printf(&quot;%u&quot;,sz);<br>
&gt;&gt; #endif<br>
&gt;&gt;<br>
&gt;&gt; with some additional code to leave out any leading zeroes if that&#39;s<br>
&gt;&gt; important to you.<br>
&gt;&gt;<br>
&gt;&gt; Sander<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Sep 6, 2009, at 12:00 , Roland Schulz wrote:<br>
&gt;&gt;<br>
&gt;&gt; well under windows long is only 32 bit. Also size_t is usually unsigned.<br>
&gt;&gt;<br>
&gt;&gt; should we cast it to gmx_step_t (or some type derived from it) and then<br>
&gt;&gt; print it?<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Sep 6, 2009 at 5:01 AM, Sander Pronk &lt;<a href="mailto:pronk@cbr.su.se">pronk@cbr.su.se</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; I think that would be %zd according to C99. It&#39;s probably safer to use<br>
&gt;&gt;&gt; %ld, because it&#39;s C89 compliant (not all compilers support C99), and it<br>
&gt;&gt;&gt; happens to coincide with the width of size_t on all platforms I know<br>
&gt;&gt;&gt; of.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sander<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Sep 6, 2009, at 06:33 , Roland Schulz wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; in smalloc %u is used for size_t. This is not correct. Is it OK to<br>
&gt;&gt;&gt; change<br>
&gt;&gt;&gt; this to the correct %z? I&#39;m asking, because I don&#39;t know whether it is<br>
&gt;&gt;&gt; supported by all compilers.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Roland<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Mon, Jul 13, 2009 at 4:36 AM, Berk Hess &lt;<a href="mailto:hess@cbr.su.se">hess@cbr.su.se</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; long long int might not exist on some architectures.<br>
&gt;&gt;&gt;&gt; To be really on the safe side, you should define a new type using<br>
&gt;&gt;&gt;&gt; the same checks as for gmx_step_t, or simply define a new type using<br>
&gt;&gt;&gt;&gt; gmx_step_t.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Berk<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Berk Hess wrote:<br>
&gt;&gt;&gt;&gt; &gt; Hi,<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; There is a gmx_step_t defined in include/types/simple.h which is 64<br>
&gt;&gt;&gt;&gt; bit<br>
&gt;&gt;&gt;&gt; &gt; when possible.<br>
&gt;&gt;&gt;&gt; &gt; But for this case I would simply use long long int for the moment,<br>
&gt;&gt;&gt;&gt; &gt; which will be 64 bit in nearly all cases.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Berk<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Erik Lindahl wrote:<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Gromacs 4.1 won&#39;t require 64 bit support, but Gromacs 5 will (we<br>
&gt;&gt;&gt;&gt; will<br>
&gt;&gt;&gt;&gt; &gt;&gt; have gmx_int64_t, etc.).<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; On Jul 10, 2009, at 6:42 PM, Roland Schulz wrote:<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; which integer type should be used for integers that should be<br>
&gt;&gt;&gt;&gt; 64bit<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; if available.<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; My current problem: ndim*ndim*4 in gmx_covar overflows for more<br>
&gt;&gt;&gt;&gt; than<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; 7723 atoms.<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; One could use:<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - long (is only 32bit on windows)<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - long long (is always 64bit, not defined in C89)<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - size_t (is the size of pointer)<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - same typedef<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - One shouldn&#39;t use long, since it wouldn&#39;t solve it on windows.<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - Using &quot;long long&quot; is slow (in this case unimportant) and will<br>
&gt;&gt;&gt;&gt; give<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; warning when passed to snew or memcpy.<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; - size_t doesn&#39;t seem very clean and will give warnings when<br>
&gt;&gt;&gt;&gt; passed<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; to printf (unless first upcasting to &quot;unsigned long long&quot; and then<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; using %llu).<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; Is C89 support required?<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; Is it OK to use size_t for those integers?<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; What is the best option?<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; I would use size_t since that is ISO C at least. Check<br>
&gt;&gt;&gt;&gt; &gt;&gt; include/types/simple.h - Berk has added some formats for printing<br>
&gt;&gt;&gt;&gt; &gt;&gt; steps, that we should also augment to include windows, and change<br>
&gt;&gt;&gt;&gt; so<br>
&gt;&gt;&gt;&gt; &gt;&gt; they aren&#39;t so step-specific.<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; BTW: Is it OK to change save_calloc and save_realloc to size_t<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt; (currently &quot;unsigned&quot;)?<br>
&gt;&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Yes, that would agree better with ISO C.<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Cheers,<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Erik<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; &gt;&gt; gmx-developers mailing list<br>
&gt;&gt;&gt;&gt; &gt;&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&gt;&gt;&gt; &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;&gt;&gt; &gt;&gt; Please don&#39;t post (un)subscribe requests to the list. Use thewww<br>
&gt;&gt;&gt;&gt; &gt;&gt; interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; &gt; gmx-developers mailing list<br>
&gt;&gt;&gt;&gt; &gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&gt;&gt;&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;&gt;&gt; &gt; Please don&#39;t post (un)subscribe requests to the list. Use the<br>
&gt;&gt;&gt;&gt; &gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; gmx-developers mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&gt;&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;&gt;&gt; Please don&#39;t post (un)subscribe requests to the list. Use the<br>
&gt;&gt;&gt;&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>
&gt;&gt;&gt; 865-241-1537, ORNL PO BOX 2008 MS6309<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; gmx-developers mailing list<br>
&gt;&gt;&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&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;&gt; Please don&#39;t post (un)subscribe requests to the list. Use the<br>
&gt;&gt;&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; gmx-developers mailing list<br>
&gt;&gt;&gt; <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
&gt;&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;&gt; Please don&#39;t post (un)subscribe requests to the list. Use the<br>
&gt;&gt;&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>
&gt;&gt; 865-241-1537, ORNL PO BOX 2008 MS6309<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 the<br>
&gt;&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;<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 the<br>
&gt;&gt; www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>
&gt;&gt;<br>
&gt;&gt;<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 the<br>
&gt;&gt; www 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;<br>
&gt; --<br>
&gt; ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>
&gt; 865-241-1537, ORNL PO BOX 2008 MS6309<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>
<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>