Created
February 27, 2020 14:39
-
-
Save bast/e983b422ee1b6218b64b8fb6b70cf911 to your computer and use it in GitHub Desktop.
Allocates a chunk of memory. Can be used to test memory high water mark tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! /usr/bin/time -v ./a.out | |
program example | |
implicit none | |
integer(8), parameter :: mw = 1000000 ! 200 MW or 1525 MB | |
real(8), allocatable :: a(:) | |
print *, 'will try to allocate', 200*mw, 'double precision floats' | |
! allocate 200 MW or 1525 MB | |
allocate(a(200*mw)) | |
a = 1.0d0 | |
print *, 'first element:', a(1) | |
deallocate(a) | |
print *, 'ok all went fine' | |
end program |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment