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