Created
June 21, 2011 23:26
-
-
Save hpcx82/1039217 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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