Skip to content

Commit

Permalink
got working with one var
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Feb 19, 2019
1 parent 9b42613 commit da90671
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions tests/cunit/test_perf1.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ int test_perf1(int iosysid, int ioid, int num_flavors, int *flavor, int my_rank,
ERR(ret);

/* Define a variable. */
if ((ret = PIOc_def_var(ncid, VAR_NAME, pio_type, NDIM3, dimids, &varid)))
if ((ret = PIOc_def_var(ncid, VAR_NAME, pio_type, NDIM4, dimids, &varid)))
ERR(ret);

/* End define mode. */
Expand Down Expand Up @@ -233,31 +233,32 @@ int test_perf1(int iosysid, int ioid, int num_flavors, int *flavor, int my_rank,
if ((ret = PIOc_setframe(ncid2, varid, 0)))
ERR(ret);

/* /\* Read the data. *\/ */
/* if ((ret = PIOc_read_darray(ncid2, varid, ioid, arraylen, test_data_in))) */
/* ERR(ret); */

/* /\* Check the results. *\/ */
/* for (int f = 0; f < arraylen; f++) */
/* { */
/* switch (pio_type) */
/* { */
/* case PIO_INT: */
/* if (test_data_int_in[f] != test_data_int[f]) */
/* return ERR_WRONG; */
/* break; */
/* case PIO_FLOAT: */
/* if (test_data_float_in[f] != test_data_float[f]) */
/* return ERR_WRONG; */
/* break; */
/* case PIO_DOUBLE: */
/* if (test_data_double_in[f] != test_data_double[f]) */
/* return ERR_WRONG; */
/* break; */
/* default: */
/* ERR(ERR_WRONG); */
/* } */
/* } */
/* Read the data. */
/* PIOc_set_log_level(3); */
if ((ret = PIOc_read_darray(ncid2, varid, ioid, arraylen, test_data_in)))
ERR(ret);

/* Check the results. */
for (int f = 0; f < arraylen; f++)
{
switch (pio_type)
{
case PIO_INT:
if (test_data_int_in[f] != test_data_int[f])
return ERR_WRONG;
break;
case PIO_FLOAT:
if (test_data_float_in[f] != test_data_float[f])
return ERR_WRONG;
break;
case PIO_DOUBLE:
if (test_data_double_in[f] != test_data_double[f])
return ERR_WRONG;
break;
default:
ERR(ERR_WRONG);
}
}

/* Close the netCDF file. */
if ((ret = PIOc_closefile(ncid2)))
Expand Down Expand Up @@ -311,7 +312,6 @@ int run_benchmark(int iosysid, int num_flavors, int *flavor, int my_rank,
&ioid3, pio_type[t])))
return ret;

/* PIOc_set_log_level(3); */
/* Run a simple performance test. */
if ((ret = test_perf1(iosysid, ioid3, num_flavors, flavor, my_rank, pio_type[t])))
return ret;
Expand Down

0 comments on commit da90671

Please sign in to comment.