This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Does openmp support nested loop?
- From: hx w <ye_hx_w at yahoo dot com dot cn>
- To: gcc mail-list gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 25 Nov 2004 11:02:01 +0800 (CST)
- Subject: Does openmp support nested loop?
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/