public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "talebi.hossein at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/52537] slow trim function
Date: Thu, 07 Jun 2012 16:03:00 -0000	[thread overview]
Message-ID: <bug-52537-4-PZmlBfOG5M@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52537-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52537

--- Comment #9 from Hossein Talebi <talebi.hossein at gmail dot com> 2012-06-07 16:03:09 UTC ---
I think I found where the problem is. It is not with the trim(). It is mostly
with read (st_input_all(j),*,IOSTAT=ios) I50(1:50).

I attach a self contained program. With intel it takes 11sec but for gfortran
takes 40sec. The input file is 404MB.



program fileread

    integer :: linenum
    integer  :: j,ferror, ios,i
    character (len=200) :: st_input
    character (len=200) :: st_input_all(5373122)
    integer :: funit2
    integer :: I50(0:50)
    integer   G_elid, nn !, pEidf, pEconnf,pEmatidf
    integer, allocatable :: element_tab(:), Elements(:,:)

    linenum=0; ferror=0;
    open (funit2, file = "/data/msh/bigmesh.elements", access =
'sequential',iostat=ferror)

    if (ferror/=0) then
        STOP "error reading the file"
    endif

    print *, "reading the file..."

    G_elid=0
    do j=1,5373122
        read (funit2,"(A200)",iostat=ferror) st_input_all(j)
        if (G_elid== 5373121 ) then
            print *,  st_input_all(j)
        endif        
    enddo

    G_elid=0
    do j=1,5373122
        G_elid=G_elid+1
        read (st_input_all(j),*,IOSTAT=ios) I50(1:50)
        if (G_elid== 5373121 ) then
            print *,  I50
        endif
    enddo

    close(funit2)
    print *, I50
    STOP "permix I am stopped"

end program fileread


      parent reply	other threads:[~2012-06-07 16:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09  8:48 [Bug libfortran/52537] New: " talebi.hossein at gmail dot com
2012-03-09  9:14 ` [Bug libfortran/52537] " burnus at gcc dot gnu.org
2012-03-11  7:51 ` tkoenig at gcc dot gnu.org
2012-03-11 17:19 ` tkoenig at gcc dot gnu.org
2012-03-11 17:28 ` talebi.hossein at gmail dot com
2012-04-12 10:47 ` tkoenig at gcc dot gnu.org
2012-05-11 14:16 ` tkoenig at gcc dot gnu.org
2012-05-11 19:06 ` tkoenig at gcc dot gnu.org
2012-05-11 19:17 ` tkoenig at gcc dot gnu.org
2012-06-07 14:51 ` tkoenig at gcc dot gnu.org
2012-06-07 16:03 ` talebi.hossein at gmail dot com [this message]

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=bug-52537-4-PZmlBfOG5M@http.gcc.gnu.org/bugzilla/ \
    --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: link
Be 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).