Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments for PIOc_write_darray() #186

Merged
merged 5 commits into from
Nov 10, 2016
Merged

Comments for PIOc_write_darray() #186

merged 5 commits into from
Nov 10, 2016

Conversation

edhartnett
Copy link
Collaborator

I have added comments to PIOc_write_darray(). Please review the comments and tell me what I got wrong. ;-)

I have used double-question marks where I am confused. If you could provide some comments for those places, that would really speed things up.

This is related to #89.

@@ -282,10 +283,16 @@ int PIOc_write_darray(const int ncid, const int vid, const int ioid,
/* Is this a record variable? */
recordvar = vdesc->record >= 0 ? true : false;

/* Check that ??? is not the same as length of data being
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the local size of the variable passed in matches the size expected by the io descriptor.

@@ -298,6 +305,7 @@ int PIOc_write_darray(const int ncid, const int vid, const int ioid,
/* separate record and non-record variables */
if (recordvar)
{
/* What is going on here?? */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wmb is write multi buffer and is a pointer to one or more variables that fit the same description. We are moving to the end of the wmb linked list to add the current variable.

@@ -361,34 +382,38 @@ int PIOc_write_darray(const int ncid, const int vid, const int ioid,

/* Get memory for data. */
if (arraylen > 0)
if (!(wmb->data = bgetr(wmb->data, (1+wmb->validvars)*arraylen*tsize)))
if (!(wmb->data = bgetr(wmb->data, (1 + wmb->validvars) * arraylen * tsize)))
piomemerror(*ios, (1 + wmb->validvars) * arraylen * tsize, __FILE__, __LINE__);

/* Get memory for ??? */
if (!(wmb->vid = (int *)bgetr(wmb->vid, sizeof(int) * (1 + wmb->validvars))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vid is an array of variable ids in the wmb list, grow the list and add the new entry.

piomemerror(*ios, (1 + wmb->validvars) * arraylen * tsize, __FILE__, __LINE__);

/* Get memory for ??? */
if (!(wmb->vid = (int *)bgetr(wmb->vid, sizeof(int) * (1 + wmb->validvars))))
piomemerror(*ios, (1 + wmb->validvars) * sizeof(int), __FILE__, __LINE__);

/* Get memory for ??? */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wmb->frame is the record number, we assume that the variables in the wmb list may not all have the same unlimited dimension value although they usually do.


/* ??? */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the unlimited dimension value of this variable to the frame array in wmb

@@ -1,7 +1,5 @@
/**
* @file
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've tried to simplify this test and that's fine, but instead of replacing a working test why not create a new one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really a working test. If you look, you will see it does nothing with darrays (yet). It is just the start of the darray test I am writing. (The same is true of test_darray_async.c) They started as code copied from a test creating a more complex test file. In this first darray outing I am going to keep it very simple. ;-)

@edhartnett edhartnett merged commit 410f34d into master Nov 10, 2016
@edhartnett edhartnett deleted the ejh_darray4 branch November 12, 2016 16:13
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