7 Replies Latest reply on Jun 17, 2009 6:40 PM by dgilmore

    openf90-4.2.2: Segfaults, but with ifort the program runs well

    sangamesh
      A fortran program runs well with ifort, but segfaults with openf90

      Hi,

        On an AMD processor (dual core, dual processor) on Cent OS Linux 5 (Rocks 5), with x86 open64-4.2.2, the fortran program compiles fine but fails to run with the error "Segmentation Fault". But it works well with Intel Fortran compiler.



      # make -f makefile 
      openf90 -c -O3 MAIN.f
      openf90 -c -O3 coef.f
      openf90 -c -O3 initial_conditions.f
      openf90 -c -O3 collide.f
      openf90 -c -O3 interpolate.f
      openf90 -c -O3 boundary_update.f
      openf90 -c -O3 int_boundary_update.f
      openf90 -c -O3 write_binary.f
      openf90 -c -O3 read_binary.f
      openf90 -c -O3 plotter.f
      opencc -c -O3 test_for_nan.c
      openf90 -O3 MAIN.o coef.o initial_conditions.o collide.o interpolate.o boundary_update.o int_boundary_update.o write_binary.o read_binary.o plotter.o test_for_nan.o -o a.out -lm
      # ./a.out 
       Re = 140.
       Tau = 0.585714281
       Program Begins.....
      Segmentation fault
      #
       

      The makefile is:

      # cat makefile 
      FLAGS = -O3 
      MP_FLAGS = -lm
      OBJECTS = MAIN.o coef.o initial_conditions.o collide.o interpolate.o boundary_update.o int_boundary_update.o write_binary.o read_binary.o plotter.o test_for_nan.o
      a.out: $(OBJECTS)
        openf90 $(FLAGS) $(OBJECTS) -o $@ $(MP_FLAGS)
      .f.o: header array_sizes $@ 
        openf90 -c $(FLAGS) $<
      .c.o: $@
        opencc -c $(FLAGS) $<

      cleanall:
        -rm *.o
        -rm *.dat
        -rm *.bin
        -rm a.out

      What's the wrong here? and how to resolve it?

        • openf90-4.2.2: Segfaults, but with ifort the program runs well
          dgilmore

          First things first, does this program fail when compiled at -O0?

          Doug

            • openf90-4.2.2: Segfaults, but with ifort the program runs well
              sangamesh

              Hi Doug,

              Sorry for the late reply and thank you for suggestions.

              With -O0, it got compiled and executed successfully. But taking very long time to execute.

              With ifort, it took 22 min 58 sec. With openf90, was taking 91+ minutes.

               Is it possible to get better performance witgh open64?

              -Sangamesh

                • openf90-4.2.2: Segfaults, but with ifort the program runs well
                  nspattak

                  Try setting -O2 and/or some additional optimizations and see if it still segfaults. Did you try using a debugger?

                  • openf90-4.2.2: Segfaults, but with ifort the program runs well
                    dgilmore

                    Hi Sangamesh,

                    When you compile the application -O2 how long does the program run the segmentation fault occurs?

                    Doug

                      • openf90-4.2.2: Segfaults, but with ifort the program runs well
                        sangamesh

                        Dear Doug,

                            I'm very sorry for late response. Actually I stopped working on this and also stopped using Open64 compiler for benchmarking.

                        With -O2 optimization, it segfaults at the start of execution.

                        With -O0 optimization, it executes for 2+ hours and segfaults. Here is the output:

                        # time ./a.out_OPEN64_O0 | tee Output_Open64_time                                        
                         Re =  140.
                         Tau =  0.585714281                                                                                                        
                         Program Begins.....
                                                                                                                                                   
                        lib-4211 : UNRECOVERABLE library error
                          Unable to find error message (check NLSPATH, file lib.cat)                                                               

                        Encountered during a sequential formatted WRITE to unit 22                                                                 
                        Fortran unit 22 is connected to a sequential formatted text file:
                          "vorticity.dat"                                                                                                          
                         Current format:    31 FORMAT(2001f12.4)
                                                    ^                                                                                              

                        real    133m33.411s                                                                                                        
                        user    133m29.143s
                        sys     0m2.259s              

                         

                        - Sangamesh

                          • openf90-4.2.2: Segfaults, but with ifort the program runs well
                            dgilmore

                            > Dear Doug,
                            >
                            > I'm very sorry for late response. Actually I stopped working on
                            > this and also stopped using Open64 compiler for benchmarking.
                            >
                            > With -O2 optimization, it segfaults at the start of execution.
                            That seems promising in terms of diagnosing the problem.
                            Is there any chance you can send us the source and test case?
                            >
                            > With -O0 optimization, it executes for 2+ hours and segfaults. Here
                            > is the output:
                            > ...
                            > lib-4211 : UNRECOVERABLE library error
                            >   Unable to find error message (check NLSPATH, file lib.cat)
                            The incomplete error message is known bug that we are working on.

                            Again we can look into the actual library problme if you are able to
                            send us the source and a test case.

                            Doug
                            ...
                            > - Sangamesh