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

Unreachable code in PIOc_read_darray() #849

Closed
edhartnett opened this issue Mar 8, 2017 · 2 comments
Closed

Unreachable code in PIOc_read_darray() #849

edhartnett opened this issue Mar 8, 2017 · 2 comments
Assignees

Comments

@edhartnett
Copy link
Collaborator

edhartnett commented Mar 8, 2017

In PIOc_read_daray() we have:

  /* Is a rearranger in use? */
   if (iodesc->rearranger > 0)
   {
       if (ios->ioproc && rlen > 0)
       {
           /* Get the MPI type size. */
           if ((mpierr = MPI_Type_size(iodesc->basetype, &tsize)))
               return check_mpi(file, mpierr, __FILE__, __LINE__);

           /* Allocate a buffer for one record. */
           if (!(iobuf = bget((size_t)tsize * rlen)))
               return pio_err(ios, file, PIO_ENOMEM, __FILE__, __LINE__);
       }
   }
   else
   {
       iobuf = array;
   }

There is another if statement later in the function as well.

I believe that iodesc->rearranger must be either 1 or 2, so it is never 0. Better to pioassert it and remove the unreachable code.

@edhartnett edhartnett self-assigned this Mar 8, 2017
@jayeshkrishna
Copy link
Contributor

I remember @jedwards4b mentioning in an issue before that the idea here was to explore cases where we don't use any rearrangers.

@edhartnett
Copy link
Collaborator Author

OK, cool. I will take it out for now.

For 2.2.0 a rearranger is required, and must be BOX or SUBSET.

Future versions of the code can do other things, but we will wait until we have a PR that implements a full feature, instead of leaving partial implementations in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants