Assertion `ncp->head != ((void *)0)' failed.

Liu, Jaln jaln.liu at ttu.edu
Fri Feb 15 22:45:33 CST 2013


Hi,

>The assertion failure indicates there is no successful nonblocking calls before
the ncmpi_wait_all().

This is interesting, I traced the program and finally found a bug in my codes. Nothing wrong with the function itself.
The mistake I made is that I didn't store the requests in the right way, therefore, when it comes to the ncmpi_wait, the function couldn't find the data.

Thanks,

Jialin
________________________________________
From: parallel-netcdf-bounces at lists.mcs.anl.gov [parallel-netcdf-bounces at lists.mcs.anl.gov] on behalf of Wei-keng Liao [wkliao at ece.northwestern.edu]
Sent: Wednesday, February 13, 2013 2:44 PM
To: parallel-netcdf at lists.mcs.anl.gov
Subject: Re: Assertion `ncp->head != ((void *)0)' failed.

The assertion failure indicates there is no successful nonblocking calls before
the ncmpi_wait_all().

Can you extract from your codes? I can check if it is PnetCDF internal.

Wei-keng

On Feb 13, 2013, at 2:39 PM, Liu, Jaln wrote:

> Hi Dr. Liao,
>
> I printed the error information, as shown in the attachment,  "`ncp->head != ((void *)0)' failed" is all I can get.
>
> Jialin
> ________________________________________
> From: parallel-netcdf-bounces at lists.mcs.anl.gov [parallel-netcdf-bounces at lists.mcs.anl.gov] on behalf of Wei-keng Liao [wkliao at ece.northwestern.edu]
> Sent: Wednesday, February 13, 2013 1:52 PM
> To: parallel-netcdf at lists.mcs.anl.gov
> Subject: Re: Assertion `ncp->head != ((void *)0)' failed.
>
> I suggest you check the return value of your nonblocking call like below.
>  err = ncmpi_iget_vara( ... );
>  if (err != NC_NOERR)
>      printf("Error: %s\n", ncmpi_strerror(err));
>
> You can use as many ncmpi_iget_vara() calls to the same/different variables as you like.
>
> I also suggest you to give a try to the latest SVN source. It has a new improvement
> for the same-variable cases.
> See instructions in http://trac.mcs.anl.gov/projects/parallel-netcdf/wiki/Download
>
> Wei-keng
>
> On Feb 13, 2013, at 1:43 PM, Liu, Jaln wrote:
>
>> Hi Dr. Liao,
>>
>> Thank you. Other ncmpi call works fine, like  ncmpi_get_vara_float and ncmpi_get_vara_float_all,
>>
>>> Also, I am seeing this line in your codes:
>>>      nb_temp_in[rank]=calloc(varasize,sizeof(float));
>>
>> Yes, it should be `nb_temp'.
>>
>> I wonder can we use ncmpi_iget_vara() on the same variable but different starts&lengths. From the sample program, it is used for multiple variables.
>>
>> Jialin
>> ________________________________________
>> From: parallel-netcdf-bounces at lists.mcs.anl.gov [parallel-netcdf-bounces at lists.mcs.anl.gov] on behalf of Wei-keng Liao [wkliao at ece.northwestern.edu]
>> Sent: Wednesday, February 13, 2013 1:28 PM
>> To: parallel-netcdf at lists.mcs.anl.gov
>> Subject: Re: Assertion `ncp->head != ((void *)0)' failed.
>>
>> Hi, Jialin,
>>
>> I suspect it is because the call to ncmpi_iget_vara() failed.
>> Please check the return values of all your ncmpi_ calls.
>> It may tell you if you got an error before you would like to continue.
>>
>> Also, I am seeing this line in your codes:
>>>      nb_temp_in[rank]=calloc(varasize,sizeof(float));
>>
>> But you are using nb_temp[rank] in ncmpi_iget_vara()
>>
>>
>> Wei-keng
>>
>> On Feb 13, 2013, at 12:13 PM, Liu, Jaln wrote:
>>
>>> Hi,
>>>
>>> When I run the codes below, I got an error " Assertion `ncp->head != ((void *)0)' failed."
>>> (I looked into the source codes, I saw a operation of checking Id, seems each request should be checked and matched with the file handle? I don't know the reason)
>>>
>>>      float ** nb_temp;
>>>      nb_temp=malloc(nprocs*sizeof(float *));
>>>      int * request=calloc(nprocs, sizeof(int));
>>>      int * status=calloc(nprocs,sizeof(int));
>>>      mpi_start[1]=rank*5;//starts on other dimensions are specified to 0.
>>>      int varasize=100*10*NLAT*NLON;
>>>      nb_temp_in[rank]=calloc(varasize,sizeof(float));
>>>
>>>      ncmpi_iget_vara(ncid, temp_varid, mpi_start,mpi_count,nb_temp[rank],varasize,MPI_FLOAT,&(request[rank]);
>>>
>>>      ncmpi_wait_all(ncid, nprocs, request, status);
>>>
>>> A detailed return is in the attachment,
>>>
>>> Can you please tell me what's wrong with the codes?
>>> I appreciate it.
>>>
>>> Jialin
>>> <56034.e>


More information about the parallel-netcdf mailing list