VirtualBox

Ticket #21348: box.f90

File box.f90, 1.3 KB (added by DanV, 21 months ago)

See the description how to compile in the text of the ticket. Or i can send you EXE if you want

Line 
1PROGRAM VboxCrusher
2real*8, allocatable:: arr(:,:)
3character :: fileName*32='fileN'
4real time1, time2
5
6allocate (arr(1250,100000),stat=ierr)
7if(ierr.gt.0) then
8 Print*,'Can not allocate 10GB array'
9 goto 1000
10endif
11
12100 Print*,'Number of 1 GB files to create (1-99). Hit Enter. Use 0 to Stop:'
13Read(*,*) nFiles
14if(nfiles.le.0) goto 1000
15
16if(nfiles.GT.99) then
17 Print*,'Number of files has to be between 1 and 99'
18 goto 100
19endif
20
21Print*,'This may take some time on slow media. NVMe drives reach speeds ~3-6 GB/s '
22do i=1,nfiles
23 write(fileName(6:7),'(i2.2)',err=900) i
24 Open (11, file=fileName, form='unformatted', err=900)
25 print*,' Creating fileN=', i
26 CALL CPU_TIME(TIME1)
27 write(11, err=910) Arr
28 CALL CPU_TIME(TIME2)
29 close(11)
30 print*,' Created fileN=', i,' Speed GB/s :', 10./(time2-time1 + 1.e-10)
31enddo
32print*,' Success'
33goto 1000
34
35!..............................................
36!...Info if the run fails
37900 if(i.eq.1) print*,'Can not open file by some reason (file already opened by some other program)'
38 if(i.gt.1) print*,'Can not open next file by some reason (disk full?)'
39 goto 1000
40910 print*,'Can not write into file (disk full?)'
41 close(11,err=1000)
42!..............................................
43
441000 continue
45END Program

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy