I have to allocate this
Code:
char *s, /*IN-File name ****/
void ***subs, /*OUT -2D submatrix indices **/
void **storage, /*OUT -Submatrix stored here */
use the code
Code:
*storage = (void *) my_malloc(id, *n *local_rows * datum_size);
*subs = (void **) my_malloc (id, local_rows * PTR_SIZE);
by using a function like this.
Code:
void *my_malloc( int id, int bytes)
{
void *buffer;
if((buffer = malloc ((size_t) bytes)) == NULL)
{ printf ("ERROR: MALLOC FAILED FOR PROCESS %d\n", id);
fflush (stdout);
MPI_Abort(MPI_COMM_WORLD,MALLOC_ERROR);
}
return buffer;
}
compile and take the error
Code:
matr_vect_mult.c:114: error: conflicting types for ‘my_malloc’
have u any idea whats wrong