Created
March 12, 2020 17:42
-
-
Save mvgolom/28bf722fb4d01e1efbb1cdc917fbed4a to your computer and use it in GitHub Desktop.
paradigma comput paralela
This file contains 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> | |
#ifdef _OPENMP | |
#include <omp.h> | |
#else | |
#define omp_get_thread_num() 0 | |
#endif | |
int main(){ | |
#pragma omp parallel | |
{ | |
int id_omp = omp_get_thread_num(); | |
long int id_sys = (long int) pthread_self(); | |
printf("Thread[%d,%lu]:Hello World!!!\n",id_omp,id_sys); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment