public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jv244 at cam dot ac dot uk" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41137] inefficient zeroing of an array Date: Fri, 21 Aug 2009 07:02:00 -0000 [thread overview] Message-ID: <20090821070240.13818.qmail@sourceware.org> (raw) In-Reply-To: <bug-41137-6642@http.gcc.gnu.org/bugzilla/> ------- Comment #1 from jv244 at cam dot ac dot uk 2009-08-21 07:02 ------- Just for reference, the difference in time between the two variants is truly impressive. About a factor of 11 with gcc 4.4 and 8 with gcc 4.5. Given that a code like CP2K spents sometimes about 5-10% of its time in zeroing stuff, this would help significantly. trunk: > gfortran -O3 -march=native test.f90 > ./a.out 0.10000600 0.84405303 4.4 branch: > gfortran -O3 -march=native test.f90 > ./a.out 0.10400600 1.1320710 test code: SUBROUTINE S(a,n) INTEGER :: n REAL :: a(n,n,n,n) a(:,:,:,:)=0.0 END SUBROUTINE SUBROUTINE S2(a) REAL :: a(10,10,10,10) a(:,:,:,:)=0.0 END SUBROUTINE REAL :: a(10,10,10,10),t1,t2 INTEGER :: I,N N=100000 CALL CPU_TIME(t1) DO I=1,N CALL S2(a) ENDDO CALL CPU_TIME(t2) write(6,*) t2-t1 CALL CPU_TIME(t1) DO I=1,N CALL S(a,10) ENDDO CALL CPU_TIME(t2) write(6,*) t2-t1 END -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41137
next prev parent reply other threads:[~2009-08-21 7:02 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-08-21 6:15 [Bug fortran/41137] New: " jv244 at cam dot ac dot uk 2009-08-21 7:02 ` jv244 at cam dot ac dot uk [this message] 2009-08-21 7:40 ` [Bug fortran/41137] " dfranke at gcc dot gnu dot org 2009-08-21 8:29 ` jv244 at cam dot ac dot uk 2009-08-24 20:06 ` jv244 at cam dot ac dot uk 2009-11-01 16:21 ` tkoenig at gcc dot gnu dot org 2009-11-01 17:36 ` tkoenig at gcc dot gnu dot org 2010-05-07 21:02 ` dfranke at gcc dot gnu dot org 2010-06-21 15:02 ` burnus at gcc dot gnu dot org 2010-06-21 15:22 ` burnus at gcc dot gnu dot org 2010-06-21 15:49 ` jv244 at cam dot ac dot uk 2010-06-21 17:00 ` burnus at gcc dot gnu dot org 2010-06-21 17:44 ` jakub at gcc dot gnu dot org 2010-06-22 14:42 ` burnus at gcc dot gnu dot org 2010-06-22 15:25 ` jakub at gcc dot gnu dot org [not found] <bug-41137-4@http.gcc.gnu.org/bugzilla/> 2013-03-29 9:47 ` Joost.VandeVondele at mat dot ethz.ch 2013-03-29 22:19 ` tkoenig at gcc dot gnu.org 2013-03-29 22:39 ` burnus at gcc dot gnu.org 2014-05-01 12:16 ` dominiq at lps dot ens.fr 2014-05-01 12:35 ` Joost.VandeVondele at mat dot ethz.ch 2014-05-01 17:00 ` tkoenig at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090821070240.13818.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).