Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29591 Discussions

Auto-parallelized F77 code runs but no speedup

Franco_B_
Beginner
1,145 Views

I have a working program (Fortran 77) that I’m trying to auto-parallelize on a cluster. The changes made in the compiling makefiles (abbreviated) are shown in the curly brackets below.
Build library:
FOR=ifort -c -O3 {-parallel}
LINK=ifort {-parallel}
PROG_DIR=/export/home/mydir/
HJS=$(PROG_DIR)/hjs
.f.o:
    $(FOR) $<
    rm libprog.a
    $(FOR) $(HJS)/*.f
    ar -rv $(PROG_DIR)/libprog.a  *.o
    rm *.o
Compile executable:
FOR=ifort -c -O3 {-parallel}
LINK=ifort {-parallel}
PROG_DIR=/export/home/mydir/
LIBPROG=-L$(PROG_DIR) -lprog
.f.o:
         $(FOR) $(OPT) $<
prog_hjs.o: prog_hjs.f
        $(FOR) prog_hjs.f
prog_hjs: prog_hjs.o
        $(LINK) -o prog_hjs prog_hjs.o  $(LIBPROG)

The program appears to utilize as many cores as are given to it, but execution speed is unchanged. What is missing? Is anything more required in the compilation above?

0 Kudos
1 Solution
Kevin_D_Intel
Employee
1,145 Views

The option settings shown are fine for enabling the auto-parallelizer. That the code did not realize any performance gain isn’t necessarily an indication of a problem or auto-parallelizer failure. The next step is producing optimization reports and looking at those, and perhaps profiling the app using Intel® VTune.

If you have not already done so, the Fortran User’s Guide has a small section on Automatic Parallelization,  https://software.intel.com/en-us/node/524683, that might offer some additional guidance/advice too.

There are numerous experts participating in this forum who can help with really nitty gritty details and getting deep into techniques for optimizing for parallelization. I'm sure they will be happy to help answer specific questions and offer guidance about specific issues or situations you find about your app.

View solution in original post

0 Kudos
2 Replies
Kevin_D_Intel
Employee
1,146 Views

The option settings shown are fine for enabling the auto-parallelizer. That the code did not realize any performance gain isn’t necessarily an indication of a problem or auto-parallelizer failure. The next step is producing optimization reports and looking at those, and perhaps profiling the app using Intel® VTune.

If you have not already done so, the Fortran User’s Guide has a small section on Automatic Parallelization,  https://software.intel.com/en-us/node/524683, that might offer some additional guidance/advice too.

There are numerous experts participating in this forum who can help with really nitty gritty details and getting deep into techniques for optimizing for parallelization. I'm sure they will be happy to help answer specific questions and offer guidance about specific issues or situations you find about your app.

0 Kudos
TimP
Honored Contributor III
1,145 Views

I've included some examples in my proposed PowerPoint presentation where source code changes enable ifort 16 to auto-parallelize cases with nested do loops.  Basically, the compiler must be able to switch loops into parallel outer vectorizable inner loop form without dependencies among inner loops.

Another case I discuss is reduction in more than one level of loops, which tends not to work by auto-parallel or explicit reduction unless set up with separate reduction variables for inner and outer loops, where combined omp parallel reduction/omp simd reduction appears to be what works. 

I have a case where auto-parallel will do an array reduction.  This presumably suffers from the overhead of allocating a private array for each thread, so may not deliver the desired performance gain.

0 Kudos
Reply