[petsc-users] several MPIDense functions
Yujie
recrusader at gmail.com
Thu May 20 16:17:20 CDT 2010
Thank you very much for your reply, Jed.
Actually, I have checked struct_MatOps in matimpl.h file. I find
"PetscErrorCode(*)(Mat, Mat, Mat)" is for (*ptapnumeric);
PetscErrorCode(*)(Mat, PetscInt, const PetscScalar) is for (*setvaluesrow)"
Therefore, I revise the codes in MPIDense.c from
"
/*100*/0,
0,
0,
MatConjugate_MPIDense,
/*105*/0,
0,
MatRealPart_MPIDense,
MatImaginaryPart_MPIDense,
0,
"
to
"
/*100*/0,
0,
0,
0, //here add "0"
MatConjugate_MPIDense,
0, //here add "0"
/*105*/0,
0,
MatRealPart_MPIDense,
MatImaginaryPart_MPIDense,
0,
"
It works! However, when I compare the codes in seqdense.c and mpidense.c.
They are different. For successful compilation
In seqdense.c
"
/*100*/0,
0,
0,
MatConjugate_SeqDense,
MatSetSizes_SeqDense,
/*104*/0,
MatRealPart_SeqDense,
MatImaginaryPart_SeqDense,
0,
0,
"
In mpidense.c
"
/*100*/0,
0,
0,
0,
MatConjugate_MPIDense, //by Yujie, 05/19/10 UT
0,
/*105*/0,
0,
MatRealPart_MPIDense, //by Yujie, 05/19/10 UT
MatImaginaryPart_MPIDense,
0,
"
At least, there are "0" and "MatSetSizes" between MatConjugate and
MatRealPart in seqdense.c;
there are three "0" between MatConjugate and MatRealPart (why not be
two "0") in mpidense.c?
Thanks a lot.
Regards,
Yujie
On Thu, May 20, 2010 at 3:58 PM, Jed Brown <jed at 59a2.org> wrote:
> On Thu, 20 May 2010 15:32:06 -0500, Yujie <recrusader at gmail.com> wrote:
>> Dear PETSc developers,
>>
>> Currently, I am using PETSc-3.0.0-p8 version for my application. There
>> are not MatCojugate, MatRealPart, MatImaginaryPart for SEQ and
>> MPIDense.
>>
>> Since some revisions in 3.1 version result in large changes in my
>> codes, I don't want to update PETSc to 3.1 version currently.
>
> This is almost certainly an indexing error, I suggest looking carefully
> at the definition in struct _MatOps. Your error message has that line
> number because that is the end of the initializer and GCC's parser
> doesn't retain the information required to easily produce a better
> message. Clang is better in this case, you should see something like:
>
> mpidense.c:1580:8: warning: incompatible pointer types initializing 'PetscErrorCode (Mat)', expected 'PetscErrorCode (*)(Mat, Mat, PetscReal, Mat *)'
> [-pedantic]
> MatConjugate_MPIDense,
> ^~~~~~~~~~~~~~~~~~~~~
> 1 diagnostic generated.
>
>
> Jed
>
More information about the petsc-users
mailing list