From 1500e4748c74ddf443c1b8740397a063061137f6 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 4 Dec 2023 14:30:20 +0100 Subject: [PATCH 1/4] Develop doc of updateTag function. --- src/tag_pmmg.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/tag_pmmg.c b/src/tag_pmmg.c index e3a56f54..eb6d0fb0 100644 --- a/src/tag_pmmg.c +++ b/src/tag_pmmg.c @@ -261,7 +261,9 @@ inline int PMMG_resetOldTag(PMMG_pParMesh parmesh) { * * \return 0 if fail, 1 otherwise * - * Update the tag on the points and tetra + * Update the parallel-related tags on the points and tetra: first, remove + * obsolete parallel markers; second, re-tag boundary entites; third, tag new + * parallel interfaces from the internal communicator. * */ int PMMG_updateTag(PMMG_pParMesh parmesh) { @@ -289,15 +291,22 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) { pt = &mesh->tetra[k]; if ( !pt->xt ) continue; pxt = &mesh->xtetra[pt->xt]; - /* Untag parallel nodes */ + /* Untag parallel nodes: remove PARBDY, BDY, REQ, PARBDYBDY and NOSURF + * tag. Point not marked by NOSURF tag are required by the user: re-add + * the REQ tag. */ for ( j=0 ; j<4 ; j++ ) { ppt = &mesh->point[pt->v[j]]; PMMG_untag_par_node(ppt); } - /* Untag parallel edges */ + /* Untag parallel edges: remove PARBDY, BDY, REQ, PARBDYBDY and NOSURF + * tag. Point not marked by NOSURF tag are required by the user: re-add + * the REQ tag. */ for ( j=0 ; j<6 ; j++ ) PMMG_untag_par_edge(pxt,j); - /* Untag parallel faces */ + /* Untag parallel faces: remove PARBDY, BDY, REQ and NOSURF tags but nor + * PARBDYBDY one (used to recognize BDY faces whose BDY tag has been + * removed). Point not marked by NOSURF tag are required by the user: + * re-add the REQ tag. */ for ( j=0 ; j<4 ; j++ ) PMMG_untag_par_face(pxt,j); } @@ -432,7 +441,9 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) { * so remove the MG_NOSURF tag if the edge is truly required */ if( pxt->tag[j] & MG_REQ ) gettag &= ~MG_NOSURF; - /* set edge tag */ + /* set edge tag (without NOSURF tag if the edge is required by the + * user): here we preserve the initial MG_REQ tag of each tetra, thus, + * potential inconsistencies will not be solved. */ pxt->tag[j] |= gettag; } } From ea6300d96ed99d74cba5e9de1203abe74bb389f9 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 4 Dec 2023 14:33:19 +0100 Subject: [PATCH 2/4] Remove useless code in PMMG_updateTag function When a required edge is added to the hash table, it is added without any tag, then we add the MG_BDY tag so the first time that we call hGet, we found gettag==MG_BDY and the test gettag is not MG_REQ answers always. In consequence, we add the MG_REQ + MG_NOSURF tag to all the edges (even the user required once). Note that user required edges are nevertheless preserved because during the step 4 we check the tag that is stored in each xtetra (and user's required tags have been preserved) and we remove the spurious NOSURF tag from the tag that is founded in the hash table. --- src/tag_pmmg.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/tag_pmmg.c b/src/tag_pmmg.c index eb6d0fb0..9776fa7c 100644 --- a/src/tag_pmmg.c +++ b/src/tag_pmmg.c @@ -355,14 +355,6 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) { ip0 = pt->v[MMG5_iare[ia][0]]; ip1 = pt->v[MMG5_iare[ia][1]]; if( !MMG5_hTag( &hash, ip0, ip1, 0, MG_BDY ) ) return 0; - /* Constrain boundary if -nosurf option */ - if( mesh->info.nosurf ) { - if( !MMG5_hGet( &hash, ip0, ip1, &getref, &gettag ) ) return 0; - if( !(gettag & MG_REQ) ) { - /* do not add the MG_NOSURF tag on a required entity */ - if( !MMG5_hTag( &hash, ip0, ip1, 0, MG_REQ + MG_NOSURF ) ) return 0; - } - } } /* Tag face nodes */ for ( j=0 ; j<3 ; j++) { From 077971ecbcbad58012c8c866f8982fd495854aa3 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 4 Dec 2023 17:08:13 +0100 Subject: [PATCH 3/4] Update Mmg git tag to feature/fix-invalid-pointer. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 948e117d..a8197f85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,7 +254,7 @@ IF ( DOWNLOAD_MMG ) EXTERNALPROJECT_ADD ( Mmg GIT_REPOSITORY https://github.com/MmgTools/mmg.git - GIT_TAG 31769770b + GIT_TAG bdbf11ada1a9c44d179636f7f2ebe00ce76f0558 INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install CMAKE_ARGS ${MMG_ARGS} -DUSE_ELAS=OFF ${COMPILER_CFG} ${FLAGS_CFG} ${SCOTCH_CFG} ${VTK_CFG} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} From b3cc0645c4153fcfb21943d927e00bdf6911d839 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 5 Dec 2023 17:18:12 +0100 Subject: [PATCH 4/4] Attempt to fix issue with openmpi-5 and --help command to detect oversubscribe command line option support. --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8197f85..c13794b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,13 +178,11 @@ MESSAGE( STATUS "Compilation with mpi" ) SET( LIBRARIES ${MPI_C_LIBRARIES} ${LIBRARIES} ) SET( LIBRARIES ${MPI_CXX_LIBRARIES} ${LIBRARIES} ) -EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --help mapping +EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --oversubscribe sleep 1 RESULT_VARIABLE CMD_ERROR OUTPUT_VARIABLE CMD_OUTPUT ) -STRING(REGEX REPLACE "\"" " " CMD_OUT "${CMD_OUTPUT}") - -IF ( "${CMD_OUT}" MATCHES "oversubscribe" ) +IF ( "${CMD_ERROR}" MATCHES "0" ) SET ( MPI_ARGS "-oversubscribe" ) ENDIF()