- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code snippet executes in 7 seconds with CVF and in 14 seconds with IVF on our reference computer. Both compilers are set to default settings.
Is there any way to improve performance of IVF?
integer*4 i,j
character*(20) c
c='123'
do j=1,1000000
read(c,'(i)') i
end do
end
Thank you for your time.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at the generated code, the IVF code is shorter and cleaner - but the real work is going on inside the run-time library, which evolved from the CVF library.
Is this really representative of your application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the Multithreaded DLL, our performance numbers correspond with yours (ie. IVF marginally slower). However, when linking statically (Multithreaded), the program takes 4x as long to execute. Do you have any suggestions as to why this could happen?
Currently we have got IVF 10.1.021, but I will update and give it another try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If internal I/O is the bottleneck in your program, perhaps you should look at another way of accomplishing this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
If internal reads are performing locks in order to get exclusive access to an internal formatting buffer then you might suggest to your compiler writers to use thread local storage for the internal formatting buffer. i.e avoid locks for internal reads.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) We have two run-time libraries available for our console program (Fortran -> Libraries -> Runtime Library) in VS2005:
- Multithreaded (/libs:static /threads)
- Multithreaded DLL (/libs:dll /threads)
2) The Multithreaded Dll gives the expected performance for internal reads (on par with CVF).
3) The Multithreaded static library is four times slower.
What causes the difference in performance? We would prefer to link statically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
>>The locks are to protect the data structures, not the buffer. Internal I/O is treated like normal I/O to a special unit number. We have to protect against access from another thread.
Can you give a reasonable explination why (for internal I/O) this protection is warranted?
Afterall you could have
ArrayA = ArrayB
Being issued by one thread while another thread is issuing
ArrayA = ArrayC
By the requirement of having internal I/O perform locks you should then require locks on the array copy (and all the other statements that would give the apperance of an atomic operation).
If a programmer is performing internal I/O to a shared variable with proper user code synchronization then they will never have a conflicting use.
If a programmer is performing internal I/O to a shared variable without proper user code synchronization then they will occasionaly have a conflicting use.
When the conflict occures with lock on internal I/O then you will have a consistant but incorrect value in the shared buffer and you have a programming error.
When the conflict occures without lock on internal I/O then you may have an inconsistant and incorrect value in the shared buffer and you have a programming error.
In either case you have a programming error. At the point of error does consistancy matter?
If consistancy does not matter in a programming error situation then performance should trump consistancy and therefore internal I/O should be done without locks.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The actual access of the user data is not synchronized by the library. That is up to the user to do. The I/O library has internal data structures used to keep track of I/O operations in progress and these structures are synchronized.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try this:
Go to the Properties -> Fortran ->Command Line, and add
/reentrancy:none
to the command line
When the default library configuration went from "single threaded" to "multi threaded" there was a period of time we had the "reentrancy:threaded" attribute set too.
If I read between the lines correctly, you're not really doing any multithreaded stuff, and so don't need to worry about reentrancy.
- Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it,
Then the user should call CRT functions that do not lock or write there own.
It seems a pitty that internal I/O would modify internal data structures thus requiring a lock. A little work on the compiler writers could eliminate this (e.g. post pone the lock until you get deeper into the I/O routine where lock is required).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LIBC.lib(crt0init.obj) : warning LNK4254: section '.CRT' (40000040) merged into '.data' (C0000040) with different attributes

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page