public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Does openmp support nested loop?
@ 2004-11-25  4:15 hx w
  0 siblings, 0 replies; only message in thread
From: hx w @ 2004-11-25  4:15 UTC (permalink / raw)
  To: gcc mail-list gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312, Size: 1314 bytes --]


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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-25  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-25  4:15 Does openmp support nested loop? hx w

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).