Skip to content

Commit 3161152

Browse files
committed
force-cube with memory limits
1 parent 94db184 commit 3161152

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bash/force-cube.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,13 @@ for i in "$@"; do
386386
debug "Y_TILE_RANGE = $TYMIN $TYMAX"
387387

388388

389+
# check free RAM
390+
MEMORY=$(LANG="C"; free --mega | awk '/^Mem/ { printf("%.0fM\n", $2 * 0.05) }')
391+
389392
# cube the file, spawn multiple jobs for each tile
390393
export WKT ORIGX ORIGY TILESIZE CHUNKSIZE RES
391394
export FINP DOUT COUT INODATA ONODATA RESAMPLE RASTER DATATYPE ATTRIBUTE
392-
$PARALLEL_EXE -j $NJOB cubethis {1} {2} ::: $(seq $TXMIN $TXMAX) ::: $(seq $TYMIN $TYMAX)
395+
$PARALLEL_EXE -j $NJOB --memsuspend "$MEMORY" cubethis {1} {2} ::: $(seq $TXMIN $TXMAX) ::: $(seq $TYMIN $TYMAX)
393396

394397
# remove the temporary file
395398
rm "$FTMP"

misc/force-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.12-dev:::2024-05-17_16:02:57
1+
3.7.12-dev:::2024-05-21_08:25:19

0 commit comments

Comments
 (0)