- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have installed the Intell Fortran Compiler 9.0 and VS Integration component. The problem is that i cannot accomplish automatic code generation for parallelization of loops. What are the steps i must follow (in the VS environment) to automatically generate parallel code? Will this feature take full advantage of my computer's dual core capabilities?
Windows Xp Professional, AMD Athlon 64 Dual Core 4200+
Windows Xp Professional, AMD Athlon 64 Dual Core 4200+
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You would enable auto-vectorization by setting -QxW. For easily parallized code, there is the -Qparallel option, which generates thread parallel OpenMP code automatically. In most practical cases, you would require -Qopenmp and OpenMP directives, to get effective threading. With the Qparallel or OpenMP code, when you set the environment variable OMP_NUM_THREADS=2 at run time, the threaded loops will use both cores.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do i set those options? I did set the Qparallel option from Project---->Properties but no code is generated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a test for the auto parallelization i use the following lines of code:
PROGRAM console2
PARAMETER (N=100000000)
REAL A, C(N)
DO I = 1, N
A=2*I-1
C(I) = SQRT(A)
ENDDO
write(*,*) N, C(1), C(N)
END
Also the command line looks like this:
/nologo /Zi /Qunroll3 /Qparallel /Qpar_threshold:0 /recursive /reentrancy /Qopenmp /warn:all /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /check:bounds /libs:static /dbglibs /c
I still cannot see any code generated. What am i doing wrong?
PROGRAM console2
PARAMETER (N=100000000)
REAL A, C(N)
DO I = 1, N
A=2*I-1
C(I) = SQRT(A)
ENDDO
write(*,*) N, C(1), C(N)
END
Also the command line looks like this:
/nologo /Zi /Qunroll3 /Qparallel /Qpar_threshold:0 /recursive /reentrancy /Qopenmp /warn:all /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /check:bounds /libs:static /dbglibs /c
I still cannot see any code generated. What am i doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks as if you started with a debug configuration - you've got /Zi and /check:bounds in there - the latter would probably disable any parallelization. Removing some of those options I get this:
H:>ifort /Qunroll3 /Qparallel /Qpar_threshold:0 /recursive /reentrancy /Qopenmp t.f90
Intel Fortran Compiler for 32-bit applications, Version 9.0 Build 20060120Z Package ID: W_FC_C_9.0.029
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
H: .f90(5) : (col. 0) remark: LOOP WAS AUTO-PARALLELIZED.
Are you looking for something else?
H:>ifort /Qunroll3 /Qparallel /Qpar_threshold:0 /recursive /reentrancy /Qopenmp t.f90
Intel Fortran Compiler for 32-bit applications, Version 9.0 Build 20060120Z Package ID: W_FC_C_9.0.029
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
H: .f90(5) : (col. 0) remark: LOOP WAS AUTO-PARALLELIZED.
Are you looking for something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, i removed some options as you suggested and i managed to get the "loop was paralelized message" in Bulidlog.htm file. Can i actually get to see the pararellized code? Also another question. How can i change the OMP_NUM_THREADS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can ask for an assembly listing - I'm not sure how helpful that will be.
OMP_NUM_THREADS is an environment variable you can set before running the program. I would suggest that you read the chapter on parallel programming in the "Optimizing Applications" manual for a lot more information. You may also find /Qpar-report3 to provide additional helpful information.
OMP_NUM_THREADS is an environment variable you can set before running the program. I would suggest that you read the chapter on parallel programming in the "Optimizing Applications" manual for a lot more information. You may also find /Qpar-report3 to provide additional helpful information.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page