| 1 | PROGRAM VboxCrusher
|
|---|
| 2 | real*8, allocatable:: arr(:,:)
|
|---|
| 3 | character :: fileName*32='fileN'
|
|---|
| 4 | real time1, time2
|
|---|
| 5 |
|
|---|
| 6 | allocate (arr(1250,100000),stat=ierr)
|
|---|
| 7 | if(ierr.gt.0) then
|
|---|
| 8 | Print*,'Can not allocate 10GB array'
|
|---|
| 9 | goto 1000
|
|---|
| 10 | endif
|
|---|
| 11 |
|
|---|
| 12 | 100 Print*,'Number of 1 GB files to create (1-99). Hit Enter. Use 0 to Stop:'
|
|---|
| 13 | Read(*,*) nFiles
|
|---|
| 14 | if(nfiles.le.0) goto 1000
|
|---|
| 15 |
|
|---|
| 16 | if(nfiles.GT.99) then
|
|---|
| 17 | Print*,'Number of files has to be between 1 and 99'
|
|---|
| 18 | goto 100
|
|---|
| 19 | endif
|
|---|
| 20 |
|
|---|
| 21 | Print*,'This may take some time on slow media. NVMe drives reach speeds ~3-6 GB/s '
|
|---|
| 22 | do 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)
|
|---|
| 31 | enddo
|
|---|
| 32 | print*,' Success'
|
|---|
| 33 | goto 1000
|
|---|
| 34 |
|
|---|
| 35 | !..............................................
|
|---|
| 36 | !...Info if the run fails
|
|---|
| 37 | 900 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
|
|---|
| 40 | 910 print*,'Can not write into file (disk full?)'
|
|---|
| 41 | close(11,err=1000)
|
|---|
| 42 | !..............................................
|
|---|
| 43 |
|
|---|
| 44 | 1000 continue
|
|---|
| 45 | END Program
|
|---|