Status

  • Managed to run LF, HF, BB and IM_calc (with test_data_simple)
    • LF needed a hot fix to round correctly using math.round() instead of (int)(x+0.5)
    • HF Fortran code needed to be modified due to line width limit (Intel fortran compiler is not forgiving)
  • Validation NOT passed yet : HF random numbers most likely


Validation

CriteriaPass/Fail
LF from both machines produce the "identical" plot_ts animation?

Pass (visually difference unnoticeable)


IM values from LF only should be the sameUntested
IM values from BB should be closeFail
Average IM values after 50 runs with a varying random seed should converge
Histograms of Stampede2/Maui Mean IM value ratio : Should converge to 1

Pass


Distribution of 50-sorted IM values for one station from two machines should overlap

Pass





Useful scripts

Run 50 runs of HF and BB with varying seeds (for Stampede. ibrun instead of srun)

#!/bin/bash
# script version: slurm

# Please modify this file as needed, this is just a sample
#SBATCH --job-name=multi_seed_hf_bb
#SBATCH --account=DesignSafe-Graves
#SBATCH --partition=normal
#SBATCH --ntasks=256
#SBATCH -N 4
#SBATCH --time=00:30:00
#SBATCH --output %x_%j.out
#SBATCH --error %x_%j.err
###SBATCH --mail-type=all
###SBATCH --mail-user=test@test.com
###SBATCH --mem-per-cpu=16G
###SBATCH -C avx

## END HEADER
faultname=Hossack
relname=Hossack_HYP01-10_S1244
test_dir=/scratch/06833/sungbae/RunFolder/EndToEndTest/tests/tmp_20191126_220142
#WORK=$WORK


IMPATH=$gmsim/IM_calculation/IM_calculation/scripts
sim_dir=$test_dir/Runs/$faultname/$relname
vmdata_dir=$test_dir/Data/VMs/$faultname
sourcedata_dir=$test_dir/Data/Sources/$faultname

echo "Computing HF/BB"
runtime_fmt="%Y-%m-%d_%H:%M:%S"
for seed in $(seq 34580 34629);
do
    start_time=`date +$runtime_fmt`
    echo $start_time
    echo "Seed: $seed"

    mkdir -p $sim_dir/HF/Acc/$seed
    ibrun python $gmsim/workflow/scripts/hf_sim.py $sim_dir/../fd_rt01-h0.400.ll $sim_dir/HF/Acc/$seed/HF.bin -m $WORK/VelocityModel/Mod-1D/Cant1D_v3-midQ_OneRay.1d --duration 36.42 --dt 0.005 --sim_bin $gmsim/tools/hb_high_v5.4.5_binmod --version 5.4.5 --dt 0.005 --rvfac 0.8 --sdrop 50 --path_dur 1 --kappa 0.045 --seed $seed --slip $sourcedata_dir/Stoch/$relname.stoch

    mkdir -p $sim_dir/BB/Acc/$seed
    ibrun python $gmsim/workflow/scripts/bb_sim.py $sim_dir/LF/OutBin $vmdata_dir $sim_dir/HF/Acc/$seed/HF.bin $WORK/StationInfo/non_uniform_whole_nz_with_real_stations-hh400_v18p6.vs30 $sim_dir/BB/Acc/$seed/BB.bin --flo 0.25 --version 3.0.4 --site_specific False --fmin 0.2 --fmidbot 0.5 --lfvsref 500.0

    end_time=`date +$runtime_fmt`
    echo $end_time

done


Run IM calc for all BBs with varying seeds

#!/bin/bash
# script version: slurm
# Calculates intensity measures.
#

# Please modify this file as needed, this is just a sample
#SBATCH --job-name=rum_im_calc_multiseed
#SBATCH --account=DesignSafe-Graves
#SBATCH --partition=normal
#SBATCH --ntasks=1
#SBATCH -N 1
#SBATCH --time=01:00:00
#SBATCH --output %x_%j.out
#SBATCH --error %x_%j.err
###SBATCH --mail-type=all
###SBATCH --mail-user=test@test.com
###SBATCH --mem-per-cpu=16G


## END HEADER

faultname=Hossack
relname=Hossack_HYP01-10_S1244
test_dir=/scratch/06833/sungbae/RunFolder/EndToEndTest/tests/tmp_20191126_220142
#WORK=$WORK

IMPATH=$gmsim/IM_calculation/IM_calculation/scripts
sim_dir=$test_dir/Runs/$faultname/$relname
vmdata_dir=$test_dir/Data/VMs/$faultname
sourcedata_dir=$test_dir/Data/Sources/$faultname


for seed in $(ls -d BB/Acc/*/);
do
    seed=`basename $seed`
    start_time=`date +$runtime_fmt`
    echo $start_time
    echo "Seed: $seed"

   # Run the script
    mkdir -p $sim_dir/IM_calc/$seed
    start_time=`date +$runtime_fmt`
    echo "Calculating IMs"
    echo $start_time
    time python $IMPATH/calculate_ims.py $sim_dir/BB/Acc/$seed/BB.bin b -o $sim_dir/IM_calc/$seed -np 64 -i $relname -r $faultname -c geom -t s  -s
    end_time=`date +$runtime_fmt`
    echo $end_time
    # Check that the result files exist
    res=0
    if [[ ! -f $sim_dir/IM_calc/$seed/${relname}.csv ]] || [[ ! -f $sim_dir/IM_calc/$seed/${relname}_imcalc.info ]]; then
        res=1
        echo "IM calculation failed, result files do not exist."
        echo "Check $sim_dir/IM_calc/$seed/${relname}.csv"
        echo "Check $sim_dir/IM_calc/$seed/${relname}_imcalc.info"
    fi
done


Collect all IM calc results from two machines and write a CSV file containing mean IM values

hf_rand_seeds-3.py

  • No labels