Bonjour a tous,
I'm working with Eduardo Cipriano's (EC)evaporation code (thanks Eduardo!), however, this one baffled us both.
I ran into a situation which hasn't occured in EC's sandbox.
Since I don't often compute in sandboxes only on a local machine, I pulled the entire codebase, then tried to compile EC's test case 'fixedvolumebubble.c' this way:
,----
| qcc -std=c99 -disable-dimensions -Wall -O2 -Isandbox/src fbv.c -o fbv -lm -grid=quadtree -L$BASILISK/gl -lglutils -lfb_tiny
`----
which works fine. (btw. sandbox/src is a handy local copy of the entire EC code colleciton). Now, if I were to use OpenMP (mind you, not MPI), we'd use:
,----
| qcc -std=c99 -disable-dimensions -Wall -O2 -fopenmp -Isandbox/src fbv.c -o fbv -lm -grid=quadtree -L$BASILISK/gl -lglutils -lfb_tiny
`----
...wherein lies the issue. Namely, we get:
,----
| wojciech@orion:~/simulations/20260923_fixedbubblevelocity(0)$ qcc -std=c99 -disable-dimensions -fopenmp -Wall -O2 -Isandbox/src fbv.c -o fbv -lm -grid=quadtree -L$BASILISK/gl -lglutils -lfb_tiny
|
| /home/wojciech/code/c/basilisk/src/grid/stencils.h: In function ‘check_stencil’:
| /home/wojciech/code/c/basilisk/src/grid/stencils.h:174:24: warning: variable ‘i’ set but not used [-Wunused-but-set-variable=]
| /home/wojciech/code/c/basilisk/src/grid/tree.h: In function ‘phase_mass_balance’:
| sandbox/src/common-evaporation.h:33:16: error: expected an OpenMP clause before ‘serial’
| /home/wojciech/code/c/basilisk/src/grid/config.h:577:27: note: in expansion of macro ‘OMP’
| /home/wojciech/code/c/basilisk/src/grid/tree.h:454:3: note: in expansion of macro ‘OMP_PARALLEL’
`----
Sorry for the first two lines of warnings, resulting obviously from my pedantic -Wall switch. What this mail is about is "error: expected an OpenMP clause before ‘serial’", having to do with EC's variadic macro 'foreach_interfacial', which lives in common-evaporation.h and looks like this:
,----
| macro foreach_interfacial (scalar f, double tol = 1e-10,
| Reduce reductions = None)
| {
| foreach(0, reductions) {
| POINT_VARIABLES();
| if (f[] > tol && f[] < 1. - tol)
| {...}
| }
| }
`----
So my question, can anybody ELI5 (explain like I'm five) what's the problem that OpenMP has with variadic macros? Can this be rewritten? (Of course, I don't HAVE to use OpenMP, can use MPI, but I'm simply curious. Eduardo says the code works with MPI so no hassle). Just posting it here out of curiosity.
[And to not overuse our LLM overlords' computing power in vain... ]
kindly
Voitek
--
/^..^\
( (••) ) Wojciech (Vôitek) ANISZEWSKI
(|)_._(|)~ Research Assistant @ Univ. Paris-Saclay (EM2C)
GPG ID : AC66485E
Twitter : @echo_dancers3
Mastodon: @
w...@fediscience.org
BlueSky : @aniszewski.bsky.social
Scholar :
https://tinyurl.com/y28b8gfp
OrcId :
https://orcid.org/0000-0002-4248-1194
RG :
https://www.researchgate.net/profile/Wojciech_Aniszewski