mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 08:22:11 +01:00
Merged.
This commit is contained in:
commit
d75aaf49b5
@ -6,10 +6,11 @@
|
|||||||
* @@expect: success
|
* @@expect: success
|
||||||
*/
|
*/
|
||||||
void work();
|
void work();
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
#pragma omp parallel proc_bind(spread) num_threads(4)
|
#pragma omp parallel proc_bind(spread) num_threads(4)
|
||||||
{
|
{
|
||||||
work();
|
work();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
* @@expect: success
|
* @@expect: success
|
||||||
*/
|
*/
|
||||||
void work();
|
void work();
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
#pragma omp parallel proc_bind(close) num_threads(4)
|
#pragma omp parallel proc_bind(close) num_threads(4)
|
||||||
{
|
{
|
||||||
work();
|
work();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
* @@expect: success
|
* @@expect: success
|
||||||
*/
|
*/
|
||||||
void work();
|
void work();
|
||||||
void main()
|
int main()
|
||||||
{
|
{
|
||||||
#pragma omp parallel proc_bind(master) num_threads(4)
|
#pragma omp parallel proc_bind(master) num_threads(4)
|
||||||
{
|
{
|
||||||
work();
|
work();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -28,5 +28,5 @@ int main( ) {
|
|||||||
printf( "section_count %d\n", section_count );
|
printf( "section_count %d\n", section_count );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,5 @@ int main (void)
|
|||||||
#pragma omp single
|
#pragma omp single
|
||||||
printf ("Sum is %d\n", a);
|
printf ("Sum is %d\n", a);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -56,4 +56,5 @@ int main()
|
|||||||
}
|
}
|
||||||
} // only now is background work required to be complete
|
} // only now is background work required to be complete
|
||||||
print_results();
|
print_results();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user