Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64409025
hello_world_omp.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 26, 16:45
Size
375 B
Mime Type
text/x-c
Expires
Tue, May 28, 16:45 (2 d)
Engine
blob
Format
Raw Data
Handle
17898576
Attached To
R7871 phys-743-exercises
hello_world_omp.c
View Options
#include <stdio.h>
#include <omp.h>
int
main
(
int
argc
,
char
*
argv
[])
{
int
myrank
=
0
;
int
mysize
=
1
;
#if defined (_OPENMP)
#pragma omp parallel default(shared) private(myrank, mysize)
{
mysize
=
omp_get_num_threads
();
myrank
=
omp_get_thread_num
();
#endif
printf
(
"Hello from thread %d out of %d
\n
"
,
myrank
,
mysize
);
#if defined (_OPENMP)
}
#endif
return
0
;
}
Event Timeline
Log In to Comment