Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: It Hurts Wh...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 39 of 50 Topic 8152 of 8775
Post > Topic >>

Re: It Hurts When I Do This

by glen herrmannsfeldt <gah@[EMAIL PROTECTED] > Apr 21, 2008 at 02:58 PM

Richard Maine wrote:

Someone wrote:

>>The downside, though, is that the checking required to sup****t this is
>>a lot of extra code, and applications where it is known that the array
>>is already allocated to the correct shape don't need this check which
>>would just slow them down.

> Steve is plenty bright... and he actually writes compilers, which I
> don't. So I'll assume that either there is something going on that I
> don't understand, or perhaps there is just a missing qualifier above
> about how much the slowdown would likely be.

> Certainly there is a test, which will presumably take a finite time. But
> I don't see why the amount of time should be significant. Seems like it
> ought to be a relatively fast test. I find it hard to image that being
> very significant in the compared to an array assignment of even a
> modest-sized array, much less a large one as might be most likely to use
> allocatable.

I would say one to see that it is already allocated and one for
each dimension (rank).  Conditional branches are considered expensive
these days, though, unless branch prediction works properly for them.
If the compiler doesn't know, it has to put the check in even for small
arrays that are inside deeply nested loops.  If (:) is the official
"don't reallocate" operator then one can avoid that.

(Then again, small ALLOCATABLE arrays shouldn't be in nested loops.)

> Seems to me that the string case is perhaps most likely to be a
> significant fraction increase because short strings are common and still
> might "want" to be allocatable. But then, string processing isn't
> usually a big fraction of the time of a typical Fortran program.

> Of course, any compiler that does even a token job of run-time
> diagnostic help is presumably going to check anyway, as trying to assign
> to an array of the wrong size is one of those things that you'd really
> like a helpful compiler to be able to diagnose instead of just tra****ng
> memory. That might concievably be done only when diagnostic options are
> turned on, though.

But everyone turns off checking when debugging is done and production
work starts, right?

-- glen
 




 50 Posts in Topic:
It Hurts When I Do This
GaryScott <garylscott@  2008-04-18 09:03:06 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-18 09:27:27 
Re: It Hurts When I Do This
GaryScott <garylscott@  2008-04-18 10:53:28 
Re: It Hurts When I Do This off topic
Dick Hendrickson <dick  2008-04-18 20:58:21 
Re: It Hurts When I Do This off topic
Steve Lionel <steve.li  2008-04-19 00:14:48 
Re: It Hurts When I Do This off topic
glen herrmannsfeldt <g  2008-04-18 16:39:41 
Re: It Hurts When I Do This off topic
Dick Hendrickson <dick  2008-04-19 02:03:35 
Re: It Hurts When I Do This off topic
Steve Lionel <steve.li  2008-04-19 12:21:24 
Re: It Hurts When I Do This off topic
"James Van Buskirk&q  2008-04-18 18:34:10 
Re: It Hurts When I Do This off topic
Dick Hendrickson <dick  2008-04-19 02:21:26 
Re: It Hurts When I Do This
none <none@[EMAIL PROT  2008-04-18 19:25:29 
Re: It Hurts When I Do This
Clive Page <junk@[EMAI  2008-04-18 19:32:15 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-18 13:03:45 
Re: It Hurts When I Do This
GaryScott <garylscott@  2008-04-18 13:14:28 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-18 13:54:56 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-18 13:12:10 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-18 14:43:23 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-18 14:24:32 
Re: It Hurts When I Do This
Dick Hendrickson <dick  2008-04-18 21:09:45 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-18 12:43:04 
Re: It Hurts When I Do This
GaryScott <garylscott@  2008-04-18 15:41:56 
Re: It Hurts When I Do This
GaryScott <garylscott@  2008-04-18 15:43:51 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-18 15:55:51 
Re: It Hurts When I Do This
fj <francois.jacq@[EMA  2008-04-19 03:47:57 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-19 08:28:07 
Re: It Hurts When I Do This
Ron Shepard <ron-shepa  2008-04-19 10:52:58 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-19 08:59:50 
Re: It Hurts When I Do This
Beliavsky <beliavsky@[  2008-04-21 11:06:09 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-21 12:13:11 
Re: It Hurts When I Do This
Dick Hendrickson <dick  2008-04-21 19:29:02 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-21 11:52:12 
Re: It Hurts When I Do This
Dan Nagle <dannagle@[E  2008-04-21 20:25:04 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-21 15:25:50 
Re: It Hurts When I Do This
Beliavsky <beliavsky@[  2008-04-21 11:10:27 
Re: It Hurts When I Do This
Arjen Markus <arjen.ma  2008-04-21 12:45:28 
Re: It Hurts When I Do This
Beliavsky <beliavsky@[  2008-04-21 12:53:06 
Re: It Hurts When I Do This
Beliavsky <beliavsky@[  2008-04-21 13:05:55 
Re: It Hurts When I Do This
nospam@[EMAIL PROTECTED]   2008-04-21 15:25:50 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-21 14:58:15 
Re: It Hurts When I Do This
Steve Lionel <steve.li  2008-04-22 01:12:20 
Re: It Hurts When I Do This
glen herrmannsfeldt <g  2008-04-21 19:36:49 
Re: It Hurts When I Do This -- diversion...
dpb <none@[EMAIL PROTE  2008-04-22 09:37:11 
Re: It Hurts When I Do This -- diversion...
Steve Lionel <Steve.Li  2008-04-22 11:44:31 
Re: It Hurts When I Do This -- diversion...
dpb <none@[EMAIL PROTE  2008-04-22 11:28:33 
Re: It Hurts When I Do This -- diversion...
Steve Lionel <Steve.Li  2008-04-22 16:13:37 
CVF help -- was: Re: It Hurts When I Do This -- diversion...
dpb <none@[EMAIL PROTE  2008-04-22 15:27:08 
Re: CVF help -- was: Re: It Hurts When I Do This -- diversion...
Steve Lionel <Steve.Li  2008-04-22 16:43:38 
Re: CVF help -- was: Re: It Hurts When I Do This -- diversion...
dpb <none@[EMAIL PROTE  2008-04-22 18:51:06 
Re: CVF help -- was: Re: It Hurts When I Do This -- diversion...
"Jugoslav Dujic"  2008-04-23 09:35:40 
Re: CVF help -- was: Re: It Hurts When I Do This -- diversion...
dpb <none@[EMAIL PROTE  2008-04-23 08:58:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 8:35:33 CDT 2008.