Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
4 Views

A bug?

Hi,

I'm using intel fortran on a mac (ifort version 16.0.3) and I think that there is a possible bug with the MAXLOC function.

When I run the testing.f90 program I get:

           1
           1
           2
           3
           1

using gfortran I get, which in my opinion is the right answer,

          0
           1
           2
           3
           0

Am I right?

Best,

Rodolfo

 

 

0 Kudos
3 Replies
Highlighted
Employee
4 Views

No this is not a bug but just

No this is not a bug but just a difference in the default treatment between the compilers for your case.

There’s a related discussion from the earlier post here.

For your case, you can consider adding the option: -assume noold_maxminloc

You can refer to the User’s guide for additional information on MAXLOC and -assume noold_maxminloc

$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.3.210 Build 20160415
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

$ ifort u629301.f90; ./a.out
           1
           1
           2
           3
           1
$ ifort -assume noold_maxminloc u629301.f90; ./a.out
           0
           1
           2
           3
           0

0 Kudos
Beginner
4 Views

OK, may thanks for the answer

OK, may thanks for the answer!!

Regards,

Rodolfo

0 Kudos
Highlighted
Black Belt
4 Views

gfortran doesn't attempt simd

gfortran doesn't attempt simd optimization of maxloc.  For some reason, ifort simd optimization is still tied to old_maxminloc, and the 2 most recent releases have returned to no simd optimization with noold_maxminloc.

Note that ifort -standard-semantics is the option for supporting f2003 (including noold_maxminloc), with the additional requirement of -fp-model precise for IEEE_arithmetic (which disables more auto-vectorization).

0 Kudos