trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
537 stars 109 forks source link

Defining functions in global testing namespace can lead to problems #623

Closed efaulhaber closed 3 years ago

efaulhaber commented 3 years ago

In elixirs like examples/2d/elixir_advection_free_stream_curved.jl, a function mapping is defined in the global testing namespace. Defining, e.g., mapping = Trixi.coordinates2mapping(coordinates_min, coordinates_max) in another example causes tests to fail with LoadError: cannot define function mapping; it already has a value.

efaulhaber commented 3 years ago

As @ranocha pointed out, the function refine_fn in the p4est elixirs can cause the same problems. https://github.com/trixi-framework/Trixi.jl/pull/621#discussion_r642033857

ranocha commented 3 years ago

Concerning p4est functions: The workaround using let blocks uses features that are not necessarily available on all systems. For example, the relevant Julia docs mention ARM and PowerPC. Does p4est work there?

ranocha commented 3 years ago

Concerning tests: I will look into this

sloede commented 3 years ago

the relevant Julia docs mention ARM and PowerPC. Does p4est work there?

The P4est_jll.jl packages is currently available for all platforms supported by Julia. Of course I have not been able to test it everywhere, but considering that there are supercomputers out there being equipped with ARM CPUs, I'd favor a solution - if possible - that does not preclude these architectures :grimacing:

ranocha commented 3 years ago

Okay, we won't use this feature to interface C stuff