Mercurium is a C/C++/Fortran source-to-source compilation infrastructure aimed at fast prototyping developed by the Programming Models group at the Barcelona Supercomputing Center
GNU Lesser General Public License v3.0
70
stars
23
forks
source link
Fix registering of specific names of generic intrinsics #13
A few intrinsics have specific names that correspond to particular
instances of the intrinsics themselves. During initialization of
the intrinsics we create them as instances of their generic intrinsics.
For specific intrinsics with the same name as the generic one we do
this correctly but for those with different names we were doing it wrong.
First looks like there is no reason to overwrite the name used to
register the specific name with the name of the generic symbol,
so just don't overwrite it and use the given name.
Second the generic symbol does not know whether it will be elemental
or not. This is known at the point of creating the specific function.
We can discuss if this is sensible and we may have to fix this if
at some point the language tries to reason at the generic level. For now
it does not do this, so just propagate the correct attributes from
the specific intrinsic.
With this change we can compile specfem3d 7.0.0 with plainfc
using OpenMPI (with minor changes in parallel.f90 to use mpif.h
instead of the mpi module of OpenMPI itself because we cannot use it yet).
A few intrinsics have specific names that correspond to particular instances of the intrinsics themselves. During initialization of the intrinsics we create them as instances of their generic intrinsics.
For specific intrinsics with the same name as the generic one we do this correctly but for those with different names we were doing it wrong.
First looks like there is no reason to overwrite the name used to register the specific name with the name of the generic symbol, so just don't overwrite it and use the given name.
Second the generic symbol does not know whether it will be elemental or not. This is known at the point of creating the specific function. We can discuss if this is sensible and we may have to fix this if at some point the language tries to reason at the generic level. For now it does not do this, so just propagate the correct attributes from the specific intrinsic.
With this change we can compile specfem3d 7.0.0 with plainfc using OpenMPI (with minor changes in parallel.f90 to use mpif.h instead of the mpi module of OpenMPI itself because we cannot use it yet).