Skip to content

Commit

Permalink
disallow type conversion in vard writes (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jun 5, 2019
1 parent 9f84247 commit b280e4a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 40 deletions.
20 changes: 18 additions & 2 deletions src/clib/pio_getput_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,16 +1483,32 @@ int
PIOc_put_vard_tc(int ncid, int varid, int decompid, const PIO_Offset recnum,
nc_type xtype, const void *buf)
{
iosystem_desc_t *ios; /* Pointer to io system information. */
io_desc_t *iodesc; /* The IO description. */
file_desc_t *file; /* Pointer to file information. */
var_desc_t *vdesc; /* Pointer to var information. */
int ret;

/* Get file info. */
if ((ret = pio_get_file(ncid, &file)))
return pio_err(NULL, NULL, ret, __FILE__, __LINE__);
ios = file->iosystem;

/* Set the value of the record dimension. */
if ((ret = PIOc_setframe(ncid, varid, recnum)))
return ret;
return pio_err(ios, file, ret, __FILE__, __LINE__);

/* Get decomposition information. */
if (!(iodesc = pio_get_iodesc_from_id(decompid)))
return PIO_EBADID;
return pio_err(ios, file, PIO_EBADID, __FILE__, __LINE__);

/* Get var info. */
if ((ret = get_var_desc(varid, &file->varlist, &vdesc)))
return pio_err(ios, file, ret, __FILE__, __LINE__);

/* Disallow type conversion for now. */
if (xtype != vdesc->pio_type)
return pio_err(ios, file, PIO_EBADTYPE, __FILE__, __LINE__);

/* Write the distributed array. */
if ((ret = PIOc_write_darray(ncid, varid, decompid, iodesc->ndof,
Expand Down
50 changes: 25 additions & 25 deletions src/clib/pio_put_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

/**
* Get strided, muti-dimensional subset of a text variable.
* Put strided, muti-dimensional subset of a text variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -45,7 +45,7 @@ PIOc_put_vars_text(int ncid, int varid, const PIO_Offset *start, const PIO_Offse
}

/**
* Get strided, muti-dimensional subset of an unsigned char variable.
* Put strided, muti-dimensional subset of an unsigned char variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -74,7 +74,7 @@ PIOc_put_vars_uchar(int ncid, int varid, const PIO_Offset *start,
}

/**
* Get strided, muti-dimensional subset of a signed char variable.
* Put strided, muti-dimensional subset of a signed char variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -102,7 +102,7 @@ PIOc_put_vars_schar(int ncid, int varid, const PIO_Offset *start, const PIO_Offs
}

/**
* Get strided, muti-dimensional subset of an unsigned 16-bit integer
* Put strided, muti-dimensional subset of an unsigned 16-bit integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand Down Expand Up @@ -131,7 +131,7 @@ PIOc_put_vars_ushort(int ncid, int varid, const PIO_Offset *start, const PIO_Off
}

/**
* Get strided, muti-dimensional subset of a 16-bit integer variable.
* Put strided, muti-dimensional subset of a 16-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -159,7 +159,7 @@ PIOc_put_vars_short(int ncid, int varid, const PIO_Offset *start,
}

/**
* Get strided, muti-dimensional subset of an unsigned integer
* Put strided, muti-dimensional subset of an unsigned integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand Down Expand Up @@ -188,7 +188,7 @@ PIOc_put_vars_uint(int ncid, int varid, const PIO_Offset *start, const PIO_Offse
}

/**
* Get strided, muti-dimensional subset of an integer variable.
* Put strided, muti-dimensional subset of an integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -216,7 +216,7 @@ PIOc_put_vars_int(int ncid, int varid, const PIO_Offset *start, const PIO_Offset
}

/**
* Get strided, muti-dimensional subset of a 64-bit integer variable.
* Put strided, muti-dimensional subset of a 64-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -244,7 +244,7 @@ PIOc_put_vars_long(int ncid, int varid, const PIO_Offset *start, const PIO_Offse
}

/**
* Get strided, muti-dimensional subset of a floating point variable.
* Put strided, muti-dimensional subset of a floating point variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -272,7 +272,7 @@ PIOc_put_vars_float(int ncid, int varid, const PIO_Offset *start, const PIO_Offs
}

/**
* Get strided, muti-dimensional subset of a 64-bit unsigned integer
* Put strided, muti-dimensional subset of a 64-bit unsigned integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand Down Expand Up @@ -301,7 +301,7 @@ PIOc_put_vars_longlong(int ncid, int varid, const PIO_Offset *start, const PIO_O
}

/**
* Get strided, muti-dimensional subset of a 64-bit floating point
* Put strided, muti-dimensional subset of a 64-bit floating point
* variable.
*
* This routine is called collectively by all tasks in the
Expand Down Expand Up @@ -330,7 +330,7 @@ PIOc_put_vars_double(int ncid, int varid, const PIO_Offset *start, const PIO_Off
}

/**
* Get strided, muti-dimensional subset of an unsigned 64-bit integer
* Put strided, muti-dimensional subset of an unsigned 64-bit integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand Down Expand Up @@ -359,7 +359,7 @@ PIOc_put_vars_ulonglong(int ncid, int varid, const PIO_Offset *start, const PIO_
}

/**
* Get one value from an text variable.
* Put one value from an text variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -380,7 +380,7 @@ PIOc_put_var1_text(int ncid, int varid, const PIO_Offset *index, const char *op)
}

/**
* Get one value from an text variable.
* Put one value from an text variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -402,7 +402,7 @@ PIOc_put_var1_uchar(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from an signed char variable.
* Put one value from an signed char variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -424,7 +424,7 @@ PIOc_put_var1_schar(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from an unsigned 16-bit integer variable.
* Put one value from an unsigned 16-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -446,7 +446,7 @@ PIOc_put_var1_ushort(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from a 16-bit integer variable.
* Put one value from a 16-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -468,7 +468,7 @@ PIOc_put_var1_short(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from an unsigned integer variable.
* Put one value from an unsigned integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -490,7 +490,7 @@ PIOc_put_var1_uint(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from an integer variable.
* Put one value from an integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -511,7 +511,7 @@ PIOc_put_var1_int(int ncid, int varid, const PIO_Offset *index, const int *op)
}

/**
* Get one value from an floating point variable.
* Put one value from an floating point variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -532,7 +532,7 @@ PIOc_put_var1_float(int ncid, int varid, const PIO_Offset *index, const float *o
}

/**
* Get one value from an integer variable.
* Put one value from an integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -553,7 +553,7 @@ PIOc_put_var1_long(int ncid, int varid, const PIO_Offset *index, const long *op)
}

/**
* Get one value from an 64-bit floating point variable.
* Put one value from an 64-bit floating point variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -575,7 +575,7 @@ PIOc_put_var1_double(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from an unsigned 64-bit integer variable.
* Put one value from an unsigned 64-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -597,7 +597,7 @@ PIOc_put_var1_ulonglong(int ncid, int varid, const PIO_Offset *index,
}

/**
* Get one value from a 64-bit integer variable.
* Put one value from a 64-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down Expand Up @@ -1153,7 +1153,7 @@ PIOc_put_var(int ncid, int varid, const void *op)
}

/**
* Get one value from a variable of any type.
* Put one value from a variable of any type.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down
26 changes: 13 additions & 13 deletions src/clib/pio_put_vard.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

/**
* Get strided, muti-dimensional subset of a text variable.
* Put distributed array subset of a text variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -38,7 +38,7 @@ PIOc_put_vard_text(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of an unsigned char variable.
* Put distributed array subset of an unsigned char variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -59,7 +59,7 @@ PIOc_put_vard_uchar(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of a signed char variable.
* Put distributed array subset of a signed char variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -80,7 +80,7 @@ PIOc_put_vard_schar(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of an unsigned 16-bit integer
* Put distributed array subset of an unsigned 16-bit integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand All @@ -102,7 +102,7 @@ PIOc_put_vard_ushort(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of a 16-bit integer variable.
* Put distributed array subset of a 16-bit integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -123,7 +123,7 @@ PIOc_put_vard_short(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of an unsigned integer
* Put distributed array subset of an unsigned integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand All @@ -145,7 +145,7 @@ PIOc_put_vard_uint(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of an integer variable.
* Put distributed array subset of an integer variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -166,7 +166,7 @@ PIOc_put_vard_int(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/* /\** */
/* * Get strided, muti-dimensional subset of a 64-bit integer variable. */
/* * Put distributed array subset of a 64-bit integer variable. */
/* * */
/* * This routine is called collectively by all tasks in the */
/* * communicator ios.union_comm. */
Expand All @@ -187,7 +187,7 @@ PIOc_put_vard_int(int ncid, int varid, int decompid, const PIO_Offset recnum,
/* } */

/**
* Get strided, muti-dimensional subset of a floating point variable.
* Put distributed array subset of a floating point variable.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand All @@ -208,7 +208,7 @@ PIOc_put_vard_float(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of a 64-bit unsigned integer
* Put distributed array subset of a 64-bit unsigned integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand All @@ -230,7 +230,7 @@ PIOc_put_vard_longlong(int ncid, int varid, int decompid, const PIO_Offset recnu
}

/**
* Get strided, muti-dimensional subset of a 64-bit floating point
* Put distributed array subset of a 64-bit floating point
* variable.
*
* This routine is called collectively by all tasks in the
Expand All @@ -252,7 +252,7 @@ PIOc_put_vard_double(int ncid, int varid, int decompid, const PIO_Offset recnum,
}

/**
* Get strided, muti-dimensional subset of an unsigned 64-bit integer
* Put distributed array subset of an unsigned 64-bit integer
* variable.
*
* This routine is called collectively by all tasks in the
Expand All @@ -274,7 +274,7 @@ PIOc_put_vard_ulonglong(int ncid, int varid, int decompid, const PIO_Offset recn
}

/**
* Write strided, muti-dimensional subset of a variable of any type.
* Write distributed array subset of a variable of any type.
*
* This routine is called collectively by all tasks in the
* communicator ios.union_comm.
Expand Down

0 comments on commit b280e4a

Please sign in to comment.