From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12196 invoked by alias); 16 Dec 2011 22:09:04 -0000 Received: (qmail 12187 invoked by uid 22791); 16 Dec 2011 22:09:03 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Dec 2011 22:08:50 +0000 From: "longb at cray dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51591] New: Strange output from STOP statement in OpenMP region Date: Fri, 16 Dec 2011 22:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: longb at cray dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg01883.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51591 Bug #: 51591 Summary: Strange output from STOP statement in OpenMP region Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: longb@cray.com > cat testc.c #include /* extern unsigned int sleep (unsigned int __seconds); */ int sleepc_ (unsigned int *sec) { sleep(*sec); return 0; } > cat test.f90 use omp_lib implicit none integer i print *,"Hello World" call omp_set_num_threads(5) !$omp parallel !$omp do schedule(static,1) do i=1,omp_get_num_threads() !$omp critical print *, "I am",omp_get_thread_num()," of",omp_get_num_threads() !$omp end critical select case (omp_get_thread_num()) case (0) call sleep (1) stop 0 case (1) stop 1 case (2) stop 2 case (3) stop 3 case default stop end select enddo !$omp end do !$omp barrier !$omp end parallel end > cc -c testc.c > ftn -fopenmp test.f90 testc.o Sometimes output looks OK: > aprun -n1 -d5 ./a.out Hello World STOP 1 I am 1 of 5 I am 2 of 5 Application 5777837 exit codes: 1 Application 5777837 resources: utime ~0s, stime ~0s But more often there is some garbled text output: > aprun -n1 -d5 ./a.out Hello World STOP 1 I am 1 of 5 0im `m5 <<<<----- What's this? Application 5777838 exit codes: 1 Application 5777838 resources: utime ~0s, stime ~0s