File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,20 @@ build_images()
159159 continue
160160 fi
161161 fi
162+ total_freemem=` free -k | grep Mem: | awk ' {print $7}' `
163+ free_mem=` echo \( $total_freemem /100\) * 90 | bc`
164+ #
165+ # We are using arrays of 8 byte elements, and there are 3 of them.
166+ #
167+ actual_mem_use=` echo $cache_size_kb * 24 | bc`
168+ #
169+ # Do not build if the free_mem is less then the amount of memory
170+ # this array size requires.
171+ #
172+ if [[ $free_mem -lt $actual_mem_use ]]; then
173+ echo Requested size, ${cache_size_kb} K, is too large.
174+ continue
175+ fi
162176
163177 CC_CMD=" gcc ${MOPT} -fopenmp -mcmodel=large ${optim_opt} -DSTREAM_ARRAY_SIZE=${use_cache} stream_omp_5_10.c -o ${stream} -fno-pic"
164178 echo $CC_CMD >> streams_build_options
You can’t perform that action at this time.
0 commit comments