- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I got an error in compiling a simple code under PSXE2016 update 1 and VS 2015 SP1:
program matmul_test use ISO_FORTRAN_ENV, only : rk => real64 implicit none ! Variables integer :: i integer, parameter :: n = 2000 real(rk) :: t0, t1 real(rk), dimension(:,:), allocatable :: matrix_a, matrix_b, matrix_c ! Body of matmul print *, '--- Matmul error message test' allocate(matrix_a(n,n)) allocate(matrix_b(n,n)) allocate(matrix_c(n,n)) ! some random values call random_seed() call random_number(matrix_a) call random_number(matrix_b) ! perform calculation call cpu_time(t0) matrix_c = matmul(matrix_a,matrix_b) call cpu_time(t1) write(*,'(a, f10.3)') ' Time for matmul = ', t1-t0 end program matmul_test
The compiler options are:
/nologo /O2 /Qopt-matmul /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc140.pdb" /libs:dll /threads /c
This is the error message:
1>------ Build started: Project: matmul, Configuration: Release x64 ------
1>Compiling with Intel(R) Visual Fortran Compiler 16.0.1.146 [Intel(R) 64]...
1>matmul_test.f90
1>ifort: command line error: option '/Qopt-matmul' not supported
1>
1>Build log written to "file://D:\02_Fortran\99_test\matmul\x64\Release\BuildLog.htm"
1>matmul - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Severity Code Description Project File Line Suppression State
Error command line error: option '/Qopt-matmul' not supported ifort
This compile error does not lead to the conflict. '/Qopt-matmul' seems only to work if '/Qparallel' is also enabled or if /o3 is requested, which enables /Qparallel(?). The documentation does not give a hint on this. It is only said, that a minimum of /o2 is necessary to be considered.
'/Qopt-matmul=sequential' seems to be not supported anymore in PSXE 16 up1?
If I'm right with my observation, I would be happy, if the documentation and the error message would be updated.
Best regards, Johannes
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I confirmed this apparent documentation bug. As the doc says:
/Qopt-matmul[-]
replace matrix multiplication with calls to intrinsics and threading
libraries for improved performance (DEFAULT at /O3 /Qparallel)
opt-matmul was included in O3 or Qparallel, in earlier ifort releases, but was available outside of those options.
Likewise, the combination /Qopt-matmul- -O3 was available, but is no longer. This used to be the way to optimize matmul with in-line code for single thread.
I had some difficulty saving your source file in a form readable by ifort, but succeeded eventually. Generating asm files, I see no reference to the former external library support code for matmul. So it does appear that opt-matmul has been retired without corresponding change in the documentation.
Qparallel now appears to be inserting calls to kmp threaded library without otherwise changing the generated code or invoking specific library support for matmul.
According to Qopt-report4, O3 now adds unroll-and-jam optimization and adds code targeted for sizes from 8 to 500 where the default targets 125. O3 and Qparallel together target up to 2000.
opt-report says there is a vector math library call, even at default settings (but with QxHost), but I don't see it in the external references.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is true that /Qopt-matmul requires both O2 or higher and /Qparallel or /Qopenmp. The message the driver gives could be better. I will ask the documentation and the message to be improved. It has not been retired.
The optimizer decides whether or not to call the opt-matmul routine - I don't know what criteria it uses. However, I do know that the inline-generated code for MATMUL has improved over the years.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Tim, dear Steve,
many thanks for your replies.
@Steve Since /Qopt-matmul works only with /Qparallel or /Qopenmp, I assume the sequential option is obsolete in PSXE 16, which was an option in 15?
Regards, Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not seeing any sort of modifier for /Qopt-matmul in the 15.0 documentation, nor do I remember it ever having one. See https://software.intel.com/en-us/node/524953 Perhaps you are thinking of /Qmkl which does have a :sequential option.
The documentation does say:
This option is enabled by default if options O3 and
parallelare specified. To disable this optimization, specify -qno-opt-matmul or /Qopt-matmul-.This option has no effect unless option O2 or higher is set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked and found that the next major version no longer gives the error message if you leave off /Qparallel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
thanks for the info. Good to know that this will give no compile error in the next major release.
You are right, I let me be confused with the /Qmkl=sequential option and I read this thread not completely (https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/540816), otherwise I had known that this ('/Qopt-matmul=sequential') was only an idea for an option from Jim and nothing what was, is and will be implemented.
Best regards, Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm happy to report, that PSXE 16 Update 3 solves this issue also. The combination of /O2, /Qopt-matmul and no parallelization nor OpenMP compiles now without errors, but don't expect a speed up.
Many thanks, Johannes
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page