Skip to content
Snippets Groups Projects
Commit 2bab4cdc authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Add grib2 to tests.

parent c349cb6c
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -37,6 +37,7 @@ Makefile.in
/tests/pio_cksum_asynch
/tests/pio_cksum_cdf
/tests/pio_cksum_fpguard
/tests/pio_cksum_grb2
/tests/pio_cksum_mpi_fw_at_all
/tests/pio_cksum_mpi_fw_at_reblock
/tests/pio_cksum_mpi_fw_ordered
......@@ -50,6 +51,7 @@ Makefile.in
/tests/test_chunk_cksum
/tests/test_cksum_extra
/tests/test_cksum_grib
/tests/test_cksum_grib2
/tests/test_cksum_ieg
/tests/test_cksum_nc
/tests/test_cksum_nc2
......@@ -114,9 +116,11 @@ Makefile
/tests/example.svc
/tests/example_0.cksum
/tests/example_0.grb
/tests/example_0.grb2
/tests/example_0.nc4
/tests/example_1.cksum
/tests/example_1.grb
/tests/example_1.grb2
/tests/example_1.nc4
/tests/pio_write
/tests/pio_write_deco2d
......
......@@ -151,6 +151,10 @@ AC_SEARCH_LIBS(floor, m)
ACX_CDI_OPTIONS
AM_CONDITIONAL([ENABLE_NETCDF],[test x$ENABLE_NETCDF = xyes])
AC_CHECK_FUNCS([grib_get_length])
AS_IF([test "x$with_grib_api" != 'x' -a "x$with_grib_api" != 'xno' ],
[ENABLE_LIBGRIB_API=yes],[ENABLE_LIBGRIB_API=no])
AC_SUBST([ENABLE_LIBGRIB_API])
AM_SUBST_NOTMAKE([ENABLE_LIBGRIB_API])
# ----------------------------------------------------------------------
# Compile with MPI support
AC_ARG_ENABLE([mpi],
......@@ -411,6 +415,7 @@ COMPILER="$CC $CFLAGS"
AC_DEFINE_UNQUOTED(COMPILER, ["$COMPILER"], [Compiler])
AC_CONFIG_FILES([tests/test_cksum_grib \
tests/test_cksum_grib2 \
tests/test_cksum_nc \
tests/test_cksum_nc2 \
tests/test_cksum_nc4 \
......@@ -431,6 +436,7 @@ AC_CONFIG_FILES([tests/test_cksum_grib \
tests/pio_cksum_cdf \
tests/test_byteswap_run \
tests/test_resource_copy_run \
tests/pio_cksum_grb2 \
tests/test_resource_copy_mpi_run \
tests/test_cdf_transformation \
tests/test_cdf_const \
......
......@@ -299,7 +299,7 @@ flushReblockBuffer(aFiledataM *of, int blockBufIdx)
MPI_Offset ofs = (MPI_Offset) blockSize
* (((MPI_Offset) of->pending[blockBufIdx].pass * (MPI_Offset) sizePio * of->numBlockBuf)
+ (MPI_Offset) blockBufIdx * (MPI_Offset) sizePio + (MPI_Offset) rankPio);
int wsize = of->pos >= ofs + blockSize ? blockSize : (int) (of->pos - ofs);
int wsize = (of->pos >= ofs + blockSize) ? blockSize : (int) (of->pos - ofs);
xmpi(MPI_File_write_at(of->fh, ofs, blockBuf, wsize, MPI_UNSIGNED_CHAR, MPI_STATUS_IGNORE));
of->pending[blockBufIdx].pass = -1;
of->numMsg = numMsg;
......
......@@ -2,11 +2,15 @@
#
#TESTS = test_grib.sh
TESTS = cksum_verify \
test_cksum_grib test_cksum_nc test_cksum_extra \
test_cksum_grib \
test_cksum_grib2 \
test_cksum_nc test_cksum_extra \
test_cksum_service test_cksum_nc2 test_cksum_nc4 test_cksum_ieg \
test_chunk_cksum \
pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \
pio_cksum_asynch pio_cksum_writer pio_cksum_cdf \
pio_cksum_asynch pio_cksum_writer \
pio_cksum_cdf \
pio_cksum_grb2 \
pio_cksum_mpi_fw_ordered \
pio_cksum_mpi_fw_at_all \
pio_cksum_mpi_fw_at_reblock \
......@@ -71,7 +75,7 @@ EXTRA_DIST = test_cdf_write.c test_cdf_read.c test_cksum_base
AUTOMAKE_OPTIONS = color-tests
#
clean-local: clean-local-dirs
-rm -f *~ *.grb *.nc *.nc2 *.nc4 *.srv *.ext *.cksum *.ieg *.log
-rm -f *~ *.grb *.grb2 *.nc *.nc2 *.nc4 *.srv *.ext *.cksum *.ieg *.log
.PHONY: clean-local-dirs
clean-local-dirs:
......
......@@ -70,11 +70,12 @@ get_chunk(double *chunkBuf, double *var, int varShape[3], int chunk[3][2])
#ifndef TEST_CHUNK_WRITE
static const struct
{
char suffix[4];
char suffix[5];
int type, defaultDT, defaultGrid;
} suffix2type[] = {
{ "nc", CDI_FILETYPE_NC, CDI_DATATYPE_FLT64, GRID_LONLAT },
{ "grb", CDI_FILETYPE_GRB, CDI_DATATYPE_PACK24, GRID_LONLAT },
{ "grb2", CDI_FILETYPE_GRB2, CDI_DATATYPE_PACK24, GRID_LONLAT },
{ "nc2", CDI_FILETYPE_NC2, CDI_DATATYPE_FLT64, GRID_LONLAT },
{ "nc4", CDI_FILETYPE_NC4, CDI_DATATYPE_FLT64, GRID_LONLAT },
{
......
#! @SHELL@
pio_write_args="-f grb2 -w 3"
mpi_task_num=8
LOG=pio_cksum_grb2.log
suffix=grb2
if [ "@USE_MPI@" = yes -a "@ENABLE_LIBGRIB_API@" = yes ]; then
. ./pio_write_run
else
exit 77
fi
#
# Local Variables:
# mode: sh
# End:
#
......@@ -45,11 +45,12 @@ static const struct model_config default_setup
static const struct
{
char suffix[4];
char suffix[5];
int type, defaultDT, defaultGrid;
} suffix2type[] = {
{ "nc", CDI_FILETYPE_NC, CDI_DATATYPE_FLT64, GRID_LONLAT },
{ "grb", CDI_FILETYPE_GRB, CDI_DATATYPE_PACK24, GRID_LONLAT },
{ "grb2", CDI_FILETYPE_GRB2, CDI_DATATYPE_PACK24, GRID_LONLAT },
{ "nc2", CDI_FILETYPE_NC2, CDI_DATATYPE_FLT64, GRID_LONLAT },
{ "nc4", CDI_FILETYPE_NC4, CDI_DATATYPE_FLT64, GRID_LONLAT },
{
......
#! /bin/sh
set -e
format=grb2
if [ "@ENABLE_LIBGRIB_API@" = yes ]; then
exec >test_cksum_$format.log 2>&1
./cksum_write -f $format
./cksum_read example.$format
\rm example.cksum example.$format
\rm test_cksum_$format.log
else
# skip tests for unsupported formats
exit 77
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment