how to do nonblocking collective i/o
Liu, Jaln
jaln.liu at ttu.edu
Mon Jan 28 00:32:54 CST 2013
Hi,
I want to test the nonblocking i/o of PnetCDF, is there an implementation of non-blocking version's two-phase collective I/O?
Here are the codes I wrote:
else if(isnonblock==1)
{
float ** nb_temp_in=malloc(numcalls*sizeof(float *));
int * request=calloc(numcalls, sizeof(int));
int * status=calloc(numcalls,sizeof(int));
int varasize;
for(j=0;j<numcalls;j++)
{
mpi_count[1]=(j>NLVL)?NLVL:j+1;
varasize=mpi_count[0]*mpi_count[1]*NLAT*NLON;
nb_temp_in[j]=calloc(varasize,sizeof(float));
if (ret = ncmpi_iget_vara(ncid, temp_varid, mpi_start,mpi_count,nb_temp_in[j],varasize,MPI_FLOAT,&(request[j])));
if (ret != NC_NOERR) handle_error(ret);
}
ret = ncmpi_wait_all(ncid, numcalls, request, status);
for (j=0; j<numcalls; j++)
if (status[j] != NC_NOERR) handle_error(status[j]);
}
I have two questions,
1, in the above code, what is right way to parallelize the program? by decomposing the for loop " for(j=0;j<numcalls;j++)"?
2, how to do non-blocking collective I/O? is there a function like 'ncmpi_iget_vara_all'?
Thanks for your attention.
Regrads,
Jialin Liu
More information about the parallel-netcdf
mailing list