From 3af369bea072519265e2c64b64c731d9ff8dbc70 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 29 Oct 2024 13:30:05 +0100 Subject: [PATCH] Debug cleaning. --- src/grpsplit_pmmg.c | 8 +++++++- src/libparmmg1.c | 7 ++++--- src/loadbalancing_pmmg.c | 11 ++++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/grpsplit_pmmg.c b/src/grpsplit_pmmg.c index 9362402c..fad23421 100644 --- a/src/grpsplit_pmmg.c +++ b/src/grpsplit_pmmg.c @@ -1849,13 +1849,15 @@ int PMMG_split_n2mGrps(PMMG_pParMesh parmesh,int target,int fitMesh,int repartit if ( !ier ) { fprintf(stderr,"\n ## Merge groups problem.\n"); } + +#ifndef NDEBUG for (int k=0; kngrp; ++k ) { if ( !MMG5_chkmsh(parmesh->listgrp[k].mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; } } - +#endif if ( parmesh->info.imprim > PMMG_VERB_DETQUAL ) { chrono(OFF,&(ctim[tim])); @@ -1920,22 +1922,26 @@ int PMMG_split_n2mGrps(PMMG_pParMesh parmesh,int target,int fitMesh,int repartit } /** Split the group into the suitable number of groups */ +#ifndef NDEBUG for (int k=0; kngrp; ++k ) { if ( !MMG5_chkmsh(parmesh->listgrp[k].mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; } } +#endif if ( ier ) ier = PMMG_splitPart_grps(parmesh,target,fitMesh,repartitioning_mode); +#ifndef NDEBUG for (int k=0; kngrp; ++k ) { if ( !MMG5_chkmsh(parmesh->listgrp[k].mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; } } +#endif if ( parmesh->info.imprim > PMMG_VERB_DETQUAL ) { chrono(OFF,&(ctim[tim])); diff --git a/src/libparmmg1.c b/src/libparmmg1.c index baf91bfe..7439f97a 100644 --- a/src/libparmmg1.c +++ b/src/libparmmg1.c @@ -268,17 +268,19 @@ int PMMG_packParMesh( PMMG_pParMesh parmesh ) } /* to could save the mesh, the adjacency have to be correct */ -// if ( mesh->info.ddebug ) { + if ( mesh->info.ddebug ) { if ( (!mesh->adja) && !MMG3D_hashTetra(mesh,1) ) { fprintf(stderr,"\n ## Error: %s: tetra hashing problem. Exit program.\n", __func__); return 0; } +#ifndef NDEBUG if ( !MMG5_chkmsh(mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; } -// } +#endif + } } return 1; @@ -534,7 +536,6 @@ int PMMG_scotchCall( PMMG_pParMesh parmesh,int igrp,int *permNodGlob ) { return 1; } -int PMMG_grp_to_saveMesh( PMMG_pParMesh parmesh, int i, char* ); /** * \param parmesh pointer toward a parmesh structure where the boundary entities * are stored into xtetra and xpoint strucutres diff --git a/src/loadbalancing_pmmg.c b/src/loadbalancing_pmmg.c index 8ba8b3c3..c2c882c4 100644 --- a/src/loadbalancing_pmmg.c +++ b/src/loadbalancing_pmmg.c @@ -44,8 +44,6 @@ * Load balancing of the mesh groups over the processors. * */ -int PMMG_grp_to_saveMesh( PMMG_pParMesh parmesh, int i, char* ); - int PMMG_loadBalancing(PMMG_pParMesh parmesh,int partitioning_mode) { MMG5_pMesh mesh; int ier,ier_glob,igrp,ne; @@ -166,7 +164,7 @@ int PMMG_loadBalancing(PMMG_pParMesh parmesh,int partitioning_mode) { } #ifndef NDEBUG - for ( int i=0; ingrp; ++i ) { + for ( i=0; ingrp; ++i ) { if ( !MMG5_chkmsh(parmesh->listgrp[i].mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; @@ -194,12 +192,15 @@ int PMMG_loadBalancing(PMMG_pParMesh parmesh,int partitioning_mode) { } } } - for (int k=0; kngrp; ++k ) { - if ( !MMG5_chkmsh(parmesh->listgrp[k].mesh,1,1) ) { + +#ifndef NDEBUG + for (i=0; ingrp; ++i ) { + if ( !MMG5_chkmsh(parmesh->listgrp[i].mesh,1,1) ) { fprintf(stderr," ## Problem. Invalid mesh.\n"); return 0; } } +#endif if ( parmesh->info.imprim > PMMG_VERB_DETQUAL ) { chrono(OFF,&(ctim[tim]));