public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51591] New: Strange output from STOP statement in OpenMP region
@ 2011-12-16 22:31 longb at cray dot com
  2011-12-17 10:21 ` [Bug fortran/51591] " burnus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: longb at cray dot com @ 2011-12-16 22:31 UTC (permalink / raw)
  To: gcc-bugs

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 <unistd.h>
/*  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

<Nice to see that the STOP 1 results in an exit code of 1, though - new F08
feature.>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-30 15:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-16 22:31 [Bug fortran/51591] New: Strange output from STOP statement in OpenMP region longb at cray dot com
2011-12-17 10:21 ` [Bug fortran/51591] " burnus at gcc dot gnu.org
2011-12-17 11:32 ` jb at gcc dot gnu.org
2012-02-03 22:09 ` bdavis at gcc dot gnu.org
2013-05-11 17:09 ` bdavis at gcc dot gnu.org
2015-10-20 14:54 ` dominiq at lps dot ens.fr
2020-07-30 15:17 ` dominiq at lps dot ens.fr
2020-07-30 15:23 ` jakub at gcc dot gnu.org

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).