Skip to content

Conversation

@wkliao
Copy link
Collaborator

@wkliao wkliao commented Dec 8, 2022

When argument filetype is MPI_DATATYPE_NULL in vard APIs, it indicates this request is of zero length. Thus we can skip updating the counters.

Failed test program:
https://github.com/Parallel-NetCDF/PnetCDF/blob/master/test/testcases/test_vard_multiple.c

@shanedsnyder
Copy link

We've actually run into similar issues in the past with the MPI-IO module, not sure why it didn't occur to me to error check this.

Instead of bailing out of instrumentation, I think we should instrument as normal, just marking the access size as 0. That matches what we do in MPI-IO, and would allow us to detect that applications are doing 0-byte operations. Could we instead add logic to CALC_VARD_ACCESS_INFO macro to just set access size to 0 in cases where the given datatpye is NULL?

When argument filetype is MPI_DATATYPE_NULL in vard APIs, it indicates
this request is of zero length. Thus we can skip updating the counters.
@wkliao
Copy link
Collaborator Author

wkliao commented Dec 14, 2022

revised as suggested

@shanedsnyder
Copy link

Thanks, looks good from my local testing.

Quick question I noticed when sanity checking the output log for the test case that was failing: What would we expect the total number of bytes to be transferred from this portion of the test to be:

    /* bufcount is ignored when buftype is MPI_DATATYPE_NULL */
    err = ncmpi_put_vard_all(ncid, varid[0], MPI_INT, buf[0], -1,
                             MPI_DATATYPE_NULL); CHECK_ERR

0 bytes, as well, since the memory datatype is MPI_DATATYPE_NULL?

@wkliao
Copy link
Collaborator Author

wkliao commented Dec 14, 2022

In this case, the write amount is 4 bytes, i.e. size of 3rd argument, filetype.
The buftype being MPI_DATATYPE_NULL means the write buffer is contiguous and its amount is equal to the size of filetype.

@shanedsnyder
Copy link

Perfect, that matches what Darshan is instrumenting so all looks good.

Thanks, I'll go ahead and merge this.

@shanedsnyder shanedsnyder merged commit 907750a into darshan-hpc:main Dec 14, 2022
@shanedsnyder shanedsnyder added this to the 3.4.2 milestone Dec 15, 2022
@wkliao wkliao deleted the vard_ftype branch December 16, 2022 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants