- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, may thanks for the answer!!
Regards,
Rodolfo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page