im trying to distribute the rows of a matrix as evenly as possible between a certain amount of processes to do a certain task, the thing is that given the fact that the division might not be exact i cannot figure out how to distribute these rows, even tho its pretty easy to do it when we assume the division is equal. So the problem would be something like this:
(assuming exact division):
//code...
work = rows / numprocs;
//leftover = rows % numprocs; /* what to do with this !! */
for(i = my_id * work; i < (my_id * work + work); i ++){
// do things...
//more code
thanks in advance.