Does openmp support nested loop?
hx w
ye_hx_w@yahoo.com.cn
Thu Nov 25 04:15:00 GMT 2004
Hello, frineds,
i am studying the openmp API. I don't know clearly
about that how to increase the performence at the
nested loop through paralleling. Does openmp support
the nested loop?
As follows:
=============================
#include <stdio.h>
int main()
{
int i,j;
for (i=0; i<=10; i++)
for ( j=0; j<=10; j++ )
larg_compute_function();
exit(0);
}
==============================
I modified:
==============================
#include <stdio.h>
#include <omp.h>
int main()
{
int i,j;
omp_set_num_threads(4);
#pragma omp parallel for
for (i=0; i<=10; i++)
#pragma omp parallel for
for ( j=0; j<=10; j++ )
larg_compute_function();
exit(0);
}
=============================
After modifying, can i increasing the performence?
Any suggestions will be welcome!
Thanks!
_________________________________________________________
Do You Yahoo!?
150ÃòÃúMP3·è¿ñÃ㬴øÃú´³ÃëÃôÃõîÃÃ
http://cn.rd.yahoo.com/mail_cn/tag/yisou/music/*http://music.yisou.com/
ÃÃÃ
®Ã÷ÃÃæÃþ¡Ãã¬ÃñéÃÃü¡¢ÃÃüºÃ¿áü
http://cn.rd.yahoo.com/mail_cn/tag/yisou/image/*http://image.yisou.com
1G¾ÃÃÃ1000Ãã¬ÃÃ
»¢µçÃÃÃÃÃúéÃã¡
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
More information about the Gcc
mailing list