Skip to content

Commit

Permalink
further cleanup of async code
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed May 12, 2016
1 parent 10b178a commit a0aaea9
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions src/clib/pio_nc_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,61 +1808,7 @@ int PIOc_put_att(int ncid, int varid, const char *name, nc_type xtype,
int PIOc_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
PIO_Offset len, const short *op)
{
int ierr;
int msg;
int mpierr = MPI_SUCCESS;
iosystem_desc_t *ios;
file_desc_t *file;
char *errstr;

errstr = NULL;
ierr = PIO_NOERR;

file = pio_get_file_from_id(ncid);
if(file == NULL)
return PIO_EBADID;
ios = file->iosystem;
msg = PIO_MSG_PUT_ATT_SHORT;

if(ios->async_interface && ! ios->ioproc){
if(ios->compmaster)
mpierr = MPI_Send(&msg, 1,MPI_INT, ios->ioroot, 1, ios->union_comm);
mpierr = MPI_Bcast(&(file->fh),1, MPI_INT, ios->compmaster, ios->intercomm);
}


if(ios->ioproc){
switch(file->iotype){
#ifdef _NETCDF
#ifdef _NETCDF4
case PIO_IOTYPE_NETCDF4P:
ierr = nc_put_att_short(file->fh, varid, name, xtype, (size_t)len, op);;
break;
case PIO_IOTYPE_NETCDF4C:
#endif
case PIO_IOTYPE_NETCDF:
if(ios->io_rank==0){
ierr = nc_put_att_short(file->fh, varid, name, xtype, (size_t)len, op);;
}
break;
#endif
#ifdef _PNETCDF
case PIO_IOTYPE_PNETCDF:
ierr = ncmpi_put_att_short(file->fh, varid, name, xtype, len, op);;
break;
#endif
default:
ierr = iotype_error(file->iotype,__FILE__,__LINE__);
}
}

if(ierr != PIO_NOERR){
errstr = (char *) malloc((strlen(__FILE__) + 20)* sizeof(char));
sprintf(errstr,"in file %s",__FILE__);
}
ierr = check_netcdf(file, ierr, errstr,__LINE__);
if(errstr != NULL) free(errstr);
return ierr;
return PIOc_put_att(ncid, varid, name, xtype, len, op);
}

/**
Expand Down

0 comments on commit a0aaea9

Please sign in to comment.