<div dir="ltr"><div class="gmail_default" style="font-family:comic sans ms,sans-serif;color:#38761d">Okay great - thank you!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 30, 2014 at 12:11 PM, Wei-keng Liao <span dir="ltr"><<a href="mailto:wkliao@eecs.northwestern.edu" target="_blank">wkliao@eecs.northwestern.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Jim<br>
<br>
After I move the call to ncmpi_wait() to after ncmpi_end_indep_data()<br>
I can reproduce the error.<br>
<br>
The problem has been fixed in the latest revision of PnetCDF.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Wei-keng<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Dec 30, 2014, at 12:13 PM, Wei-keng Liao wrote:<br>
<br>
> Hi, Jim<br>
><br>
> I was not able to reproduce the error. Could you try the following program?<br>
> Also, could you add an error checking for the ncmpi APIs before ncmpi_end_indep_data.<br>
> I wonder if there is an error returned from one of those APIs.<br>
><br>
> #include <stdio.h><br>
> #include <stdlib.h><br>
> #include <mpi.h><br>
> #include <pnetcdf.h><br>
><br>
> #define NY 4<br>
> #define NX 10<br>
> #define NDIMS 2<br>
><br>
> #define ERR \<br>
>    if (err != NC_NOERR) { \<br>
>        printf("Error at line=%d: %s\n", __LINE__, ncmpi_strerror(err)); \<br>
>    }<br>
><br>
> int main(int argc, char** argv)<br>
> {<br>
>    int rank, nprocs, err;<br>
>    int ncid, varid, dimid[2], req, st;<br>
>    MPI_Offset start[2], count[2], stride[2];<br>
>    unsigned char buffer[NY][NX];<br>
><br>
>    MPI_Init(&argc, &argv);<br>
>    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
>    MPI_Comm_size(MPI_COMM_WORLD, &nprocs);<br>
><br>
>    err = ncmpi_create(MPI_COMM_WORLD, "<a href="http://testfile.nc" target="_blank">testfile.nc</a>", NC_CLOBBER|NC_64BIT_DATA,<br>
>                       MPI_INFO_NULL, &ncid);<br>
>    ERR<br>
><br>
>    err = ncmpi_def_dim(ncid, "Y", NY,        &dimid[0]); ERR<br>
>    err = ncmpi_def_dim(ncid, "X", NX*nprocs, &dimid[1]); ERR<br>
>    err = ncmpi_def_var(ncid, "var", NC_UBYTE, NDIMS, dimid, &varid); ERR<br>
>    err = ncmpi_enddef(ncid); ERR<br>
><br>
>     start[0] = 0;     start[1] = NX*rank;<br>
>     count[0] = NY/2;  count[1] = NX/2;<br>
>    stride[0] = 2;    stride[1] = 2;<br>
>    err = ncmpi_buffer_attach(ncid, NY*NX); ERR<br>
><br>
>    err = ncmpi_begin_indep_data(ncid); ERR<br>
>    err = ncmpi_bput_vars_uchar(ncid, varid, start, count, stride,<br>
>                                &buffer[0][0], &req);<br>
>    ERR<br>
>    err = ncmpi_wait(ncid, 1, &req, &st); ERR<br>
>    err = ncmpi_end_indep_data(ncid); ERR<br>
><br>
>    err = ncmpi_buffer_detach(ncid); ERR<br>
>    err = ncmpi_close(ncid); ERR<br>
><br>
>    MPI_Finalize();<br>
>    return 0;<br>
> }<br>
><br>
><br>
> Wei-keng<br>
><br>
> On Dec 30, 2014, at 10:31 AM, Jim Edwards wrote:<br>
><br>
>> Hi Wei-keng,<br>
>><br>
>> I have a code block that looks like:<br>
>><br>
>>      ncmpi_begin_indep_data(file->fh);<br>
>><br>
>>      usage = 0;<br>
>><br>
>>      if(ios->io_rank==file->indep_rank){<br>
>><br>
>> ierr = ncmpi_bput_vars_uchar(file->fh, varid, start, count, stride, op, &request);;<br>
>><br>
>> pio_push_request(file, request);<br>
>><br>
>> ierr = ncmpi_inq_buffer_usage(ncid, &usage);<br>
>><br>
>> //   printf("%s %d %d\n",__FILE__,__LINE__,usage);<br>
>><br>
>>      }<br>
>><br>
>><br>
>>      ncmpi_end_indep_data(file->fh);<br>
>><br>
>><br>
>> It's generating an error message on the ncmpi_end_indep_data call:<br>
>> MPI_FILE_WRITE_AT(83): File does not exist<br>
>><br>
>> Regardless of the error message the write seems to work fine, any idea what's causing this?<br>
>><br>
>> I'm using pnetcdf svn revision 1920 with intel 15 compiler and mpich.<br>
>><br>
>> - Jim<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Jim Edwards<br>
>><br>
>> CESM Software Engineer<br>
>> National Center for Atmospheric Research<br>
>> Boulder, CO<br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div>Jim Edwards<br><br></div><font size="1">CESM Software Engineer<br></font></div><font size="1">National Center for Atmospheric Research<br></font></div><font size="1">Boulder, CO</font> <br></div></div>
</div>