if ( > 0) { // Store the initial value bones_initial_value = [0]; // Create a temporary array to store intermediate data int bones_thread_count = BONES_MIN(omp_get_num_procs(),); * bones_temporary = (*)malloc(bones_thread_count*sizeof()); // Run multiple OpenMP threads omp_set_num_threads(bones_thread_count); #pragma omp parallel { int bones_thread_id = omp_get_thread_num(); // Perform the major part of the computation in parallel bones_kernel__0(bones_thread_id, bones_thread_count, , , bones_temporary, ); } // Compute the second part of the algorithm with only one thread bones_kernel__1(bones_thread_count, bones_temporary, , ); free(bones_temporary); // Perform the last computation (only needed if there is an initial value) bones_kernel__2(bones_initial_value,,); }