[petsc-dev] CI error

Mark Adams mfadams at lbl.gov
Tue Apr 13 09:15:04 CDT 2021


On Tue, Apr 13, 2021 at 12:21 AM Barry Smith <bsmith at petsc.dev> wrote:

>
>   I like the diversity of slightly different test boxes. If all test boxes
> are the same than that limits what variants we test and reduces the
> usefulness of the CI; since users will face this diversity in their
> machines and end up with errors we never see before hand (which is bad).
>
>    This kind of "after the fact initialization "for (q = 0; q <
> LANDAU_MAX_Q_FACE; q++) col_scale[q] = 0.0; " is unlikely to satisfy the
> various compilers and optimization levels. Best to figure out universally
> how to indicate when the variable is declared that it gets initialized
> suitably (for confused compilers that don't realize the initialized values
> are never used and so print warning messages).
>
>
>    This seems to work for C++?
> https://icarus.cs.weber.edu/~dab/cs1410/textbook/7.Arrays/initialize.html
>
>
> https://stackoverflow.com/questions/201101/how-to-initialize-all-members-of-an-array-to-the-same-value seems
> to indicate one can initialize all entries in C with one {0} but who trusts
> the web or all compilers.
>

Wow, 2M views and 1334 +1.

>
>     Have you tried the C form?
>

int arr[SIZE] = {};

failed on mswin but arr[SIZE] = {0}; seemed to work.


> Barry
>
>
>
>
> On Apr 12, 2021, at 8:06 AM, Satish Balay via petsc-dev <
> petsc-dev at mcs.anl.gov> wrote:
>
> This job gets run on either pj01 or pj02 - each have slightly different
> version of gcc. (and they behave differently wrt certain warnings)
>
> [trade-off with diversity in testing and having redundancy in  available
> work machines - so jobs are not stuck on a single box]
>
> I  guess I should somehow fix this (perhaps switch them all to same
> OS/versions].
>
> Satish
>
> On Sun, 11 Apr 2021, Mark Adams wrote:
>
> This warning went away. i don't know why.
>
> On Sun, Apr 11, 2021 at 2:10 PM Mark Adams <mfadams at lbl.gov> wrote:
>
> I get this error in CI with complex float:
> https://gitlab.com/petsc/petsc/-/jobs/1170144554
>
> I put in code earlier to fix this warning about uninitialized vars, but
> now it does not seem to work:
>
>
> /home/glci/builds-stage1/AbTGp5-t/0/petsc/petsc/src/ts/utils/dmplexlandau/plexland.c:414:94:
> error: ‘col_scale[4]’ may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> 2251 <https://gitlab.com/petsc/petsc/-/jobs/1170144554#L2251> PetscScalar
>
> vals[LANDAU_MAX_Q_FACE*LANDAU_MAX_Q_FACE],row_scale[LANDAU_MAX_Q_FACE],col_scale[LANDAU_MAX_Q_FACE];
>
> Yet I have code to initialize col_scale:
>
>        for (q = 0; q < LANDAU_MAX_Q_FACE; q++) col_scale[q] = 0.0; //
> suppress warnings
>
> I get a similar error with an integer array.
>
> Any suggestions?
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20210413/f71a8a13/attachment-0001.html>


More information about the petsc-dev mailing list