Skip to content
Snippets Groups Projects
Commit 0c8bdee3 authored by Alam's avatar Alam
Browse files

Added thread number change, so that nodes can be equally divided

parent fa087157
Branches
No related merge requests found
......@@ -37,6 +37,16 @@ int main(int argc, char *argv[]) {
int thread_count = strtol(argv[1], NULL, 10);
int n_nodes = strtol(argv[2],NULL,10);
// number of thread set to nearest , bigger divisor of nodes
if(n_nodes%thread_count!=0){
while(n_nodes%thread_count!=0){
thread_count++;
}
printf("Number of threads changed to %d so %d nodes can be equally divided\n" , thread_count, n_nodes);
}
// Graph initialization
graph = malloc(n_nodes*n_nodes*sizeof(int));
initGraph(graph,n_nodes);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment