From 8fc6eb785dd71f34fb5c7c12e32266b05657d88b Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 12:27:52 +0100 Subject: [PATCH 1/7] Add an option to partition a centralized input file - add the -pure-partitioning command line argument - the PMMG_IPARAM_puerPartitioning keyword This allow to only perform mesh partitioning and output file saving (no ls insertion and no remeshing). For now it works only from centralized input. Fix small things: - set artificially the number of iter to 0 when niter is 0 or pure-repartitioning option is enabled (otherwise the communicators are not saved in medit file and we cannot restart from the medit output) - attempt to suitablily set output ls name - add writing of output Ls (if allocated) at hdf5 format (It was not called, I don't know why) - not tested --- cmake/testing/pmmg_tests.cmake | 109 +++++++++++++++++++ src/API_functions_pmmg.c | 77 ++++++++++++++ src/API_functionsf_pmmg.c | 38 +++++++ src/inout_pmmg.c | 129 +++++++++++++++++++++++ src/libparmmg.c | 185 ++++++++++++++++++++------------- src/libparmmg.h | 61 ++++++++++- src/libparmmg_tools.c | 26 +++++ src/libparmmgtypes.h | 3 +- src/mergemesh_pmmg.c | 3 + src/mpiunpack_pmmg.c | 5 + src/parmmg.c | 15 +++ 11 files changed, 574 insertions(+), 77 deletions(-) diff --git a/cmake/testing/pmmg_tests.cmake b/cmake/testing/pmmg_tests.cmake index 49ae8d18..93d8b76f 100644 --- a/cmake/testing/pmmg_tests.cmake +++ b/cmake/testing/pmmg_tests.cmake @@ -363,6 +363,114 @@ IF( BUILD_TESTING ) -out ${CI_DIR_RESULTS}/InterpolationFields-refinement-4-out.mesh -field ${CI_DIR}/Interpolation/cube-unit-coarse-field.sol ${myargs} ) + ############################################################################### + ##### + ##### Tests pure-partitioning option + ##### + ############################################################################### + add_test( NAME PurePartitioning-CenIn-DisOut-withMetAndFields + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-metAndFields-4-out.mesh + -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol + -sol field3_iso-coarse.sol + -pure-partitioning + -distributed-output ) + + add_test( NAME PurePartitioning-CenIn-CenOut-withMetAndFields + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-CenOut-metAndFields-4-out.mesh + -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol + -sol field3_iso-coarse.sol + -pure-partitioning + -centralized-output ) + + add_test( NAME PurePartitioning-CenIn-CenOut + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-CenOut-4-out.mesh + -pure-partitioning + -centralized-output ) + + add_test( NAME PurePartitioning-CenIn-DisOut + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-4-out.mesh + -pure-partitioning + -distributed-output ) + + add_test( NAME PurePartitioning-CenIn-DisOut-withMet + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-met-4-out.mesh + -sol field3_iso-coarse.sol + -pure-partitioning + -distributed-output ) + + add_test( NAME PurePartitioning-CenIn-CenOut-withMet + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-CenOut-met-4-out.mesh + -sol field3_iso-coarse.sol + -pure-partitioning + -centralized-output ) + + add_test( NAME PurePartitioning-CenIn-h5-withMetAndFields + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ + ${CI_DIR}/Interpolation/coarse.meshb + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-h5-metAndFields-4-out.h5 + -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol + -sol field3_iso-coarse.sol + -pure-partitioning ) + + add_test( NAME PurePartitioning-CenIn-DisOut-withMetAndLs-2 + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 2 $ + ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh + -ls + -pure-partitioning + -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol + -met ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-metric.sol + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withMetAndLs-2.o.mesh) + + add_test( NAME PurePartitioning-CenIn-h5-withMetAndLs-2 + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 2 $ + ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh + -ls + -pure-partitioning + -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol + -met ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-metric.sol + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withMetAndLs-2.o.h5) + + add_test( NAME PurePartitioning-CenIn-DisOut-withLs-2 + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 2 $ + ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh + -ls + -pure-partitioning + -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withLs-2.o.mesh) + + add_test( NAME PurePartitioning-CenIn-h5-withLs-2 + COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 2 $ + ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh + -ls + -pure-partitioning + -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol + -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withLs-2.o.h5) + + + IF ( (NOT HDF5_FOUND) OR USE_HDF5 MATCHES OFF ) + SET(expr "HDF5 library not found") + SET_PROPERTY( + TEST + PurePartitioning-CenIn-h5-withMetAndFields + PurePartitioning-CenIn-h5-withMetAndLs-2 + PurePartitioning-CenIn-h5-withLs-2 + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") + ENDIF ( ) + + + ############################################################################### ##### ##### Tests distributed surface adaptation @@ -426,6 +534,7 @@ IF( BUILD_TESTING ) ENDFOREACH() ENDFOREACH() + # Test to verify the patch on update MG_REF tag. # This test fail if the tag MG_REF is not updated by PMMG_updateTagRef_node in PMMG_update_analys. # See ParMmg PR#103 diff --git a/src/API_functions_pmmg.c b/src/API_functions_pmmg.c index e1ea7874..b4d5daa0 100644 --- a/src/API_functions_pmmg.c +++ b/src/API_functions_pmmg.c @@ -382,6 +382,77 @@ int PMMG_Set_outputSolsName(PMMG_pParMesh parmesh, const char* solout) { return ier; } +int PMMG_Set_outputLsName(PMMG_pParMesh parmesh, const char* lsout) { + MMG5_pMesh mesh; + MMG5_pSol ls; + int k,ier,pathlen,baselen; + char *basename,*path,*nopath; + + /* If \a lsout is not provided we want to use the basename of the input ls + * name and the path of the output mesh name */ + if ( parmesh->lsout ) { + PMMG_DEL_MEM(parmesh,parmesh->fieldout,char,"fieldout unalloc"); + } + + if ( (!lsout) || (!*lsout) ) { + + if ( (!parmesh->meshout) || (!*parmesh->meshout) ) { + fprintf(stderr, " ## Error: %s: please, provide an output mesh" + " name before calling this function without string.\n", + __func__); + return 0; + } + + /* Get input field base name and remove .mesh extension */ + if ( (!parmesh->lsin) || (!*parmesh->lsin) ) { + fprintf(stderr, " ## Error: %s: please, provide an input field" + " name before calling this function without string.\n", + __func__); + return 0; + } + + path = MMG5_Get_path(parmesh->meshout); + nopath = MMG5_Get_basename(parmesh->lsin); + basename = MMG5_Remove_ext ( nopath,".sol" ); + + pathlen = baselen = 0; + if ( path ) pathlen = strlen(path)+1; + if ( basename ) baselen = strlen(basename); + PMMG_MALLOC(parmesh,parmesh->lsout,pathlen+baselen+1,char,"lsout",return 0); + if ( pathlen ) { + strncpy(parmesh->lsout,path,pathlen-1); + parmesh->lsout[pathlen-1] = MMG5_PATHSEP; + } + if ( baselen ) { + strncpy(parmesh->lsout+pathlen,basename,baselen); + parmesh->lsout[pathlen+baselen] = '\0'; + } + + if ( parmesh->lsout ) { + /* Add .o.sol extension */ + PMMG_REALLOC(parmesh,parmesh->lsout,strlen(parmesh->lsout)+7, + strlen(parmesh->lsout)+1,char,"lsout",return 0); + strncat ( parmesh->lsout,".o.sol",7 ); + } + + MMG5_SAFE_FREE ( path ); + free ( nopath ); nopath = NULL; + MMG5_SAFE_FREE ( basename ); + } + else { + PMMG_MALLOC(parmesh,parmesh->lsout,strlen(lsout)+1,char,"lsout",return 0); + strcpy(parmesh->lsout,lsout); + } + + for ( k=0; kngrp; ++k ) { + mesh = parmesh->listgrp[k].mesh; + ls = parmesh->listgrp[k].ls; + ier = MMG3D_Set_outputSolName(mesh,ls,parmesh->lsout); + } + return ier; +} + + int PMMG_Set_outputMetName(PMMG_pParMesh parmesh, const char* metout) { MMG5_pMesh mesh; MMG5_pSol met; @@ -627,6 +698,11 @@ int PMMG_Set_iparameter(PMMG_pParMesh parmesh, int iparam,int val) { parmesh->ddebug = val; break; + case PMMG_IPARAM_purePartitioning : + + parmesh->info.pure_partitioning = val; + break; + case PMMG_IPARAM_distributedOutput : if ( val == 1 ) { @@ -2795,6 +2871,7 @@ int PMMG_Free_names(PMMG_pParMesh parmesh) PMMG_DEL_MEM ( parmesh, parmesh->metin,char,"metin" ); PMMG_DEL_MEM ( parmesh, parmesh->metout,char,"metout" ); PMMG_DEL_MEM ( parmesh, parmesh->lsin,char,"lsin" ); + PMMG_DEL_MEM ( parmesh, parmesh->lsout,char,"lsout" ); PMMG_DEL_MEM ( parmesh, parmesh->dispin,char,"dispin" ); PMMG_DEL_MEM ( parmesh, parmesh->fieldin,char,"fieldin" ); PMMG_DEL_MEM ( parmesh, parmesh->fieldout,char,"fieldout" ); diff --git a/src/API_functionsf_pmmg.c b/src/API_functionsf_pmmg.c index be8002cd..fe47ec71 100644 --- a/src/API_functionsf_pmmg.c +++ b/src/API_functionsf_pmmg.c @@ -1356,6 +1356,44 @@ FORTRAN_NAME(PMMG_SAVEMET_DISTRIBUTED,pmmg_savemet_distributed, return; } +/** + * See \ref PMMG_saveLs_centralized function in \ref libparmmg.h file. + */ +FORTRAN_NAME(PMMG_SAVELS_CENTRALIZED,pmmg_savels_centralized, + (PMMG_pParMesh *parmesh,char* filename, int *strlen,int* retval), + (parmesh,filename,strlen,retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,(*strlen+1),char,); + strncpy(tmp,filename,*strlen); + tmp[*strlen] = '\0'; + + *retval = PMMG_saveLs_centralized(*parmesh,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + +/** + * See \ref PMMG_saveLs_distributed function in \ref libparmmg.h file. + */ +FORTRAN_NAME(PMMG_SAVELS_DISTRIBUTED,pmmg_savels_distributed, + (PMMG_pParMesh *parmesh,char* filename, int *strlen,int* retval), + (parmesh,filename,strlen,retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,(*strlen+1),char,); + strncpy(tmp,filename,*strlen); + tmp[*strlen] = '\0'; + + *retval = PMMG_saveLs_distributed(*parmesh,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + /** * See \ref PMMG_saveAllSols_centralized function in \ref libparmmg.h file. */ diff --git a/src/inout_pmmg.c b/src/inout_pmmg.c index 496175bd..777d1c84 100644 --- a/src/inout_pmmg.c +++ b/src/inout_pmmg.c @@ -1158,6 +1158,57 @@ int PMMG_saveMet_distributed(PMMG_pParMesh parmesh,const char *filename) { return ier; } +int PMMG_saveLs_centralized(PMMG_pParMesh parmesh,const char *filename) { + MMG5_pMesh mesh; + MMG5_pSol *sol; + int ier; + + if ( parmesh->myrank!=parmesh->info.root ) { + return 1; + } + + if ( parmesh->ngrp != 1 ) { + fprintf(stderr," ## Error: %s: you must have exactly 1 group in you parmesh.\n", + __func__); + return 0; + } + mesh = parmesh->listgrp[0].mesh; + sol = &parmesh->listgrp[0].ls; + + /* Except in cases where we want to partition and input mesh + ls without + * inserting the ls and remeshing, the level-set will be deallocated */ + if ( (!*sol) || (!(*sol)->m) ) { + if ( parmesh->ddebug ) { + fprintf(stdout," %s: The Level-set is not allocated. Nothing to save.\n", + __func__); + } + return 1; + } + + /* Set mmg verbosity to the max between the Parmmg verbosity and the mmg verbosity */ + assert ( mesh->info.imprim == parmesh->info.mmg_imprim ); + mesh->info.imprim = MG_MAX ( parmesh->info.imprim, mesh->info.imprim ); + + /* Dirty hack: temporary replace the number of solution fields inside the mesh to allow the use of the saveAllSols function */ + int nfields = mesh->nsols; + mesh->nsols = 1; + + if ( filename && *filename ) { + ier = MMG3D_saveAllSols(mesh,sol,filename); + } + else { + ier = MMG3D_saveAllSols(mesh,sol,parmesh->lsout); + } + + /* Restore the mmg verbosity to its initial value */ + mesh->info.imprim = parmesh->info.mmg_imprim; + + /* Restore the number of solution fields */ + mesh->nsols = nfields; + + return ier; +} + int PMMG_saveAllSols_centralized(PMMG_pParMesh parmesh,const char *filename) { MMG5_pMesh mesh; MMG5_pSol sol; @@ -1192,6 +1243,70 @@ int PMMG_saveAllSols_centralized(PMMG_pParMesh parmesh,const char *filename) { return ier; } +int PMMG_saveLs_distributed(PMMG_pParMesh parmesh,const char *filename) { + MMG5_pMesh mesh; + MMG5_pSol sol; + int ier; + char *data = NULL; + + if ( parmesh->ngrp != 1 ) { + fprintf(stderr," ## Error: %s: you must have exactly 1 group in you parmesh.\n", + __func__); + return 0; + } + mesh = parmesh->listgrp[0].mesh; + sol = parmesh->listgrp[0].ls; + + /* Except in cases where we want to partition and input mesh + ls without + * inserting the ls and remeshing, the level-set will be deallocated */ + int noLs; + + // noLsOnRank has to be 1 if we don't have the ls on the rank, 0 if ls is allocated + int noLsOnRank = ((!sol) || (!sol->m)) ? 1 : 0; + + MPI_Allreduce( &noLsOnRank, &noLs, 1, MPI_INT, MPI_MIN, parmesh->comm ); + + if ( noLs ) { + if ( parmesh->ddebug && parmesh->myrank==parmesh->info.root ) { + fprintf(stdout," %s: The Level-set is not allocated. Nothing to save.\n", + __func__); + } + return 1; + } + + if ( noLsOnRank ) { + fprintf(stderr," ## Error: %s: Distributed saving with empty level-set on one rank not implemented.\n", + __func__); + return 0; + } + + /* Add rank index to mesh name */ + if ( filename ) { + PMMG_insert_rankIndex(parmesh,&data,filename,".sol", ".sol"); + } + else if ( parmesh->lsout ) { + PMMG_insert_rankIndex(parmesh,&data,parmesh->lsout,".sol", ".sol"); + } + + /* Set mmg verbosity to the max between the Parmmg verbosity and the mmg verbosity */ + assert ( mesh->info.imprim == parmesh->info.mmg_imprim ); + mesh->info.imprim = MG_MAX ( parmesh->info.imprim, mesh->info.imprim ); + + /* Dirty hack: temporary replace the number of solution fields inside the mesh to allow the use of the saveAllSols function */ + int nfields = mesh->nsols; + mesh->nsols = 1; + + ier = MMG3D_saveAllSols(mesh,&sol,data); + + /* Restore the mmg verbosity to its initial value */ + mesh->info.imprim = parmesh->info.mmg_imprim; + + /* Restore the number of solution fields */ + mesh->nsols = nfields; + + return ier; +} + int PMMG_saveAllSols_distributed(PMMG_pParMesh parmesh,const char *filename) { MMG5_pMesh mesh; MMG5_pSol *sol; @@ -3233,6 +3348,20 @@ int PMMG_saveMesh_hdf5_i(PMMG_pParMesh parmesh, int *save_entities, const char * goto free_and_return; } + ier = PMMG_saveLs_hdf5(parmesh, grp_sols_id, dcpl_id, dxpl_id, nentitiesl, nentitiesg, offset); + + MPI_CHECK( MPI_Allreduce(MPI_IN_PLACE, &ier, 1, MPI_INT, MPI_MIN, parmesh->comm), + H5Gclose(grp_sols_id); + goto free_and_return ); + + if (!ier) { + if (parmesh->myrank == parmesh->info.root) { + fprintf(stderr,"\n ## Error: %s: Could not write the level-set.\n",__func__); + } + H5Gclose(grp_sols_id); + goto free_and_return; + } + ier = PMMG_saveAllSols_hdf5(parmesh, grp_sols_id, dcpl_id, dxpl_id, nentitiesl, nentitiesg, offset); MPI_CHECK( MPI_Allreduce(MPI_IN_PLACE, &ier, 1, MPI_INT, MPI_MIN, parmesh->comm), diff --git a/src/libparmmg.c b/src/libparmmg.c index 3063cf1e..fdf3d0f9 100644 --- a/src/libparmmg.c +++ b/src/libparmmg.c @@ -181,24 +181,26 @@ int PMMG_preprocessMesh( PMMG_pParMesh parmesh ) return PMMG_STRONGFAILURE; } - /* Discretization of the isovalue */ - if (mesh->info.iso) { - tim = 1; - chrono(ON,&(ctim[tim])); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout,"\n -- PHASE 1a: ISOVALUE DISCRETIZATION \n"); - } - if ( !MMG3D_mmg3d2(mesh,ls,met) ) { - return PMMG_STRONGFAILURE; - } - /* Update mesh->npi and mesh->nei to be equal to mesh->np and mesh->ne, respectively */ - mesh->npi = mesh->np; - mesh->nei = mesh->ne; + if ( !parmesh->info.pure_partitioning ) { + /* Discretization of the isovalue */ + if (mesh->info.iso) { + tim = 1; + chrono(ON,&(ctim[tim])); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout,"\n -- PHASE 1a: ISOVALUE DISCRETIZATION \n"); + } + if ( !MMG3D_mmg3d2(mesh,ls,met) ) { + return PMMG_STRONGFAILURE; + } + /* Update mesh->npi and mesh->nei to be equal to mesh->np and mesh->ne, respectively */ + mesh->npi = mesh->np; + mesh->nei = mesh->ne; - chrono(OFF,&(ctim[tim])); - printim(ctim[tim].gdif,stim); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout," -- PHASE 1a COMPLETED %s\n",stim); + chrono(OFF,&(ctim[tim])); + printim(ctim[tim].gdif,stim); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout," -- PHASE 1a COMPLETED %s\n",stim); + } } } @@ -207,14 +209,17 @@ int PMMG_preprocessMesh( PMMG_pParMesh parmesh ) return PMMG_STRONGFAILURE; } - /* Check if the LS has led to a non-manifold topology */ - if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { - fprintf(stderr,"\n ## LS discretization: non-manifold initial topology. Exit program.\n"); - return PMMG_STRONGFAILURE; - } - else { - if ( parmesh->info.imprim > PMMG_VERB_VERSION && mesh->info.iso ) { - fprintf(stdout," LS discretization OK: no non-manifold topology.\n"); + if ( !parmesh->info.pure_partitioning ) { + + /* Check if the LS has led to a non-manifold topology */ + if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { + fprintf(stderr,"\n ## LS discretization: non-manifold initial topology. Exit program.\n"); + return PMMG_STRONGFAILURE; + } + else { + if ( parmesh->info.imprim > PMMG_VERB_VERSION && mesh->info.iso ) { + fprintf(stdout," LS discretization OK: no non-manifold topology.\n"); + } } } @@ -395,35 +400,38 @@ int PMMG_preprocessMesh_distributed( PMMG_pParMesh parmesh ) } MMG5_SAFE_FREE( permtria ); - /** Discretization of the isovalue */ - if (mesh->info.iso) { + if ( !parmesh->info.pure_partitioning ) { - /* Destroy adja and adjat */ - MMG5_DEL_MEM(mesh,mesh->adja); - MMG5_DEL_MEM(mesh,mesh->adjt); + /** Discretization of the isovalue */ + if (mesh->info.iso) { - tim = 1; - chrono(ON,&(ctim[tim])); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout,"\n -- PHASE 1a: ISOVALUE DISCRETIZATION \n"); - fprintf(stdout," -- under development \n"); - } - if ( !PMMG_ls(parmesh) ) { - return PMMG_STRONGFAILURE; - } - - chrono(OFF,&(ctim[tim])); - printim(ctim[tim].gdif,stim); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout,"\n -- PHASE 1a COMPLETED %s\n",stim); - } + /* Destroy adja and adjat */ + MMG5_DEL_MEM(mesh,mesh->adja); + MMG5_DEL_MEM(mesh,mesh->adjt); - /** Mesh analysis Ib : After LS discretization - * Check triangles, create xtetras */ - if ( parmesh->myrank < parmesh->info.npartin ) { - if ( !PMMG_analys_tria(parmesh,mesh,permtria) ) { + tim = 1; + chrono(ON,&(ctim[tim])); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout,"\n -- PHASE 1a: ISOVALUE DISCRETIZATION \n"); + fprintf(stdout," -- under development \n"); + } + if ( !PMMG_ls(parmesh) ) { return PMMG_STRONGFAILURE; } + + chrono(OFF,&(ctim[tim])); + printim(ctim[tim].gdif,stim); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout,"\n -- PHASE 1a COMPLETED %s\n",stim); + } + + /** Mesh analysis Ib : After LS discretization + * Check triangles, create xtetras */ + if ( parmesh->myrank < parmesh->info.npartin ) { + if ( !PMMG_analys_tria(parmesh,mesh,permtria) ) { + return PMMG_STRONGFAILURE; + } + } } } @@ -1610,6 +1618,11 @@ int PMMG_parmmglib_post(PMMG_pParMesh parmesh) { iresult = 1; + if ( parmesh->niter == 0 || parmesh->info.pure_partitioning ) { + /* set parmesh->iter to allow saving of mesh communicators */ + parmesh->iter = 0; + } + switch ( parmesh->info.fmtout ) { case ( PMMG_UNSET ): /* No output */ @@ -1765,6 +1778,18 @@ int PMMG_parmmg_centralized(PMMG_pParMesh parmesh) { } } + /* I/O check: if an input ls name is provided but the output one is not, + compute automatically an output ls name. */ + if ( parmesh->lsin && *parmesh->lsin ) { + ier = PMMG_Set_outputLsName(parmesh,NULL); + if ( !ier ) { + fprintf(stdout," ## Warning: %s: rank %d: an input field name is" + " provided without an output one.\n" + " : the saving process may fail.\n", + __func__,parmesh->myrank); + } + } + /* Distribute the mesh */ ier = PMMG_distributeMesh_centralized_timers( parmesh, ctim ); if( ier != PMMG_SUCCESS ) return ier; @@ -1782,16 +1807,18 @@ int PMMG_parmmg_centralized(PMMG_pParMesh parmesh) { met->size < 6 ? "ISOTROPIC" : "ANISOTROPIC" ); } - ier = PMMG_parmmglib1(parmesh); - MPI_Allreduce( &ier, &ierlib, 1, MPI_INT, MPI_MAX, parmesh->comm ); + if ( !parmesh->info.pure_partitioning ) { + ier = PMMG_parmmglib1(parmesh); + MPI_Allreduce( &ier, &ierlib, 1, MPI_INT, MPI_MAX, parmesh->comm ); - chrono(OFF,&(ctim[tim])); - printim(ctim[tim].gdif,stim); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout," -- PHASE 2 COMPLETED. %s\n",stim); - } - if ( ierlib == PMMG_STRONGFAILURE ) { - return ierlib; + chrono(OFF,&(ctim[tim])); + printim(ctim[tim].gdif,stim); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout," -- PHASE 2 COMPLETED. %s\n",stim); + } + if ( ierlib == PMMG_STRONGFAILURE ) { + return ierlib; + } } ier = PMMG_parmmglib_post(parmesh); @@ -1895,6 +1922,14 @@ int PMMG_parmmg_distributed(PMMG_pParMesh parmesh) { return iresult; } + if ( parmesh->info.pure_partitioning ) { + if ( parmesh->myrank == parmesh->info.root ) { + fprintf(stderr,"\n ## Error: %s: Pure repartitioning from distributed" + " input not implemented.\n",__func__); + } + return PMMG_STRONGFAILURE; + } + /* I/O check: if the mesh was loaded with nprocs != npartin (for example from hdf5 file), call loadBalancing before the remeshing loop to make sure no proc has an empty mesh (nprocs > npartin) and the load is well balanced @@ -1920,24 +1955,26 @@ int PMMG_parmmg_distributed(PMMG_pParMesh parmesh) { fprintf(stdout," -- PHASE 1 COMPLETED. %s\n",stim); } - /** Remeshing */ - tim = 3; - chrono(ON,&(ctim[tim])); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf( stdout,"\n -- PHASE 2 : %s MESHING\n", - parmesh->listgrp[0].met->size < 6 ? "ISOTROPIC" : "ANISOTROPIC" ); - } + if ( !parmesh->info.pure_partitioning ) { + /** Remeshing */ + tim = 3; + chrono(ON,&(ctim[tim])); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf( stdout,"\n -- PHASE 2 : %s MESHING\n", + parmesh->listgrp[0].met->size < 6 ? "ISOTROPIC" : "ANISOTROPIC" ); + } - ier = PMMG_parmmglib1(parmesh); - MPI_Allreduce( &ier, &ierlib, 1, MPI_INT, MPI_MAX, parmesh->comm ); + ier = PMMG_parmmglib1(parmesh); + MPI_Allreduce( &ier, &ierlib, 1, MPI_INT, MPI_MAX, parmesh->comm ); - chrono(OFF,&(ctim[tim])); - printim(ctim[tim].gdif,stim); - if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { - fprintf(stdout," -- PHASE 2 COMPLETED. %s\n",stim); - } - if ( ierlib == PMMG_STRONGFAILURE ) { - return ierlib; + chrono(OFF,&(ctim[tim])); + printim(ctim[tim].gdif,stim); + if ( parmesh->info.imprim > PMMG_VERB_VERSION ) { + fprintf(stdout," -- PHASE 2 COMPLETED. %s\n",stim); + } + if ( ierlib == PMMG_STRONGFAILURE ) { + return ierlib; + } } ier = PMMG_parmmglib_post(parmesh); diff --git a/src/libparmmg.h b/src/libparmmg.h index 0c714bad..e6d939fa 100644 --- a/src/libparmmg.h +++ b/src/libparmmg.h @@ -70,6 +70,7 @@ enum PMMG_Param { PMMG_IPARAM_nomove, /*!< [1/0], Avoid/allow point relocation */ PMMG_IPARAM_nosurf, /*!< [1/0], Avoid/allow surface modifications */ PMMG_IPARAM_numberOfLocalParam,/*!< [n], Number of local parameters */ + PMMG_IPARAM_purePartitioning, /*!< [0/1], Turn off/on pure mesh partitioning (no ls insertion, no remeshing) */ PMMG_IPARAM_anisosize, /*!< [1/0], Turn on/off anisotropic metric creation when no metric is provided */ PMMG_IPARAM_octree, /*!< [n], Specify the max number of points per octree cell (DELAUNAY) */ PMMG_IPARAM_meshSize, /*!< [n], Target mesh size of Mmg (advanced use) */ @@ -389,6 +390,24 @@ int PMMG_Set_outputSolsName(PMMG_pParMesh parmesh, const char* solout); */ int PMMG_Set_outputMetName(PMMG_pParMesh parmesh, const char* metout); +/** + * \param parmesh pointer toward a parmesh structure. + * \param lsout name of the output level-set file. + * \return 0 if failed, 1 otherwise. + * + * Set the name of output level-set file. + * + * \remark Fortran interface: + * > SUBROUTINE PMMG_SET_OUTPUTLSNAME(parmesh,lsout,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: parmesh\n + * > CHARACTER(LEN=*), INTENT(IN) :: lsout\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ +int PMMG_Set_outputLsName(PMMG_pParMesh parmesh, const char* lsout); + /** * \param parmesh pointer toward the parmesh structure. * \param comm MPI communicator for ParMmg @@ -2114,7 +2133,45 @@ int PMMG_usage( PMMG_pParMesh parmesh, char * const prog); * \param filename name of file. * \return 0 if failed, 1 otherwise. * - * Write 1 or more than 1 solution in a file at medit format. + * Write level-set in a file at medit format. + * + * \remark Fortran interface: + * > SUBROUTINE PMMG_SAVELS_CENTRALIZED(parmesh,filename,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: parmesh\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int PMMG_saveLs_centralized(PMMG_pParMesh parmesh, const char *filename); + +/** + * \param parmesh pointer toward the parmesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Write level-set in a file at medit format for a distributed + * mesh (insert rank index to filename). + * + * \remark Fortran interface: + * > SUBROUTINE PMMG_SAVELS_DISTRIBUTED(parmesh,filename,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: parmesh\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int PMMG_saveLs_distributed(PMMG_pParMesh parmesh, const char *filename); + + +/** + * \param parmesh pointer toward the parmesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Write 1 or more than 1 solution field in a file at medit format. * * \remark Fortran interface: * > SUBROUTINE PMMG_SAVEALLSOLS_CENTRALIZED(parmesh,filename,strlen,retval)\n @@ -2132,7 +2189,7 @@ int PMMG_usage( PMMG_pParMesh parmesh, char * const prog); * \param filename name of file. * \return 0 if failed, 1 otherwise. * - * Write 1 or more than 1 solution in a file at medit format for a distributed + * Write 1 or more than 1 solution field in a file at medit format for a distributed * mesh (insert rank index to filename). * * \remark Fortran interface: diff --git a/src/libparmmg_tools.c b/src/libparmmg_tools.c index 81670a63..6e5a16b3 100644 --- a/src/libparmmg_tools.c +++ b/src/libparmmg_tools.c @@ -124,6 +124,7 @@ int PMMG_usage( PMMG_pParMesh parmesh, char * const prog ) fprintf(stdout,"-nlayers val number of layers for interface displacement\n"); fprintf(stdout,"-groups-ratio val allowed imbalance between current and desired groups size\n"); fprintf(stdout,"-nobalance switch off load balancing of the output mesh\n"); + fprintf(stdout,"-pure-partitioning perform only mesh partitioning (no level-set insertion or remeshing"); //fprintf(stdout,"-ar val angle detection\n"); //fprintf(stdout,"-nr no angle detection\n"); @@ -457,6 +458,20 @@ int PMMG_parsar( int argc, char *argv[], PMMG_pParMesh parmesh ) PMMG_UNRECOGNIZED_ARG; } break; + + case 'p': + if ( !strcmp(pmmgArgv[i],"-pure-partitioning") ) { + /* Only perform partitionning of intput data */ + if ( !PMMG_Set_iparameter(parmesh,PMMG_IPARAM_purePartitioning,1) ) { + ret_val = 0; + goto clean; + } + } + else { + PMMG_UNRECOGNIZED_ARG; + } + break; + case 'v': /* verbosity */ if ( ++i < pmmgArgc ) { if ( isdigit(pmmgArgv[i][0]) || @@ -638,10 +653,17 @@ int PMMG_parsar( int argc, char *argv[], PMMG_pParMesh parmesh ) return 0; } + /* Assign default output level-set name */ + if ( parmesh->listgrp[0].ls->nameout == NULL ) { + if ( !MMG3D_Set_outputSolName(mesh,parmesh->listgrp[0].ls,"") ) + return 0; + } + /* Transfer solution names into the parmesh */ assert ( !parmesh->metin ); assert ( !parmesh->metout ); assert ( !parmesh->lsin ); + assert ( !parmesh->lsout ); assert ( !parmesh->dispin ); if ( met && met->namein ) { @@ -660,6 +682,10 @@ int PMMG_parsar( int argc, char *argv[], PMMG_pParMesh parmesh ) PMMG_Set_name(parmesh,&parmesh->metout,met->nameout,"mesh.o.sol"); } + if ( parmesh->listgrp[0].ls && parmesh->listgrp[0].ls->nameout ) { + PMMG_Set_name(parmesh,&parmesh->lsout,parmesh->listgrp[0].ls->nameout,"mesh.o.sol"); + } + clean: MMG5_argv_cleanup( mmgArgv, mmgArgc ); MMG5_argv_cleanup( pmmgArgv, pmmgArgc ); diff --git a/src/libparmmgtypes.h b/src/libparmmgtypes.h index 8d099afa..c506d13c 100644 --- a/src/libparmmgtypes.h +++ b/src/libparmmgtypes.h @@ -369,6 +369,7 @@ typedef struct { int setfem; /*!< fem mesh (no elt with more than 1 bdy face */ int mmg_imprim; /*!< 1 if the user has manually setted the mmg verbosity */ int repartitioning; /*!< way to perform mesh repartitioning */ + int pure_partitioning; /*!< enable/disable pure mesh partitioning mode */ int ifc_layers; /*!< nb of layers for interface displacement */ double grps_ratio; /*!< allowed imbalance ratio between current and demanded groups size */ int nobalancing; /*!< switch off final load balancing */ @@ -426,7 +427,7 @@ typedef struct { /* file names */ char *meshin,*meshout; char *metin,*metout; - char *lsin; + char *lsin,*lsout; char *dispin; char *fieldin,*fieldout; diff --git a/src/mergemesh_pmmg.c b/src/mergemesh_pmmg.c index 010fdf36..d3023a88 100644 --- a/src/mergemesh_pmmg.c +++ b/src/mergemesh_pmmg.c @@ -1600,6 +1600,9 @@ int PMMG_mergeParmesh_rcvParMeshes ( PMMG_pParMesh parmesh,PMMG_pGrp rcv_grps, if ( parmesh->lsin ) { MMG3D_Set_inputSolName (mesh,ls, parmesh->lsin); } + if ( parmesh->lsout ) { + MMG3D_Set_outputSolName (mesh,ls, parmesh->lsout); + } } if ( disp ) { if ( parmesh->dispin ) { diff --git a/src/mpiunpack_pmmg.c b/src/mpiunpack_pmmg.c index a185ffba..a7b32edb 100644 --- a/src/mpiunpack_pmmg.c +++ b/src/mpiunpack_pmmg.c @@ -417,6 +417,11 @@ int PMMG_copy_filenames ( PMMG_pParMesh parmesh,PMMG_pGrp grp,int *ier,int ier_m if ( parmesh->lsin && *parmesh->lsin ) { if ( !MMG5_Set_inputSolName( mesh, ls, parmesh->lsin ) ) { *ier = 0; } } + if ( parmesh->lsout && *parmesh->lsout ) { + if ( !MMG5_Set_outputSolName( mesh, ls, parmesh->lsout ) ) { + *ier = 0; + } + } } if ( ier_disp && disp ) { diff --git a/src/parmmg.c b/src/parmmg.c index e736fd31..c542542d 100644 --- a/src/parmmg.c +++ b/src/parmmg.c @@ -470,6 +470,13 @@ int main( int argc, char *argv[] ) if ( ier && grp->field ) { ier = PMMG_saveAllSols_distributed(parmesh,parmesh->fieldout); } + if ( ier && grp->ls ) { + /* Warning: if the ls has the same name than the metric (default case + * when no input metric in ls mode), if the ls is not deallocated, the + * metric file is overwritten */ + ier = PMMG_saveLs_distributed(parmesh,parmesh->lsout); + } + MPI_Allreduce( &ier, &ierSave, 1, MPI_INT, MPI_MIN, parmesh->comm ); break; @@ -490,6 +497,14 @@ int main( int argc, char *argv[] ) if ( ierSave && grp->field ) { ierSave = PMMG_saveAllSols_centralized(parmesh,parmesh->fieldout); } + + if ( ierSave && grp->ls ) { + /* Warning: if the ls has the same name than the metric (default case + * when no input metric in ls mode), if the ls is not deallocated, the + * metric file is overwritten */ + ierSave = PMMG_saveLs_centralized(parmesh,parmesh->lsout); + } + break; } } From cd1ac643d7462af430afb56a4bfbac6dde2f27cf Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 12:49:07 +0100 Subject: [PATCH 2/7] Fix issues with pure-partitioning option. --- cmake/testing/pmmg_tests.cmake | 2 ++ src/libparmmg.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/cmake/testing/pmmg_tests.cmake b/cmake/testing/pmmg_tests.cmake index 93d8b76f..cd637781 100644 --- a/cmake/testing/pmmg_tests.cmake +++ b/cmake/testing/pmmg_tests.cmake @@ -429,6 +429,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh -ls -pure-partitioning + -distributed-output -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol -met ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-metric.sol -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withMetAndLs-2.o.mesh) @@ -447,6 +448,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube.mesh -ls -pure-partitioning + -distributed-output -sol ${CI_DIR}/LevelSet/1p_cubegeom/3D-cube-ls.sol -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-withLs-2.o.mesh) diff --git a/src/libparmmg.c b/src/libparmmg.c index fdf3d0f9..f7ce2c4f 100644 --- a/src/libparmmg.c +++ b/src/libparmmg.c @@ -1820,6 +1820,9 @@ int PMMG_parmmg_centralized(PMMG_pParMesh parmesh) { return ierlib; } } + else { + ierlib = 0; + } ier = PMMG_parmmglib_post(parmesh); ierlib = MG_MAX ( ier, ierlib ); From 358e0b8a1b5e95274b9784b99a1ca3660a5ad792 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 12:57:21 +0100 Subject: [PATCH 3/7] Update README with the new install procedure when Mmg download is disabled. --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eb37cdc0..cbe475fc 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,13 @@ To get and build ParMmg, you will need: If you don't have internet access and/or want to use your own installation of Mmg (resp. Metis), you can disable the automatic download of Mmg setting the - `DOWNLOAD_MMG` (resp. `DOWNLOAD_METIS`) CMake variable to `OFF`. In this case, - you can help CMake to find Mmg (resp. Metis) by specifying the source - directory of Mmg in the `MMG_DIR` variable and the build directory of Mmg in - the `MMG_BUILDDIR` variable (resp. the installation directory of Metis in the - `METIS_DIR` variable). + `DOWNLOAD_MMG` (resp. `DOWNLOAD_METIS`) CMake variable to `OFF`. In this case: + + - Mmg has to be built with the private header installation enabled (turn `ON` the ` MMG_INSTALL_PRIVATE_HEADERS` CMake variable in Mmg at cmake configuration step); + - you can help CMake to find Mmg by specifying the installation + directory of Mmg in the `MMG_DIR` variable; + - you can help CMake to find Metis by specifying the installation directory of Metis in the + `METIS_DIR` variable. Example: ```Shell From fc746a991bc2164720bb66cb88c7f7f18d21b48c Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 13:10:05 +0100 Subject: [PATCH 4/7] Fix missing path toward metric in ci tests. --- cmake/testing/pmmg_tests.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/testing/pmmg_tests.cmake b/cmake/testing/pmmg_tests.cmake index cd637781..1a6b051f 100644 --- a/cmake/testing/pmmg_tests.cmake +++ b/cmake/testing/pmmg_tests.cmake @@ -340,7 +340,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/InterpolationFields-withMet-withFields-4-out.mesh -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -mesh-size 60000 ${myargs} ) add_test( NAME InterpolationFields-hsiz-4 @@ -373,7 +373,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-metAndFields-4-out.mesh -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -pure-partitioning -distributed-output ) @@ -382,7 +382,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-CenOut-metAndFields-4-out.mesh -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -pure-partitioning -centralized-output ) @@ -404,7 +404,7 @@ IF( BUILD_TESTING ) COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-DisOut-met-4-out.mesh - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -pure-partitioning -distributed-output ) @@ -412,7 +412,7 @@ IF( BUILD_TESTING ) COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 4 $ ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-CenOut-met-4-out.mesh - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -pure-partitioning -centralized-output ) @@ -421,7 +421,7 @@ IF( BUILD_TESTING ) ${CI_DIR}/Interpolation/coarse.meshb -out ${CI_DIR_RESULTS}/PurePartitioning-CenIn-h5-metAndFields-4-out.h5 -field ${CI_DIR}/Interpolation/sol-fields-coarse.sol - -sol field3_iso-coarse.sol + -sol ${CI_DIR}/Interpolation/field3_iso-coarse.sol -pure-partitioning ) add_test( NAME PurePartitioning-CenIn-DisOut-withMetAndLs-2 From f9b2b6004350dd84d53409f240bce57fbccf842c Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 14:13:57 +0100 Subject: [PATCH 5/7] Fix mem error. --- src/API_functions_pmmg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/API_functions_pmmg.c b/src/API_functions_pmmg.c index b4d5daa0..96361c99 100644 --- a/src/API_functions_pmmg.c +++ b/src/API_functions_pmmg.c @@ -391,7 +391,7 @@ int PMMG_Set_outputLsName(PMMG_pParMesh parmesh, const char* lsout) { /* If \a lsout is not provided we want to use the basename of the input ls * name and the path of the output mesh name */ if ( parmesh->lsout ) { - PMMG_DEL_MEM(parmesh,parmesh->fieldout,char,"fieldout unalloc"); + PMMG_DEL_MEM(parmesh,parmesh->lsout,char,"lsout unalloc"); } if ( (!lsout) || (!*lsout) ) { @@ -403,9 +403,9 @@ int PMMG_Set_outputLsName(PMMG_pParMesh parmesh, const char* lsout) { return 0; } - /* Get input field base name and remove .mesh extension */ + /* Get input ls base name and remove .mesh extension */ if ( (!parmesh->lsin) || (!*parmesh->lsin) ) { - fprintf(stderr, " ## Error: %s: please, provide an input field" + fprintf(stderr, " ## Error: %s: please, provide an input ls" " name before calling this function without string.\n", __func__); return 0; From 8568b0c3577a93fed2184ef8d2679e540b91ed92 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 14:20:26 +0100 Subject: [PATCH 6/7] Indentation in output. --- src/overlap_pmmg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlap_pmmg.c b/src/overlap_pmmg.c index f20d1827..cc7829f8 100644 --- a/src/overlap_pmmg.c +++ b/src/overlap_pmmg.c @@ -839,7 +839,7 @@ int PMMG_delete_overlap(PMMG_pParMesh parmesh, MPI_Comm comm) { } if ( parmesh->info.imprim > PMMG_VERB_ITWAVES ) - fprintf(stdout, " part %d has %d pts and %d tetras after overlap deletion\n", + fprintf(stdout, " part %d has %d pts and %d tetras after overlap deletion\n", parmesh->myrank,mesh->np,mesh->ne); return 1; From 5bd4d08eabc7e240c792d1eaf3cba89f1489e36e Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Thu, 31 Oct 2024 14:25:21 +0100 Subject: [PATCH 7/7] Align ParMmg to new Mmg release. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5e0f6da..4b9bf3e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ IF ( DOWNLOAD_MMG ) EXTERNALPROJECT_ADD ( Mmg GIT_REPOSITORY https://github.com/MmgTools/mmg.git - GIT_TAG 1e303f8cea3b9fcbcaf9f1b8625de7e9b434b1aa + GIT_TAG v5.8.0 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}