[petsc-dev] cray warning - reduction in alignment ignored

Hapla Vaclav vaclav.hapla at erdw.ethz.ch
Mon Feb 4 08:39:10 CST 2019


Barry, I realized the problem appeared because of --with-precision=single. Without that the warnings disappeared. Maybe DMNetwork code should be completely disabled for single (all tests actually require double)? Or is it expected to work fine with single on other archs?

I also wanted to run the tests but apparently test harness doesn't work with --with-batch
#	/scratch/snx3000/haplav/petsc/config/petsc_harness.sh: line 123: Not_appropriate_for_batch_systems_You_must_use_your_batch_system_to_submit_MPI_jobs_speak_with_your_local_sys_admin: command not found

But running some examples manually, they look fine:

/scratch/snx3000/haplav/petsc/src/ksp/ksp/examples/tutorials/network>srun -n 2 ./ex1_nest
Vec Object: 2 MPI processes
  type: mpi
Process [0]
  Edge 0:
    -1.
  Edge 1:
    7.
  Edge 2:
    -4.
Process [1]
  Edge 3:
    -2.
  Edge 4:
    -1.
  Edge 5:
    3.
  Vertex 0:
    -2.
  Vertex 1:
    -1.
  Vertex 2:
    3.
  Vertex 3:
    0.


/scratch/snx3000/haplav/petsc/src/snes/examples/tutorials/network/power>srun ./power -snes_rtol 1.e-3
nb = 9, ngen = 3, nload = 3, nbranch = 9
Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 3



Vaclav


> On 1 Feb 2019, at 19:43, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
> 
>   I cannot remember why it is sizeof(PetscScalar) specifically. I do remember that having an alignment is crucial to DMNetwork and it can fail and crash if there is no alignment. So it is possible that the code will not work with the Cray compilers. 
> 
>   The attribute is checked in config/PETSc/configure.py; my guess is that since Cray is producing only a warning the configure check is saying that the attribute exists which maybe wrong in this situation. Can you take a look at the configure.log and see what it is reporting, or email it?
> 
>  My wild guess is that we should be turning off the attribute (during the configure process) for the Cray compiler to prevent generating bad code and crashing at run time. You could check if the DMNetwork code (possibly) works correctly with the Cray compiler by running the tests:
> 
> src/ksp/ksp/examples/tutorials/network/ex1.c:      requires: !complex double define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/ksp/ksp/examples/tutorials/network/ex1_nest.c:      requires: !complex double define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/ksp/ksp/examples/tutorials/network/ex2.c:      requires: !single double define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/ksp/ksp/examples/tutorials/network/makefile:#requiresdefine   'PETSC_HAVE_ATTRIBUTEALIGNED'
> src/snes/examples/tutorials/network/ex1.c:     requires: !complex double define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/ex1.c:      requires: double !complex define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/ex1.c:      requires: double !complex define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/makefile:#requiresdefine   'PETSC_HAVE_ATTRIBUTEALIGNED'
> src/snes/examples/tutorials/network/power/makefile:#requiresdefine   'PETSC_HAVE_ATTRIBUTEALIGNED'
> src/snes/examples/tutorials/network/power/power.c:     requires: !complex double define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/power/power.c:     requires: double !complex define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/power/power.c:     requires: double !complex define(PETSC_HAVE_ATTRIBUTEALIGNED)
> src/snes/examples/tutorials/network/power/power.h:} PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
> src/snes/examples/tutorials/network/power/power.h:} PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
> src/snes/examples/tutorials/network/power/power.h:} PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
> src/snes/examples/tutorials/network/power/power.h:} PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
> 
>   Thanks
> 
>   Barry
> 
> 
> 
> 
>> On Feb 1, 2019, at 11:47 AM, Hapla Vaclav via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
>> 
>> I've got this with Cray compiler
>> 
>>         CC arch-daint-cray-opt/obj/dm/impls/network/network.o
>> CC-1160 craycc: WARNING File = /scratch/snx3000/haplav/petsc/include/petsc/private/dmnetworkimpl.h, Line = 20
>> A reduction in alignment is ignored.
>> } PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
>>   ^
>> 
>> CC-1160 craycc: WARNING File = /scratch/snx3000/haplav/petsc/include/petsc/private/dmnetworkimpl.h, Line = 25
>> A reduction in alignment is ignored.
>> } PETSC_ATTRIBUTEALIGNED(sizeof(PetscScalar));
>>   ^
>> 
>> Cray C : Version 8.7.3 (20180718184853_d127f1e88e6a577c0c4f008444940f2bcded38e8)
>> Total warnings detected in /scratch/snx3000/haplav/petsc/src/dm/impls/network/network.c: 2
>> 
>> 
>> Is it something fixable?
>> 
>> Thanks
>> 
>> Vaclav
> 



More information about the petsc-dev mailing list