View previous topic :: View next topic |
Author |
Message |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Fri Jan 27, 2012 12:42 pm Post subject: 32 bit computer-fortran program |
|
|
I'm writing a binary file in Fortran for some purpose.
The binary file has a fixed format and I'm done with the writing and all works.
The problem I have is on my 32 bit system as well as on my 64 bit system the binary file that is writing (using my program) is done in 5-6 seconds for a particular test problem.
But for another 32 bit computer the program just goes on for 20 minutes!
On another 32 bit computer it goes for 5 minutes.
I have been researchinbg the solution to this and it seems it is to do with the hard disk rpm being different for the computers where the program is being tested.
My own computer (where it takes 1-2 seconds the hard disk rpm is 15,000 rpm). Could anyone advise what is the reason for this? |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Mon Jan 30, 2012 7:08 am Post subject: |
|
|
Please can anyone help? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Mon Jan 30, 2012 11:22 am Post subject: |
|
|
Can you give some more indication of the write task being performed.
What is the size of the written file ?
Could it be a write permission error?
You should use task manager (Ctl+alt+del then select task manager) and monitor the number of bytes written by the process.
It could be memory pageing delays; check peak working set and commit size, especially in relation to physical memory. You can compare this to that expected from the .map file.
The process write is also buffered by the disk I/O cacheing, which is also indicated in task manager.
For the programs taking 5 minutes and 20 minutes, it is worth understanding the speed of the writing to disk. There could be something else stopping the process. I would be surprised if the write is taking a uniform time over 20 minutes; it all depends on the access speed to the disk (network disk?)
Let us know some more info.
John |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Mon Jan 30, 2012 1:08 pm Post subject: |
|
|
The size of the file being written is 21.3MB . It is a binary file.
All machines are connected to network.
What else could cause such slowness?
I did not get your point of memory pageing delays. I mean how to check this? |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Mon Jan 30, 2012 1:13 pm Post subject: |
|
|
Another info besides the above:
1) The machine which it takes >20 minutes has spindle speed of hard disk of 7500 rpm and I/O transfer rate of 300 MB/second
2) My own machine has spindle speed of 15000 rpm and I/O transfer rate of 600 MB/second (which it takes 6 bseconds to write the 21 MB file) |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Mon Jan 30, 2012 1:27 pm Post subject: |
|
|
I suggested you use task manager and the .map file to get the information I asked about. My question about program size was to check if paging could be causing the delay.
If the file is only 21 mb in size, it is a small file and should be written in about 1 second.
Your disk speed of 15,000 rpm is very fast, as I am only familiar with 5,400 and 7,500 rpm disks, although this is irrelevant given the small size of the file being written. Disk speed does not explain 5 or 20 minutes !
John |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Mon Jan 30, 2012 1:32 pm Post subject: |
|
|
Again, use task manager to monitor as the bytes are read and written. Hop[efully watching this may show when the delay takes place (opening, preparing the data, writing or closing)
You could also insert timed reports of what the program is using, using something similar to Code: | SUBROUTINE PNOU (NAME)
!
! Transmits message to screen plus elapse time
!
character (len=*), intent (in) :: name
!
INCLUDE 'sapccom.ins'
CHARACTER NAMBUF*45, LINE*80
EXTERNAL DATEC, TIMEC, ELAPSE_SECOND, FNOU
!
REAL*8 elapse, elapse0
SAVE elapse0
!
CALL DATEC (DATBUF)
CALL TIMEC (TIMBUF)
!
IF (NAME.EQ.'START') THEN
CALL ELAPSE_SECOND (elapse0)
ELSE
CALL ELAPSE_SECOND (elapse)
elapse = elapse - elapse0
NAMBUF = NAME
WRITE (LINE,1001) NAMBUF, TIMBUF, DATBUF, elapse
CALL FNOU (LINE)
END IF
1001 FORMAT (1X,A42,A,' on ',A,F10.2)
RETURN
!
END
|
|
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Mon Jan 30, 2012 7:45 pm Post subject: |
|
|
Thanks a lot for the reply....How to generate the .map file? Please can you help? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Tue Jan 31, 2012 7:55 am Post subject: |
|
|
SLINK option |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Tue Jan 31, 2012 11:25 am Post subject: |
|
|
Thanks a lot for your help and the hint regarding time being taken to open and close the file. Infact, I was opening and closing the file each time a chunk of data was prepeared.
I changed the code such that the file was opned and closed only once during the whole process and that made th difference.
The binary file is generated almost instantaneously in any system I test.
Thanks again |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Wed Feb 01, 2012 12:02 pm Post subject: |
|
|
Just for knowledge, please can anyone (or John if possible) advise why opening and closing a file would take so much time ? (the file was being opened and closed several hundred (or a few thousand) times when it was taking >10 minutes for whole process... |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Thu Feb 02, 2012 2:55 am Post subject: |
|
|
Each time you open the file, the file buffer is initialised. I think it is a direct access file, however the file system must read to the end of the file.
Each time you close the file, if changed, the file buffers are updated to disk and I thionk the buffers are released.
If you say there is an average of 10 mb (0-21 mb) and you do it 2,000 times, that's a total of 10 gb of reading and 10gb of writing.
so the delay |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Thu Feb 02, 2012 7:02 am Post subject: |
|
|
Thanks John.. |
|
Back to top |
|
 |
|