Nek5000 / nekRS

our next generation fast and scalable CFD code
https://nek5000.mcs.anl.gov/
Other
284 stars 75 forks source link

A sanity check for the use of the boundary ID. #392

Closed yslan closed 2 years ago

yslan commented 3 years ago

Is your feature request related to a problem? Please describe.

By default, Nek5000 will set the variable boundaryID by the sideset id of the mesh boundaryID(ifc,iel) = bc(5,ifc,iel,1)

NekRS, use boundaryID to map the boundary types from par file's boundaryTypeMap

If user forgets to zero out the boundaryID before the mapping, it will cause a MPI error that is hard figuring out the mapping is wrong. For example, if there are more boundaryID values than the the boundaryTypeMap

  boundaryID(ifc,iel)=1, 2, ... 10
  boundaryTypeMap = t, t

Then, the code will give this error (on a CPU machine):

loading mesh from nek ... NboundaryIDs: 9, NboundaryFaces: 135132 done (0.00953882s)
generating mesh ... Nq: 6 cubNq: 8
computing geometric factors ... 
[node003:424520] *** An error occurred in MPI_Waitall
[node003:424520] *** reported by process [3245670401,83]
[node003:424520] *** on communicator MPI COMMUNICATOR 4 DUP FROM 3
[node003:424520] *** MPI_ERR_TRUNCATE: message truncated
[node003:424520] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
[node003:424520] ***    and potentially your MPI job)
[node001:454378] 1 more process has sent help message help-mpi-errors.txt / mpi_errors_are_fatal

It's users fault to set up a wrong boundary ID map. However, it'd be nice, if it prints at least warning into the logfile instead of hitting the MPI errors.

Describe the solution you'd like When boundaryTypeMap is used, we check whether the map from boundaryID to boundaryTypeMap are bijective.

This issue might be naturally resolved if #289 is implemented.

stgeke commented 2 years ago

We check for unmapped boundaryIDs already. Not sure why it doesn't work for you. Would you mind having a look?

stgeke commented 2 years ago

Fixed in https://github.com/Nek5000/nekRS/commit/9ae887200454a3409e8a0c324bde9989815716c3