Skip to content

Commit

Permalink
Debug cleaning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Algiane committed Oct 29, 2024
1 parent 995c7ce commit 3af369b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/grpsplit_pmmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; k<parmesh->ngrp; ++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]));
Expand Down Expand Up @@ -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; k<parmesh->ngrp; ++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; k<parmesh->ngrp; ++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]));
Expand Down
7 changes: 4 additions & 3 deletions src/libparmmg1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/loadbalancing_pmmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -166,7 +164,7 @@ int PMMG_loadBalancing(PMMG_pParMesh parmesh,int partitioning_mode) {
}

#ifndef NDEBUG
for ( int i=0; i<parmesh->ngrp; ++i ) {
for ( i=0; i<parmesh->ngrp; ++i ) {
if ( !MMG5_chkmsh(parmesh->listgrp[i].mesh,1,1) ) {
fprintf(stderr," ## Problem. Invalid mesh.\n");
return 0;
Expand Down Expand Up @@ -194,12 +192,15 @@ int PMMG_loadBalancing(PMMG_pParMesh parmesh,int partitioning_mode) {
}
}
}
for (int k=0; k<parmesh->ngrp; ++k ) {
if ( !MMG5_chkmsh(parmesh->listgrp[k].mesh,1,1) ) {

#ifndef NDEBUG
for (i=0; i<parmesh->ngrp; ++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]));
Expand Down

0 comments on commit 3af369b

Please sign in to comment.