Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Tempering

Parallel tempering configuration in ALF.

Overview

Parallel tempering (replica exchange) runs multiple simulations at different parameter values simultaneously and periodically proposes swaps between neighboring replicas. This helps overcome energy barriers and reduces autocorrelation in systems that are difficult to sample at a single parameter point.

Tempering in ALF requires MPI. Configure with:

source configure.sh GNU Tempering HDF5

This sets both -DMPI and -DTEMPERING preprocessor flags.

Parameters

Set in the &VAR_TEMP namelist in the parameters file.

ParameterDefaultDescription
N_exchange_steps6Number of exchange (swap) moves attempted per exchange event
N_Tempering_frequency10Frequency of exchange events (in sweeps)
mpi_per_parameter_set2Number of MPI ranks per replica
Tempering_calc_det.true.Include the fermion determinant ratio in the exchange acceptance. Set to .false. if the varied parameter only enters the bosonic action S0S_0

Example

&VAR_TEMP
N_exchange_steps       = 6
N_Tempering_frequency  = 10
mpi_per_parameter_set  = 2
Tempering_calc_det     = .T.
/

Directory Structure

Tempering runs use a specific directory layout. See Scripts_and_Parameters_files/Start_Tempering/ for a template:

Run/
├── parameters          # shared parameter file (includes &VAR_TEMP)
├── seeds               # random seeds
├── out_to_in_temper.sh # restart helper
├── Temp_0/
│   └── parameters      # parameters for replica 0
├── Temp_1/
│   └── parameters      # parameters for replica 1
└── ...

Each Temp_N/ directory contains a parameters file with the parameter values specific to that replica (e.g., different Beta, coupling strength, or chemical potential). The shared parameters file in the root sets global options including &VAR_TEMP.

Running

The total number of MPI ranks must be a multiple of mpi_per_parameter_set:

# 4 replicas × 2 MPI ranks each = 8 total
mpirun -np 8 $ALF_DIR/Prog/ALF.out

ALF splits the MPI communicator: replica_index = rank / mpi_per_parameter_set. Each replica writes output to its Temp_N/ subdirectory.

Guidelines

Temperature Grid

Exchange Acceptance

Fermion Determinant

Restarts

Use the tempering-specific restart script:

bash out_to_in_temper.sh

This loops over all Temp_*/ directories and renames confout_*confin_* in each.

Known Pitfalls