#!/bin/bash

# SPDX-FileCopyrightText: 2026 Samudra Authors
#
# SPDX-License-Identifier: Apache-2.0

# Assumes you have activated the emulator conda environment and
# set the CLUSTER_NAME and OCEAN_DATA_DIR environment variables
set -e
CONFIG_PATH=configs/train_cm4.yaml

echo 'Running local training on cluster:' $CLUSTER_NAME 'with data directory:' $OCEAN_DATA_DIR
echo 'Using config file:' $CONFIG_PATH

# current date
DATE=$(date +%Y-%m-%d)

uv run torchrun -m src.ocean_emulators.train $CONFIG_PATH --experiment.data_root $OCEAN_DATA_DIR --experiment.name "${DATE}-test" --data.loader_version om4-torch
