Geoclaw parallelization

103 views
Skip to first unread message

vincen...@free.fr

unread,
Oct 14, 2019, 6:25:17 AM10/14/19
to claw-users
Dear Claw-users,

I am new to this list, and first I would like to say thank you to whom it may concern for this nice clawpack/geoclaw piece of work.
I am not a fluid mechanics specialist, and my mathematical background coping with finite volume methods is especially weak... my concern in this context is essentially geomatics and natural hazard management; I was asked to write a frontend of an implementation of Geoclaw for dense snow avalanche calculation named "avac", so it could be easily run by GRASS GIS users. I wrote a Grass Addon which works pretty well at its early stage.

Now I am wondering how I could implement the use of openmp to have things work faster on large input topographies. I tried to set up an environment variable in my .bahsrc (export FFLAGS='-O2 -fopenmp', export OMP_NUM_THREADS=4), hoping it would be enough. Unfortunately it is not. When I run make in my working directory, I get the following error:

   [...]At line 55 of file /home/vincent/clawpack_src/clawpack-
   v5.6.0/amrclaw/src/2d/opendatafile.f (unit = 7, file = 'fort.7')
   Fortran runtime error: End of file[...}

The thing is the code I use sequentially retrieves some variable values from a .data file and I guess the parallelization issue is related to this iterative file reading.
Anyone could help me find a solution? Of course I can send the avac geoclaw code for a first diagnosis.

Best,
Vincent.

Kyle Mandli

unread,
Oct 15, 2019, 10:14:06 AM10/15/19
to Claw Users Mailing List
Hi Vincent,

That is a bit puzzling given that it sounds like the data files have not been created, which is a completely different problem from the parallelization. How exactly are you running the makefile?

Kyle
> --
> You received this message because you are subscribed to the Google Groups "claw-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/d113478a-73ea-4c1e-a9c8-c85903f1d70f%40googlegroups.com.

vincen...@free.fr

unread,
Oct 15, 2019, 10:24:50 AM10/15/19
to claw-users
Hello Kyle,

thank you for your reply. Indeed, I tried again with a fresh install and the exact error I get is the following:

Reading data file: voellmy.data
         first 0 lines are comments and will be skipped
         first 0 lines are comments and will be skipped
At line 22 of file module_voellmy.f90 (unit = 7, file = 'voellmy.data')

Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f9aab0f28b0 in ???
#1  0x7f9aab0f3395 in ???
#2  0x7f9aab0f3b1a in ???
#3  0x7f9aab2ebebb in ???
#4  0x7f9aab2e51b6 in ???
#5  0x7f9aab2e68f9 in ???
#6  0x55e667c50c81 in ???
#7  0x55e667c920ff in ???
#8  0x55e667c6ce1a in ???
#9  0x55e667c81283 in ???
#10  0x55e667c816ed in ???
#11  0x7f9aaaf3779d in ???
#12  0x7f9aaaeabfa2 in start_thread
    at /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
#13  0x7f9aaadda4ce in ???
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#14  0xffffffffffffffff in ???

 ==> runclaw: *** Runtime error: return code = 512

does it sound a bit less weird to you ?
Vincent.

Kyle Mandli

unread,
Oct 15, 2019, 10:34:31 AM10/15/19
to Claw Users Mailing List
Is `module_voellmy.f90` something you added?

Kyle
> --
> You received this message because you are subscribed to the Google Groups "claw-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/5f3499b8-7e91-4aab-ac2f-f84a7f468126%40googlegroups.com.

Ancey Christophe

unread,
Oct 15, 2019, 10:56:19 AM10/15/19
to claw-...@googlegroups.com
Dear Kyle
Vincent Bain is referring to AVAC, which is based on GeoClaw. I attach the user guide (written for my students) and the source files are here
https://enacshare.epfl.ch/fQue7RLUto3hBqWKbGMk4ja8JPrSA2d
This code is used to simulate snow avalanches.

