Mentions légales du service

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

spmAlloc: Add the allocation of loc2glob based on replicated field for Fortran users

parent 43e4881d
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
......@@ -197,6 +197,16 @@ spmAlloc( spmatrix_t *spm )
size_t valsize = (size_t)(spm->nnzexp) * spm_size_of( spm->flttype );
spm->values = malloc( valsize );
}
if ( spm->loc2glob == NULL ) {
if ( spm->replicated == 1 ) {
spm->loc2glob = NULL;
} else if ( spm->replicated == 0 ) {
spm->loc2glob = (spm_int_t*)malloc( spm->n * sizeof(spm_int_t) );
} else {
fprintf( stderr, "[%s] WARNING: replicated field is not initialized, loc2glob can't be correctly allocated\n", __func__ );
}
}
}
/**
......
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