Skip to content
Snippets Groups Projects
Commit 23438fbc authored by Moises Fernandez's avatar Moises Fernandez
Browse files

Fix bug dividing subparts when only 1 subpart

parent c75b8796
No related branches found
No related tags found
No related merge requests found
...@@ -107,9 +107,13 @@ int main(int argc, char *argv[]){ ...@@ -107,9 +107,13 @@ int main(int argc, char *argv[]){
int last_sub_part = size_part - ((nsubparts-1)*SIZE_SUB_PART); int last_sub_part = size_part - ((nsubparts-1)*SIZE_SUB_PART);
if(last_sub_part<(SIZE_SUB_PART*0.5)){ //if is too small the last part we distribute it between the others if(last_sub_part<(SIZE_SUB_PART*0.5)){ //if is too small the last part we distribute it between the others
size_sub_part = size_sub_part + last_sub_part/(nsubparts-1); if(nsubparts-1){
nsubparts--; size_sub_partLR = size_sub_partLR + last_sub_partLR/(nsubparts-1);
last_sub_part = size_part - ((nsubparts-1)*size_sub_part); nsubparts--;
}else{
size_sub_partLR = 0;
}
last_sub_partLR = size_partLR - ((nsubparts-1)*size_sub_partLR);
} }
Matrix mydatam_part; Matrix mydatam_part;
......
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