I wanted to limit the number of changes to the GeoClaw library. I had to change the qinit_module.f90 because otherwise, the initial conditions are set to zero (we are on a montain slope, not in the ocean). I also created the module_voellmy.f90 module that is called by src2.f90 (Voellmy's friction). I think that because the solver calls this module whenever it evaluates the source, parallel computing runs into difficulty. But I do not see other solution.

Best,
Christophe

***************************************************************************************************
Prof. Christophe ANCEY
Fluid Mechanics Professor
Hydraulics and Geophysical Fluid Dynamics Group
Ecole Polytechnique Fédérale de Lausanne
(Swiss Federal Institute of Technology, Lausanne)
http://www.epfl.ch

EPFL/ENAC/IIC/LHE
station 18 Ecublens
CH 1015 LAUSANNE
SWITZERLAND

tel. : +41(0)21 693 32 87
fax. : +41(0)21 693 67 67
http://lhe.epfl.ch

Associate Editor for Water Resources Research
Associate Editor for Journal of Geophysical Research: Earth Surface
http://publications.agu.org/journals/
________________________________________
De : claw-...@googlegroups.com <claw-...@googlegroups.com> de la part de Kyle Mandli <kyle....@gmail.com>
Envoyé : mardi 15 octobre 2019 16:34:29
À : Claw Users Mailing List
Objet : Re: [claw-users] Geoclaw parallelization
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/12F8C9DD-E005-46F8-9C36-4DAA919C6E57%40gmail.com.
article_avac_en.pdf

vincen...@free.fr

unread,
Oct 15, 2019, 11:29:05 AM10/15/19
to claw-users
yes, this is part of a bunch of files my colleague sent to me (he is the specialist of fluid mechanics, I am sadly not...). Here is the basic directory where I run the code from:


Le mardi 15 octobre 2019 16:34:31 UTC+2, Kyle Mandli a écrit :
Is `module_voellmy.f90` something you added?

Kyle

> To unsubscribe from this group and stop receiving emails from it, send an email to claw-...@googlegroups.com.

Kyle Mandli

unread,
Oct 16, 2019, 5:14:47 PM10/16/19
to Claw Users Mailing List
That looks to be an issue in generating a reading the data file then.  Looking at the code though it looks like in the src2 routine that you are continually reading and setting the data in the module_voellmy which very well may not be thread safe.  Instead I would suggest modifying setprob.f90 to set this once in the beginning of the run.

Kyle

To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/e12cd1f5-a5ef-4f6c-bb57-4be23e1eff52%40googlegroups.com.

vincen...@free.fr

unread,
Oct 17, 2019, 2:06:32 AM10/17/19
to claw-users
Kyle,
glad you took the trouble to look into our issue!
On the purely technical point of view I guess Christophe will soon post a reply to your suggestion.
Thanks again,
Vincent.

Le mercredi 16 octobre 2019 23:14:47 UTC+2, Kyle Mandli a écrit :
That looks to be an issue in generating a reading the data file then.  Looking at the code though it looks like in the src2 routine that you are continually reading and setting the data in the module_voellmy which very well may not be thread safe.  Instead I would suggest modifying setprob.f90 to set this once in the beginning of the run.

Kyle

Christophe Ancey

unread,
Oct 17, 2019, 9:50:55 AM10/17/19
to claw-users
Dear Kyle,
Thanks for your prompt reply. I now remember what I did wrong. I created a setprobv.f90 file (with a slightly different name), but failed to link it properly with the other executables in the Makefile, and do not ask me why, instead of using a setprob.f90 file in my directory, I called the set_voellmy function directly from the src2.f90 file. I told Vincent that the error he got when compiling the code probably came from this repeated call.

Ok now, this works fine if I use the original filename setprob.f90.


By the way, after testing the various shallow-water solvers last month, I faced a number of problems. As soon as I have more time, I will post what I have found.

Best,
Christophe

Le mercredi 16 octobre 2019 23:14:47 UTC+2, Kyle Mandli a écrit :
That looks to be an issue in generating a reading the data file then.  Looking at the code though it looks like in the src2 routine that you are continually reading and setting the data in the module_voellmy which very well may not be thread safe.  Instead I would suggest modifying setprob.f90 to set this once in the beginning of the run.

Kyle

Reply all
Reply to author
Forward
0 new messages