From 064c9e8fd3fb368d14f63f77d622148fa724bee4 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Fri, 12 Jun 2026 16:51:12 +0300 Subject: [PATCH 1/7] Added test for the new write path thingy --- testpackage/run_tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/testpackage/run_tests.sh b/testpackage/run_tests.sh index d652d9bbbe..25edf42df0 100755 --- a/testpackage/run_tests.sh +++ b/testpackage/run_tests.sh @@ -209,3 +209,17 @@ do echo "--------------------------------------------------------------------------------------------" fi done # loop over tests + + +echo "--------------------------------------------------------------------------------------------" +echo " Testing write path " +echo "--------------------------------------------------------------------------------------------" + +mkdir -p './testing/foo/bar' +$small_run_command $bin --run_config=${test_name[1]}.cfg --io.system_write_file_name 'foo/bar/bulk' --io.system_write_path './testing' --gridbuilder.t_max 180 +filepath_test="./testing/foo/bar/bulk.0000000.vlsv" +if [[ ! -f $filepath_test ]]; then + echo "File was not written to correct path at $filepath_test" + exit 1 +fi +echo "Done" From 47a9c8c26c1f9ea47466e9ef6820cde06994d792 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 15 Jun 2026 10:27:07 +0300 Subject: [PATCH 2/7] Revert "Added test for the new write path thingy" This reverts commit 064c9e8fd3fb368d14f63f77d622148fa724bee4. --- testpackage/run_tests.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/testpackage/run_tests.sh b/testpackage/run_tests.sh index 25edf42df0..d652d9bbbe 100755 --- a/testpackage/run_tests.sh +++ b/testpackage/run_tests.sh @@ -209,17 +209,3 @@ do echo "--------------------------------------------------------------------------------------------" fi done # loop over tests - - -echo "--------------------------------------------------------------------------------------------" -echo " Testing write path " -echo "--------------------------------------------------------------------------------------------" - -mkdir -p './testing/foo/bar' -$small_run_command $bin --run_config=${test_name[1]}.cfg --io.system_write_file_name 'foo/bar/bulk' --io.system_write_path './testing' --gridbuilder.t_max 180 -filepath_test="./testing/foo/bar/bulk.0000000.vlsv" -if [[ ! -f $filepath_test ]]; then - echo "File was not written to correct path at $filepath_test" - exit 1 -fi -echo "Done" From 7bbe3c5cf95a0878415b76a29eaa8bf21a109f13 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 15 Jun 2026 10:33:13 +0300 Subject: [PATCH 3/7] Remade the test to actually use the usual test system because it wasnt actually run_tests that does the test in CI --- testpackage/test_definitions_small.sh | 14 +++ .../tests/write_path_test/test_postproc.sh | 12 ++ .../tests/write_path_test/test_prelude.sh | 3 + .../tests/write_path_test/write_path_test.cfg | 103 ++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 testpackage/tests/write_path_test/test_postproc.sh create mode 100644 testpackage/tests/write_path_test/test_prelude.sh create mode 100644 testpackage/tests/write_path_test/write_path_test.cfg diff --git a/testpackage/test_definitions_small.sh b/testpackage/test_definitions_small.sh index 7cb6cdd1b7..4bbf3b9f3b 100644 --- a/testpackage/test_definitions_small.sh +++ b/testpackage/test_definitions_small.sh @@ -260,6 +260,20 @@ variable_components[${index}]="0 0 1 2 0 1 2" single_cell[${index}]=1 ((index+=1)) +####### +# WRITE PATH TEST (26) +####### + +# 26 write path test +test_name[${index}]="write_path_test" +# comparison_vlsv[${index}]="bulk.0000001.vlsv" +# comparison_phiprof[${index}]="phiprof_0.txt" +# variable_names[${index}]="proton/vg_rho proton/vg_ptensor_diagonal proton/vg_ptensor_diagonal proton/vg_ptensor_diagonal proton/vg_ptensor_offdiagonal proton/vg_ptensor_offdiagonal proton/vg_ptensor_offdiagonal proton" +# variable_components[${index}]="0 0 1 2 0 1 2" +single_cell[${index}]=1 +((index+=1)) + + # choose tests to run (default: all tests) run_tests=( ) for (( c=1; c<$index; c++ )) diff --git a/testpackage/tests/write_path_test/test_postproc.sh b/testpackage/tests/write_path_test/test_postproc.sh new file mode 100644 index 0000000000..3930b46f8b --- /dev/null +++ b/testpackage/tests/write_path_test/test_postproc.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "--------------------------------------------------------------------------------------------" +echo " Testing write path " +echo "--------------------------------------------------------------------------------------------" + +filepath_test="./testing/foo/bar/bulk.0000000.vlsv" +if [[ ! -f $filepath_test ]]; then + echo "File was not written to correct path at $filepath_test" + exit 1 +fi +echo "Done" diff --git a/testpackage/tests/write_path_test/test_prelude.sh b/testpackage/tests/write_path_test/test_prelude.sh new file mode 100644 index 0000000000..50d38b87fa --- /dev/null +++ b/testpackage/tests/write_path_test/test_prelude.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +mkdir -p './testing/foo/bar' diff --git a/testpackage/tests/write_path_test/write_path_test.cfg b/testpackage/tests/write_path_test/write_path_test.cfg new file mode 100644 index 0000000000..d631de6e7e --- /dev/null +++ b/testpackage/tests/write_path_test/write_path_test.cfg @@ -0,0 +1,103 @@ +dynamic_timestep = 0 +project = MultiPeak +propagate_field = 0 +propagate_vlasov_acceleration = 1 +propagate_vlasov_translation = 0 + +ParticlePopulations = proton + +[io] +diagnostic_write_interval = 1 +write_initial_state = 0 + +system_write_t_interval = 180 +system_write_file_name = foo/bar/bulk +system_write_path = ./testing +system_write_distribution_stride = 1 +system_write_distribution_xline_stride = 0 +system_write_distribution_yline_stride = 0 +system_write_distribution_zline_stride = 0 + +[variables] +output = vg_rhom +output = fg_b +output = vg_pressure +output = populations_vg_v +output = fg_e +output = vg_rank +output = populations_vg_blocks +output = populations_vg_rho +#output = populations_vg_acceleration_subcycles + +diagnostic = populations_vg_blocks +#diagnostic = vg_pressure +#diagnostic = populations_vg_rho +#diagnostic = populations_vg_rho_loss_adjust + +[gridbuilder] +x_length = 1 +y_length = 1 +z_length = 1 +x_min = 0.0 +x_max = 1.0e6 +y_min = 0.0 +y_max = 1.0e6 +z_min = 0 +z_max = 1.0e6 +t_max = 180 +dt = 10.0 + +[proton_properties] +mass = 1 +mass_units = PROTON +charge = 1 + +[proton_vspace] +vx_min = -2.0e6 +vx_max = +2.0e6 +vy_min = -2.0e6 +vy_max = +2.0e6 +vz_min = -2.0e6 +vz_max = +2.0e6 +vx_length = 50 +vy_length = 50 +vz_length = 50 +[proton_sparse] +minValue = 1.0e-16 + +[boundaries] +periodic_x = yes +periodic_y = yes +periodic_z = yes + +[MultiPeak] +#magnitude of 1.82206867e-10 gives a period of 360s, useful for testing... +Bx = 1.2e-10 +By = 0.8e-10 +Bz = 1.1135233442526334e-10 +magXPertAbsAmp = 0 +magYPertAbsAmp = 0 +magZPertAbsAmp = 0 + +[proton_MultiPeak] +n = 2 +Vx = 0.0 +Vy = 5e5 +Vz = 0.0 +Tx = 500000.0 +Ty = 500000.0 +Tz = 500000.0 +rho = 2000000.0 +rhoPertAbsAmp = 0 + +Vx = 0.0 +Vy = -5e5 +Vz = 0.0 +Tx = 100000.0 +Ty = 100000.0 +Tz = 100000.0 +rho = 2000000 +rhoPertAbsAmp = 0 + +[bailout] +velocity_space_wall_block_margin = 0 From 087130ceb8fbf15597c3ea110533a99ed407ede7 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Jun 2026 12:08:58 +0300 Subject: [PATCH 4/7] chmod +x on these files --- testpackage/tests/write_path_test/test_postproc.sh | 0 testpackage/tests/write_path_test/test_prelude.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testpackage/tests/write_path_test/test_postproc.sh mode change 100644 => 100755 testpackage/tests/write_path_test/test_prelude.sh diff --git a/testpackage/tests/write_path_test/test_postproc.sh b/testpackage/tests/write_path_test/test_postproc.sh old mode 100644 new mode 100755 diff --git a/testpackage/tests/write_path_test/test_prelude.sh b/testpackage/tests/write_path_test/test_prelude.sh old mode 100644 new mode 100755 From d4b5f0fd5d07a5f3d6129f7753bb125457d74162 Mon Sep 17 00:00:00 2001 From: lassjsc Date: Mon, 15 Jun 2026 13:30:54 +0300 Subject: [PATCH 5/7] Added mv so the files get tested in diff and the testpackage result looks less weird --- testpackage/tests/write_path_test/test_postproc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testpackage/tests/write_path_test/test_postproc.sh b/testpackage/tests/write_path_test/test_postproc.sh index 3930b46f8b..b165e907a5 100755 --- a/testpackage/tests/write_path_test/test_postproc.sh +++ b/testpackage/tests/write_path_test/test_postproc.sh @@ -9,4 +9,5 @@ if [[ ! -f $filepath_test ]]; then echo "File was not written to correct path at $filepath_test" exit 1 fi +mv ./testing/foo/bar/bulk* ./ echo "Done" From 6c1f3f81fd896a41ae74205a38e54243aca4fa88 Mon Sep 17 00:00:00 2001 From: lassejsc Date: Mon, 22 Jun 2026 17:37:57 +0300 Subject: [PATCH 6/7] Testing fixing the grep error again --- testpackage/tests/write_path_test/test_postproc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpackage/tests/write_path_test/test_postproc.sh b/testpackage/tests/write_path_test/test_postproc.sh index b165e907a5..b05781b32e 100755 --- a/testpackage/tests/write_path_test/test_postproc.sh +++ b/testpackage/tests/write_path_test/test_postproc.sh @@ -9,5 +9,5 @@ if [[ ! -f $filepath_test ]]; then echo "File was not written to correct path at $filepath_test" exit 1 fi -mv ./testing/foo/bar/bulk* ./ +mv ./testing/foo/bar/* ./ echo "Done" From a737097255be584c379ee600ae5db14700a1ecce Mon Sep 17 00:00:00 2001 From: lassejsc Date: Tue, 4 Aug 2026 10:19:03 +0300 Subject: [PATCH 7/7] Cleaned up comments and added better print for completion --- testpackage/test_definitions_small.sh | 4 ---- testpackage/tests/write_path_test/test_postproc.sh | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/testpackage/test_definitions_small.sh b/testpackage/test_definitions_small.sh index 4bbf3b9f3b..0da4927e8b 100644 --- a/testpackage/test_definitions_small.sh +++ b/testpackage/test_definitions_small.sh @@ -266,10 +266,6 @@ single_cell[${index}]=1 # 26 write path test test_name[${index}]="write_path_test" -# comparison_vlsv[${index}]="bulk.0000001.vlsv" -# comparison_phiprof[${index}]="phiprof_0.txt" -# variable_names[${index}]="proton/vg_rho proton/vg_ptensor_diagonal proton/vg_ptensor_diagonal proton/vg_ptensor_diagonal proton/vg_ptensor_offdiagonal proton/vg_ptensor_offdiagonal proton/vg_ptensor_offdiagonal proton" -# variable_components[${index}]="0 0 1 2 0 1 2" single_cell[${index}]=1 ((index+=1)) diff --git a/testpackage/tests/write_path_test/test_postproc.sh b/testpackage/tests/write_path_test/test_postproc.sh index b05781b32e..9a38a7d659 100755 --- a/testpackage/tests/write_path_test/test_postproc.sh +++ b/testpackage/tests/write_path_test/test_postproc.sh @@ -10,4 +10,4 @@ if [[ ! -f $filepath_test ]]; then exit 1 fi mv ./testing/foo/bar/* ./ -echo "Done" +echo "Write path test successful!"