Hi, Thank you! Yes it is 3.7 Indeed I found that there was a 'use mpi' somewhere in the tree of modules called. I could break the module apart without great difficulty, so that I don't call mpi anymore in the affected portion of the code. It looks like it indeed fixes the issue. But it's also nice to give me the other solution with PETSC_AVOID_MPIF_H, which could have been very useful if I hadn't been able to easily break the module apart.
Cheers Timothee 2017-01-31 17:21 GMT+01:00 Satish Balay <[email protected]>: > This is petsc-3.7? > > Looks like mpif.h is getting included in some module that your code > is currently using. > > Is this module your code - or petsc code? > > Is using mpi via module [perhaps mpi.mod is preferable over mpif.h] - > then you can do something like: > > #define PETSC_AVOID_MPIF_H > #include <petsc/finclude/petsc.h90> > > Satish > > On Tue, 31 Jan 2017, Timothée Nicolas wrote: > > > Dear all, > > > > I am a bit confused as to how to link PETSc correctly in a code that > > already uses MPI natively. I wish to define a DMDA for my problem, but > when > > I try to include petsc.h90, the compiler complains that MPI_XXXXX > variables > > are already defined: > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(9): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_SOURCE] > > > > INTEGER MPI_SOURCE, MPI_TAG, MPI_ERROR > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(9): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_TAG] > > > > INTEGER MPI_SOURCE, MPI_TAG, MPI_ERROR > > > > ---------------------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(9): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERROR] > > > > INTEGER MPI_SOURCE, MPI_TAG, MPI_ERROR > > > > ------------------------------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(11): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_STATUS_SIZE] > > > > INTEGER MPI_STATUS_SIZE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(13): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_STATUS_IGNORE] > > > > INTEGER MPI_STATUS_IGNORE(MPI_STATUS_SIZE) > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(14): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_STATUSES_IGNORE] > > > > INTEGER MPI_STATUSES_IGNORE(MPI_STATUS_SIZE,1) > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(15): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERRCODES_IGNORE] > > > > INTEGER MPI_ERRCODES_IGNORE(1) > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(16): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ARGVS_NULL] > > > > CHARACTER*1 MPI_ARGVS_NULL(1,1) > > > > -------------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(17): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ARGV_NULL] > > > > CHARACTER*1 MPI_ARGV_NULL(1) > > > > -------------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(18): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_SUCCESS] > > > > INTEGER MPI_SUCCESS > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(20): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_SIZE] > > > > INTEGER MPI_ERR_SIZE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(22): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_INFO_KEY] > > > > INTEGER MPI_ERR_INFO_KEY > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(24): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_FILE] > > > > INTEGER MPI_ERR_FILE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(26): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_AMODE] > > > > INTEGER MPI_ERR_AMODE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(28): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_TRUNCATE] > > > > INTEGER MPI_ERR_TRUNCATE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(30): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_BASE] > > > > INTEGER MPI_ERR_BASE > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(32): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_OP] > > > > INTEGER MPI_ERR_OP > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(34): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_ASSERT] > > > > INTEGER MPI_ERR_ASSERT > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(36): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_NAME] > > > > INTEGER MPI_ERR_NAME > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(38): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_NO_MEM] > > > > INTEGER MPI_ERR_NO_MEM > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(40): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_INFO] > > > > INTEGER MPI_ERR_INFO > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(42): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_COUNT] > > > > INTEGER MPI_ERR_COUNT > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(44): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_SPAWN] > > > > INTEGER MPI_ERR_SPAWN > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(46): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_CONVERSION] > > > > INTEGER MPI_ERR_CONVERSION > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(48): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_GROUP] > > > > INTEGER MPI_ERR_GROUP > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(50): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_RMA_SYNC] > > > > INTEGER MPI_ERR_RMA_SYNC > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(52): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_NOT_SAME] > > > > INTEGER MPI_ERR_NOT_SAME > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(54): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_KEYVAL] > > > > INTEGER MPI_ERR_KEYVAL > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(56): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_ACCESS] > > > > INTEGER MPI_ERR_ACCESS > > > > ---------------^ > > > > /cm/shared/apps/mpich/ge/intel/3.2/include/mpif.h(58): error #6401: The > > attributes of this name conflict with those made accessible by a USE > > statement. [MPI_ERR_DIMS] > > > > INTEGER MPI_ERR_DIMS > > > > ---------------^ > > > > I usually write everything consistently within PETSc, but for the first > > time, I have to use some PETSc routines in a code that is mostly standard > > FORTRAN 90. > > > > Is including PETSc via #include <petsc/finclude/petscdef.h> the wrong > > method? > > > > Best > > > > Timothee > > >
