ECC-1352: CCSDS with multi-threaded tests

This commit is contained in:
Shahram Najm 2022-02-28 16:08:16 +00:00
parent 7ae5755547
commit ada56cdb30
2 changed files with 22 additions and 5 deletions

View File

@ -89,7 +89,7 @@ static int encode_file(char* input_file, char* output_file)
GRIB_CHECK(grib_set_long(clone_handle, "bitsPerValue", 16), 0);
/*GRIB_CHECK(grib_set_string(clone_handle, "packingType", "grid_ccsds", &str_len), 0);*/
GRIB_CHECK(grib_set_string(clone_handle, "packingType", "grid_simple", &str_len), 0);
/*GRIB_CHECK(grib_set_string(clone_handle, "packingType", "grid_simple", &str_len), 0);*/
GRIB_CHECK(grib_set_double_array(clone_handle, "values", values, values_len), 0);
@ -118,7 +118,7 @@ void do_stuff(void* arg)
int i;
for (i = 0; i < FILES_PER_ITERATION; i++) {
sprintf(output_file, "temp.grib_encode_pthreads.out_%d-%d.grib", (int)number, i);
sprintf(output_file, "temp.grib_encode_pthreads_test.out_%d-%d.grib", (int)number, i);
encode_file(INPUT_FILE, output_file);
}
}

View File

@ -10,8 +10,25 @@
. ./include.sh
input=$ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl
label="grib_encode_pthreads_test"
${test_dir}/grib_encode_pthreads $input
# Simple packing
# --------------
${test_dir}/grib_encode_pthreads $ECCODES_SAMPLES_PATH/GRIB2.tmpl
for f in temp.$label.out_*.grib; do
${tools_dir}/grib_get -p min,max,avg $f > $f.simple.txt
done
rm -f temp.grib_encode_pthreads.out_*.grib
rm -f temp.$label.out_*.grib
# CCSDS packing
# --------------
${test_dir}/grib_encode_pthreads $ECCODES_SAMPLES_PATH/ccsds_grib2.tmpl
for f in temp.$label.out_*.grib; do
${tools_dir}/grib_get -p min,max,avg $f > $f.ccsds.txt
diff $f.simple.txt $f.ccsds.txt
rm $f.simple.txt $f.ccsds.txt
done
rm -f temp.$label.out_*.grib