NEP 4.3.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
conversion_perf.c File Reference

Compare standard numeric nxCDF conversion and quantized I/O. More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "nep.h"
#include "nxcdf/nxcdf.h"
#include "nep_meta.h"
#include "nxcdf_internal.h"
#include "perf_disk.h"

Macros

#define NVALS   ((size_t)768 * 1536)
#define NCOPIES   10
#define NREPS   10
#define TMP_FILE   "conversion_perf_tmp.nc"
#define CHECK(call)

Functions

static double seconds (void)
static int run_case (FILE *csv, int which, int compressed, const int *ints, const float *floats, const double *doubles)
int main (int argc, char **argv)

Detailed Description

Compare standard numeric nxCDF conversion and quantized I/O.

Usage: conversion_perf RESULTS.csv. Each case uses 768*1536 signed integer-valued inputs, ten copies, ten repetitions and minimum times. Writes include fsync; reads follow an untimed cache-eviction request. Output columns are engine,case,storage,copies,nvalues,memory_bytes, file_bytes,write_s,read_s,write_MBps,read_MBps. Throughput counts memory bytes, not the potentially narrower on-disk representation. Benchmark verification is outside timed regions. No external filter is needed.

Author
Edward Hartnett, Intelligent Data Design, Inc.

Macro Definition Documentation

◆ CHECK

#define CHECK ( call)
Value:
do { int e = (call); if (e) { fprintf(stderr, "%s: %s\n", #call, nc_strerror(e)); exit(2); } } while (0)

Abort on an unexpected NetCDF status.

◆ NCOPIES

#define NCOPIES   10

Time steps per file.

◆ NREPS

#define NREPS   10

Repetitions per case.

◆ NVALS

#define NVALS   ((size_t)768 * 1536)

Values in each time step.

◆ TMP_FILE

#define TMP_FILE   "conversion_perf_tmp.nc"

File owned by this program.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Run the six cases with both storage layouts.

Parameters
argcArgument count; must be two.
argvOutput CSV path in argv[1].
Returns
Zero on success, one on failure, two on usage or NetCDF error.

◆ run_case()

int run_case ( FILE * csv,
int which,
int compressed,
const int * ints,
const float * floats,
const double * doubles )
static

Run one case and write its verified minimum times.

Parameters
csvOutput stream.
whichCase index.
compressedNonzero for shuffle/deflate1.
intsInteger input array.
floatsFloat input array.
doublesDouble input array.
Returns
Zero on success, one on verification or storage failure.

◆ seconds()

double seconds ( void )
static

Return monotonic time in seconds.

Returns
Time in seconds.