Skip to content

Instantly share code, notes, and snippets.

@soravux
Created February 20, 2014 01:59
Show Gist options
  • Select an option

  • Save soravux/9105620 to your computer and use it in GitHub Desktop.

Select an option

Save soravux/9105620 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <omp.h>
int main(int argc, char *argv[]) {
const int N = 1000;
unsigned int i, a[N+10];
unsigned int j;
for (j = 0; j < 100; j++) {
#pragma omp parallel for num_threads(4)
for (i = N; i < j; i++) {
printf("i: %i, j: %i\n", i, j);
a[i] = 2 * i;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment