File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ ncmpio_add_record_requests(NC_lead_req *lead_list,
132132int
133133ncmpio_igetput_varm(NC *ncp,
134134 NC_var *varp,
135- const MPI_Offset start[ ] , /* not NULL */
135+ const MPI_Offset start[ ] , /* not NULL, if not scalar */
136136 const MPI_Offset count[ ] , /* not NULL */
137137 const MPI_Offset stride[ ] , /* may be NULL */
138138 const MPI_Offset imap[ ] , /* may be NULL */
@@ -504,7 +504,11 @@ ncmpio_igetput_varm(NC *ncp,
504504 MPI_Type_dup(buftype, &lead_req->buftype);
505505
506506 /* allocate a single array for non-leads to store start/count/stride */
507- if (stride == NULL) {
507+ if (varp->ndims == 0) { /* scalar variable, start may be NULL */
508+ lead_req->start = NULL;
509+ req->start = NULL;
510+ }
511+ else if (stride == NULL) {
508512 size_t memChunk = varp->ndims * SIZEOF_MPI_OFFSET;
509513 if (IS_RECVAR(varp) && count[ 0] > 1)
510514 lead_req->start = (MPI_Offset*) NCI_Malloc(memChunk * 2 * count[ 0] );
You can’t perform that action at this time.
0 commit comments