- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a file with several routines that allocate a total of about 2000 different arrays, based on the model size, and give them some initial value. They look something like this:
When I compile this file with optimization turned on, it takes about 90 seconds to compile. Without optimization, it only takes 2 or 3 seconds. Any idea what the compiler is doing that takes so long? If I turn off optimization for this file, will it somehow affect run time when I use these arrays?
[plain] subroutine ALLOC1
use MOD_1, only : n_1, A_1, B_1, C_1
allocate( A_1(n_1))
allocate( B_1(n_1))
allocate( C_1(n_1))
A_1 = 0.
B_1 = 0.
C_1 = 0.
return
end[/plain]
When I compile this file with optimization turned on, it takes about 90 seconds to compile. Without optimization, it only takes 2 or 3 seconds. Any idea what the compiler is doing that takes so long? If I turn off optimization for this file, will it somehow affect run time when I use these arrays?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide the actual code that shows such a difference? "looks like this" isn't enough to be able to analyze.
I'd guess that vectorization is trying to optimize the initialization loops - yes, turning off optimization would make it slower, but you can test this yourself. Also, which compiler version are you using and what compile options?
I'd guess that vectorization is trying to optimize the initialization loops - yes, turning off optimization would make it slower, but you can test this yourself. Also, which compiler version are you using and what compile options?

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