#!/bin/bash

set -euo pipefail

if [[ $# < 1 ]]; then
  echo Usage: $0 MEMORY_BYTES
  exit 1
fi

memory="$1"
timeout=2

echo Allocating $memory megabytes for $timeout seconds...

./ci/gpu/alloc_memory --megabytes "$memory" --timeout_seconds "$timeout" --alsologtostderr
