From 362ee1de0653381287a2c8df9fafdf12f28d23f8 Mon Sep 17 00:00:00 2001 From: Peter Doak Date: Tue, 16 Sep 2025 16:33:21 -0400 Subject: [PATCH] initial kagome example --- examples/kagome/gen_temps.awk | 55 ++++++++++++++++++++++++ examples/kagome/input_sp.json.in | 73 ++++++++++++++++++++++++++++++++ examples/kagome/submit_conv.sh | 15 +++++++ 3 files changed, 143 insertions(+) create mode 100755 examples/kagome/gen_temps.awk create mode 100644 examples/kagome/input_sp.json.in create mode 100644 examples/kagome/submit_conv.sh diff --git a/examples/kagome/gen_temps.awk b/examples/kagome/gen_temps.awk new file mode 100755 index 000000000..fe12fc9e2 --- /dev/null +++ b/examples/kagome/gen_temps.awk @@ -0,0 +1,55 @@ +#!/usr/bin/awk -f +BEGIN { + # Configuration - modify these values + output_file = "input.sp.in" + directory_prefix = "T_" + temp_tag = "BETA" + temp_list = "1.0,0.4,0.25" + ntemps = split(temp_list, temps, ",") + prev_temp_tag = "PREVIOUS_TEMP" + current_temp_tag = "CURRENT_TEMP" + # Constant tag replacements + tags["DENS"] = "0.5" + tags["HUBBARDU"] = "4" + tags["VEC1"] = "[2,0]" + tags["VEC2"] = "[0,2]" + tags["ITERS"] = "3" +} + +# Skip BEGIN block for actual processing +FNR == 1 { + # Read the entire template into memory + template = "" +} + +{ + template = template $0 "\n" +} + +END { + # Process for each value in range + for (i = 1; i <= ntemps; i++) { + outdir = directory_prefix temps[i] + status = system("mkdir " outdir) + outfile = outdir "/" output_file + # Start with template + content = template + # Replace varying tag + beta = 1.0 / temps[i] + gsub(temp_tag, beta, content) + gsub(current_temp_tag, temps[i], content) + prev_temp = "zero" + if (i != 1) { + prev_temp = "./" directory_prefix temps[i - 1] "/dca_sp.hdf5" + } + gsub(prev_temp_tag, prev_temp, content) + # Replace constant tags + for (tag in tags) { + gsub(tag, tags[tag], content) + } + # Write output file + printf("%s", content) > outfile + close(output_file) + print "Created " output_file + } +} diff --git a/examples/kagome/input_sp.json.in b/examples/kagome/input_sp.json.in new file mode 100644 index 000000000..e68cc57bc --- /dev/null +++ b/examples/kagome/input_sp.json.in @@ -0,0 +1,73 @@ +{ + "output": { + "directory": "./T_CURRENT_TEMP/", + "output-format": "HDF5", + "filename-dca": "dca_sp.hdf5", + "filename-profiling": "profiling.json", + "dump-lattice-self-energy": true, + "dump-cluster-Greens-functions": true, + "dump-Gamma-lattice": false, + "dump-chi-0-lattice": false + }, + "physics": { + "beta": BETA, + "density": DENS, + "chemical-potential": 0., + "adjust-chemical-potential": true + }, + "Kagome-Hubbard-model": { + "t": 1., + "U": HUBBARDU + }, + "DCA": { + "initial-self-energy": "PREVIOUS_TEMP", + "iterations": ITERS, + "accuracy": 0., + "self-energy-mixing-factor": 0.75, + "interacting-orbitals": [0], + + "coarse-graining": { + "k-mesh-recursion": 3, + "periods": 0, + "quadrature-rule": 1, + "threads": 1, + "tail-frequencies": 0 + } + }, + "domains": { + "real-space-grids": { + "cluster": [VEC1, + VEC2], + "sp-host": [[10, 10], + [10,-10]] + }, + "imaginary-time": { + "sp-time-intervals": 256 + }, + "imaginary-frequency": { + "sp-fermionic-frequencies": 256 + } + }, + + "Monte-Carlo-integration": { + "seed": random, + "warm-up-sweeps": 100, + "sweeps-per-measurement": 1., + "measurements": 100000, + + "threaded-solver": { + "walkers": 3, + "accumulators": 3, + "shared-walk-and-accumulation-thread": true + } + }, + + "CT-AUX": { + "expansion-parameter-K": 4., + "initial-configuration-size": 16, + "initial-matrix-size": 16, + "max-submatrix-size": 256, + "neglect-Bennett-updates": false, + "additional-time-measurements": false + } +} diff --git a/examples/kagome/submit_conv.sh b/examples/kagome/submit_conv.sh new file mode 100644 index 000000000..9ebea9f8f --- /dev/null +++ b/examples/kagome/submit_conv.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#SBATCH -A cph102 +#SBATCH -J DCA_kagome +#SBATCH -o %x-%j.out +#SBATCH -t 00:30:00 +#SBATCH -p batch +#SBATCH -q debug +#SBATCH -N 8 +#SBATCH --threads-per-core=1 +#SBATCH -C nvme + +srun --ntasks-per-node 7 -m block:cyclic --gpus-per-task=1 --gpu-bind=closest -n 56 -c 1 ../../applications/dca/main_dca T_1.0/input.sp.in +srun --ntasks-per-node 7 -m block:cyclic --gpus-per-task=1 --gpu-bind=closest -n 56 -c 1 ../../applications/dca/main_dca T_0.4/input.sp.in +srun --ntasks-per-node 7 -m block:cyclic --gpus-per-task=1 --gpu-bind=closest -n 56 -c 1 ../../applications/dca/main_dca T_0.25/input.sp.in