memory increase

98 views
Skip to first unread message

Bruno Deremble

unread,
Nov 16, 2022, 4:13:13 PM11/16/22
to basilisk-fr
Hello Basilisk,

I am running this code
http://basilisk.fr/sandbox/bderembl/movingtopo/movingtopo.c
in a high resolution configuration on a HPC.

Problem: With the latest version of basilisk, it crashes always at the exact
same iteration (after ~2 hours of simulation). However when I compile the model with
basilisk of january 2022. It runs fine. I know this sounds crazy but I have
redone the experiment multiple times and there is no doubt that the crash always
happens at the same iteration.

I checked there is no memory leak.

However the memory allocation always increases. I have managed to pin down this
memory increase with a (hopefully) minimal example here

http://basilisk.fr/sandbox/bderembl/tests/fraction_memory.c

I was wondering if this steady increase could be related to the crash?
With basilisk of january 2022, the increase was not as dramatic (see attached
plots)

I hope I got this right...

Thank you
Bruno

mem_bas_jan22.svg
mem_bas_nov22.svg

Yi Dai

unread,
Nov 17, 2022, 5:14:10 AM11/17/22
to basilisk-fr
Hello Bruno,
Thanks for posting this problem and narrow down it to a small example. I was also debuging the similar issue for quite some time but didn't find the solution. 

Dai

Stephane Popinet

unread,
Nov 17, 2022, 5:35:15 AM11/17/22
to basil...@googlegroups.com
Hi Bruno,

Thanks for the bug report. It looks like the new version of qcc does not
free (some of) the automatic fields allocated by a call to fraction(),
as it should. This is what causes the linear increase in memory usage.
You can see that easily in your example with:

cat fraction_memory/out
# Multigrid, 99 steps, 0.144761 CPU, 0.1448 real, 2.8e+06 points.step/s,
305 var

The problem being '305 var' i.e. your example uses 305 scalar fields,
which is obviously too much.

If you do only 50 steps, you get:

# Multigrid, 49 steps, 0.036781 CPU, 0.03678 real, 5.46e+06
points.step/s, 155 var

So it looks like one field is "leaked" per call to fraction().

I will look into it.

cheers,

Stephane

Stephane Popinet

unread,
Nov 17, 2022, 10:16:53 AM11/17/22
to basil...@googlegroups.com
I have isolated the problem and made a bug report:

http://basilisk.fr/sandbox/bugs/automatic1.c

Stephane Popinet

unread,
Nov 18, 2022, 7:59:08 AM11/18/22
to basil...@googlegroups.com
I have just released a new version which fixes this problem, see:

http://basilisk.fr/src/?changes=20221118124037
http://basilisk.fr/src/?history

Note that this bug probably had limited impact since the "automatic()"
syntax is not used often in Basilisk and since the bug was triggered in
fairly specific contexts (including of course the context reported by
Bruno in the first place).

cheers,

Stephane

Reply all
Reply to author
Forward
0 new messages