[Omp] Re: limit of 5000 iteration

Hoeflinger, Jay P jay.p.hoeflinger at intel.com
Fri Jun 10 11:18:14 PDT 2005


Your code works fine on Intel's current compiler.  Which version the
Intel compiler are you using?
 
Jay Hoeflinger

________________________________

From: Omp-bounces at openmp.org [mailto:Omp-bounces at openmp.org] On Behalf
Of barbapapaz
Sent: Thursday, June 09, 2005 4:06 AM
To: Omp at openmp.org
Subject: Re: [Omp] Re: limit of 5000 iteration


I use intel compiler


2005/6/8, eric duncan <Eric.Duncan at sun.com>: 

	I am a little confused by your code.  You are using
default(none) and so
	the variable "it" should have to be defined as shared - so I am
not sure
	why this was even able to compile.
	
	The OpenMP spec does state that the libraries provided should be
thread 
	safe - so the printf should work - though the output may be
mangled
	since multiple threads are all writing to stdout.  You could put
the
	printf in a critical region if you really want to do output in
the
	parallel region.  This would keep the output from being mangled.

	
	The better question is, what compiler are you using??  If you
are
	getting an exception, then it sounds like that product has a
problem.
	
	barbapapaz wrote:
	> I have resolve my problem
	>
	> don't use printf in parallel loops! 
	>
	> 2005/6/8, barbapapaz <barbapapaz at gmail.com
<mailto:barbapapaz at gmail.com>>:
	>
	>     hi
	>
	>     my test is simple
	>
	>     #pragma omp parallel for default(none)
	>       for(int i=0;i<it;i++){
	>
	>         //while(1) {
	>           printf ("i = %d : thread = %d\n", i
,omp_get_thread_num()); 
	>         //}
	>       }
	>
	>     if it >5000 they are an exeption, if i put ordered clause
it 's
	>     possible to put it >5000
	>
	>     I don't undertsand
	>
	>     thanks 
	>
	>
	>
	>
------------------------------------------------------------------------
	>
	> _______________________________________________
	> Omp mailing list
	> Omp at openmp.org
	> http://openmp.org/mailman/listinfo/omp_openmp.org
	
	


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openmp.org/pipermail/omp/attachments/20050610/5a224f68/attachment.html


More information about the Omp mailing list