Created
April 26, 2012 21:17
-
-
Save goodell/2503321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static int | |
| write_NC(NC *ncp) | |
| { | |
| int status, mpireturn, rank; | |
| void *buf; | |
| MPI_Offset hsz; /* header size with 0-padding if needed */ | |
| MPI_Status mpistatus; | |
| assert(!NC_readonly(ncp)); | |
| MPI_Comm_rank(ncp->nciop->comm, &rank); | |
| if (NC_dofill(ncp)) { /* hsz is the header size with zero padding */ | |
| /* we don't need this, as these paddings will never be accessed */ | |
| hsz = MIN(ncp->begin_var, ncp->begin_rec); | |
| hsz = MAX(hsz, ncp->xsz); | |
| } | |
| else | |
| hsz = ncp->xsz; | |
| buf = NCI_Malloc(hsz); /* header buffer for I/O */ | |
| if (hsz > ncp->xsz) | |
| memset((char*)buf+ncp->xsz, 0, hsz - ncp->xsz); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment