Skip to content

Instantly share code, notes, and snippets.

@hpcx82
Created June 21, 2011 23:26
Show Gist options
  • Save hpcx82/1039217 to your computer and use it in GitHub Desktop.
Save hpcx82/1039217 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h> // for Sleep
#include <omp.h>
int main(int argc, const char* argv[])
{
omp_set_num_threads(argc);
#pragma omp parallel for
for (int i = 0; i < argc - 1; ++i)
{
int val = atol(argv[i+1]);
Sleep(val);
printf("%ld\n", val);
fflush(stdout);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment