deallog flush

40 views
Skip to first unread message

Krzysztof Bzowski

unread,
Apr 17, 2013, 11:50:47 AM4/17/13
to dea...@googlegroups.com
Hi,
How to flush deallog without moving to new line?
I tried std::flush but it doesn't work.



--
Krzysztof Bzowski

Matthias Maier

unread,
Apr 17, 2013, 12:22:53 PM4/17/13
to dea...@googlegroups.com

Am 17. Apr 2013, 17:50 schrieb Krzysztof Bzowski <kbzo...@agh.edu.pl>:

> Hi,
> How to flush deallog without moving to new line?
> I tried std::flush but it doesn't work.

With the current implementation this is not possible.

To fix this was on my todo list, but I forgot :-]

So, with two people actually wanting that feature, I'll have a look at
this.

Best,
Matthias

Krzysztof Bzowski

unread,
Apr 17, 2013, 12:31:57 PM4/17/13
to dea...@googlegroups.com
It is not must-have feature.
But thanks for the info.

W dniu 2013-04-17 18:22, Matthias Maier pisze:
--
Krzysztof Bzowski

Matthias Maier

unread,
Apr 17, 2013, 1:43:04 PM4/17/13
to dea...@googlegroups.com
Hi,

Am 17. Apr 2013, 18:31 schrieb Krzysztof Bzowski <kbzo...@agh.edu.pl>:

> It is not must-have feature.
> But thanks for the info.

Fixed in svn revision 29318 on trunk.

Now, std::flush and std::endl will trigger a writeout to console (and
attached file).

Please note that this might interleave output when "std::flush" is used
and two concurrent threads write simultaneously, so

thread 1: deallog << "foo";
thread 1: deallog << "bar" << std::flush;

thread 2: deallog << "BAZ" << std::flush;

Might result in either

DEAL::PREFIX: foobarBAZ

or

DEAL::PREFIX: BAZfoobar.


Best,
Matthias

Krzysztof Bzowski

unread,
Apr 18, 2013, 2:39:11 AM4/18/13
to dea...@googlegroups.com
Thanks for your quick response.
Right now I have problem with building revision 29323. Build log is
attached. I think it is connected to recent changes in logstream.h

K.
--
Krzysztof Bzowski, PhD student
Department of Applied Computer Science and Modelling
Akademia G�rniczo-Hutnicza
T: +48126172615 M: +48502758869
build.log

Matthias Maier

unread,
Apr 18, 2013, 3:41:17 AM4/18/13
to dea...@googlegroups.com
Can you post the generated detailed.log, please?

Krzysztof Bzowski

unread,
Apr 18, 2013, 3:47:04 AM4/18/13
to dea...@googlegroups.com
Detailed log is attached.

On date 2013-04-18 09:41, Matthias Maier wrote:
> Can you post the generated detailed.log, please?
>

detailed.log

Matthias Maier

unread,
Apr 18, 2013, 3:59:48 AM4/18/13
to dea...@googlegroups.com
I think you're hitting a bug in TBB. where the copy constructor is used
instead on the default constructor [1].
I want to refactor two last bits that will hopefully - as a sideeffect -
mitigate the problem.

For the time being, can you try again by using the bundled tbb library?
You can enable this with -DDEAL_II_FORCE_BUNDLED_THREADS=ON

Make sure that detailed or the summary log shows a line

# DEAL_II_WITH_THREADS set up with bundled packages (forced)

Does this resolve the problem?

Best,
Matthias

[1] http://software.intel.com/en-us/forums/topic/287182

Matthias Maier

unread,
Apr 18, 2013, 7:17:42 AM4/18/13
to dea...@googlegroups.com

Am 18. Apr 2013, 09:59 schrieb Matthias Maier <matthia...@iwr.uni-heidelberg.de>:

> I want to refactor two last bits that will hopefully - as a sideeffect -
> mitigate the problem.

Well, no. There is no easy fix for this...

Does using the bundled TBB resolve your problem?

Krzysztof Bzowski

unread,
Apr 18, 2013, 10:54:26 AM4/18/13
to dea...@googlegroups.com
Sorry for not replying sooner
Yes, using bundled TBB resolved my problem.
Flush works properly.

Thanks
--
Krzysztof Bzowski
Reply all
Reply to author
Forward
0 new messages