mirror of https://github.com/ecmwf/eccodes.git
Test: Add variable to tune number of values
This commit is contained in:
parent
d5c1ca51b3
commit
f171627e10
|
@ -19,12 +19,13 @@ int opt_write = 0; /* If 1 write handle to file */
|
||||||
static int encode_values(grib_handle* h, char *output_file)
|
static int encode_values(grib_handle* h, char *output_file)
|
||||||
{
|
{
|
||||||
double *values;
|
double *values;
|
||||||
size_t size = 1000 * 1000;
|
const size_t DIM = 1000;
|
||||||
|
size_t size = DIM * DIM;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
values = (double*)malloc(size*sizeof(double));
|
values = (double*)malloc(size*sizeof(double));
|
||||||
for (i=0; i<size; ++i) {
|
for (i=0; i<size; ++i) {
|
||||||
double v = i;
|
double v = i;
|
||||||
if (i % 1000 == 0) v = 0;
|
if (i % DIM == 0) v = 0;
|
||||||
values[i] = v;
|
values[i] = v;
|
||||||
}
|
}
|
||||||
GRIB_CHECK(grib_set_long(h,"bitsPerValue",16),0);
|
GRIB_CHECK(grib_set_long(h,"bitsPerValue",16),0);
|
||||||
|
@ -88,7 +89,6 @@ int main(int argc, char **argv)
|
||||||
if (parallel) {
|
if (parallel) {
|
||||||
/* Now we will create the thread passing it data as an argument */
|
/* Now we will create the thread passing it data as an argument */
|
||||||
pthread_create(&workers[thread_counter], NULL, runner, data);
|
pthread_create(&workers[thread_counter], NULL, runner, data);
|
||||||
/*pthread_join(workers[thread_counter], NULL);*/
|
|
||||||
thread_counter++;
|
thread_counter++;
|
||||||
} else {
|
} else {
|
||||||
do_encode(data);
|
do_encode(data);
|
||||||
|
|
Loading…
Reference in New Issue