NOAA-EMC / NEMS

NEMS (NOAA Environmental Modeling System)
https://noaa-emc.github.io/NEMS_doc/index.html
Other
11 stars 46 forks source link

negative crc32 hash causing errors in MPI_Comm_split (module_NEMS_Rusage.F90) #77

Open xychen-ocn opened 3 years ago

xychen-ocn commented 3 years ago

I encountered this issue (as stated in the title) when testing the ADC-WW3-NWM-NEMS coupling app on the UNC Hatteras cluster. In _module_NEMSRusage.F90 and in the subroutine _color_byhash, the Fortran version of crc32 hash returned from the CRC algorithm (_nems_crusage.c) is negative. I think the problem is that the C function returns the crc32 hash as an unsigned integer data type (uint32_t), but in Fortran, the only available datatype is the signed integer (int32_t). I am not sure if this indicates a bug in my compiler (openmpi 3.0.0)'s Fortran 2003 support or not (as noted at the beginning of this module). I also wonder if taking the absolute value of the negative Fortran hash can be a workaround for this machine/compiler dependent issue.