Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5dbeea13 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

test: update lo2glob testing to replicated

parent aeca16ed
No related branches found
No related tags found
1 merge request!120Add a replicated field to the data structure instead of checking the replication on the value of loc2glob
......@@ -146,7 +146,7 @@ int main (int argc, char **argv)
if ( clustnum == 0 ) {
printf(" -- SPM check_and_correct Test --\n");
}
err = spmTestLoop( &original, &spm_dist_check_and_correct_check, (original.loc2glob == NULL) );
err = spmTestLoop( &original, &spm_dist_check_and_correct_check, original.replicated );
spmExit(&original);
......
......@@ -51,7 +51,7 @@ main( int argc, char **argv )
/* Scatter the spm */
distribution = spm_get_distribution( &original );
distByColumn = (distribution & SpmDistByColumn);
if ( original.loc2glob == NULL ) {
if ( original.replicated ) {
spm_int_t new_n, *loc2glob;
spmatrix_t spmtmp;
......
......@@ -141,7 +141,7 @@ int main (int argc, char **argv)
}
free( bdist );
if ( original.loc2glob == NULL ) {
if ( original.replicated ) {
spmExit( spmd );
free( spmd );
}
......
......@@ -98,7 +98,7 @@ int main (int argc, char **argv)
printf(" -- SPM Matrix-Vector Test --\n");
}
err = spmTestLoop( &original, &spm_dist_matvec_check, (original.loc2glob == NULL) );
err = spmTestLoop( &original, &spm_dist_matvec_check, original.replicated );
spmExit(&original);
......
......@@ -212,8 +212,8 @@ spmTestCompare( const spmatrix_t *spm1,
goto end;
}
if ( (spm1->loc2glob == NULL) &&
(spm2->loc2glob == NULL) )
if ( spm1->replicated &&
spm2->replicated )
{
spmatrix_t tmpspm1, tmpspm2;
const spmatrix_t *spm1ptr, *spm2ptr;
......
......@@ -270,7 +270,7 @@ spmTestConvertAndPrint( spmatrix_t *spm,
rc = spmConvert( newtype, spm );
err = ( rc != SPM_SUCCESS ) || ( spm->fmttype != newtype );
baseval = spm->baseval;
if ( spm->loc2glob != NULL ) {
if ( !spm->replicated ) {
rc = asprintf( &filename,
"convert_dist_b%d_%s_%s_%s_%d.dat",
baseval,
......@@ -464,7 +464,7 @@ spmTestLoop2( spmatrix_t *original,
/* Scatter the Spm if we are on a distributed test */
distbycol = (fmttype == SpmCSR) ? 0 : 1;
if ( original->loc2glob == NULL ) {
if ( original->replicated ) {
rc = spmScatter( &spmtmp, -1, original, -1, NULL, distbycol, MPI_COMM_WORLD );
if ( rc != SPM_SUCCESS ) {
fprintf( stderr, "Failed to scatter the spm\n" );
......
......@@ -377,7 +377,8 @@ z_spm_dist_genrhs_check( const spmatrix_t *spm,
const spm_int_t *dofs = spm->dofs;
spm_int_t i, ii;
if ( loc2glob != NULL ) {
if ( !spm->replicated ) {
assert( loc2glob != NULL );
for( i=0; i<spm->n; i++, loc2glob++ ) {
spm_int_t ig = (*loc2glob) - baseval;
spm_int_t dofi = ( spm->dof > 0 ) ? spm->dof : dofs[ig+1] - dofs[ig];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment