Thanks Andreas
The problem is that printing the same output (23MB) on terminal does not
take that much time. Running strace on GEM5 binary showed me that the fsync
function in one of emulated syscall (writeFunc in src/sim/syscall_emul.cc)
was taking a lot of time. It seems that this is related to
http://shaver.off.net/diary/2008/05/25/fsyncers-and-curveballs/.

Since in some configurations fsync doesn’t just flush out the data for the
file it’s called on, but rather on all the buffered data for that
filesystem, it might cause significant performance slowdown. My
applications are not sensitive to flushing data to physical disk so I have
disabled fsync call in writeFunc. Is there any better solution?

Thanks a lot
Daya





On Wed, Aug 7, 2013 at 3:18 AM, Andreas Hansson <[email protected]>wrote:

>  I would guess you are printing quite a bit, potentially with std::endl
> or similar flushing each time.
>
>  If you want to figure out where you are spending time, build gem5.perf
> and run with the google perftools. That's usually very informative.
>
>  Andreas
>
>   From: Daya S Khudia <[email protected]>
> Reply-To: gem5 users mailing list <[email protected]>
> Date: Tuesday, 6 August 2013 20:16
> To: "[email protected]" <[email protected]>
> Subject: [gem5-users] Slow writes to stderr file
>
>   Hi,
>
> My application happens to write messages on stderr. GEM5 (latest stable
> release) runs very slow if errout (for stderr redirection) option is
> specified on the command line. The following are the gem5 commands and
> their times without and with errout option to gem5.
>
>  Without errout (stderr is printed on terminal):
>    ~/gem5-clean/gem5-stable/build/ARM/gem5.fast --outdir=./
> ~/gem5-clean/gem5-stable/configs/example/se.py --cmd=mp3dec/mp3dec.m5arm
> --options="-v mp3dec/input1/small.mp3 --output=wave:out"
> --output=result.out.input1
>
>  14.76user 0.16system 0:17.56elapsed 84%CPU
>
>  With errout:
>    ~/gem5-clean/gem5-stable/build/ARM/gem5.fast --outdir=./
> ~/gem5-clean/gem5-stable/configs/example/se.py --cmd=mp3dec/mp3dec.m5arm
> --options="-v mp3dec/input1/small.mp3 --output=wave:out"
> --output=result.out.input1 --errout=result.err.input1
>
>  25.43user 1.57system 13:29.44elapsed 3%CPU
>
>  Does anyone know why this is happening?
>  Thanks a lot
> Daya
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to