Partitioning on a mpiaij matrix

Barry Smith bsmith at mcs.anl.gov
Mon Feb 12 07:42:04 CST 2007


  It is convertfrom, not convert you need to check.

  In src/mat/impls/adj/mpi/mpiadj.c MatCreate_MPIAdj
there is the line
  ierr                = PetscMemcpy(B->ops,&MatOps_Values,sizeof(struct _MatOps));CHKERRQ(ierr);
in the MatOps_Values above it there is 
/*60*/ 0,
       MatDestroy_MPIAdj,
       MatView_MPIAdj,
       MatConvertFrom_MPIAdj,
       0,

Therefor the conversion function convertfrom MUST be in the matrix ops table
when the convert is called. But it is not for you, how is this possible?


   Barry

On Mon, 12 Feb 2007, LECAS Dimitri wrote:

> 
> 
> ----- Original Message -----
> From: Barry Smith <bsmith at mcs.anl.gov>
> Date: Friday, February 9, 2007 8:09 pm
> Subject: Re: Partitioning on a mpiaij matrix
> 
> > 
> >  MatConvert() checks for a variety of converts; from the code
> > 
> >    /* 3) See if a good general converter is registered for the 
> > desired class */
> >    conv = B->ops->convertfrom;
> >    ierr = MatDestroy(B);CHKERRQ(ierr);
> >    if (conv) goto foundconv;
> > 
> > now MATMPIADJ has a MatConvertFrom that SHOULD be listed in the 
> > function table
> > so it should not fall into the default MatConvert_Basic().
> > 
> >  What version of PETSc are you using? Maybe an older one that does 
> > not have
> > this converter? If you are using 2.3.2 or petsc-dev you can put a 
> > breakpoint in MatConvert() and try to see why it is not picking up 
> > the 
> > convertfrom function? It is possible some bug that we are not aware of
> > but I have difficulty seeing what could be going wrong.
> > 
> >   Good luck,
> > 
> >   Barry
> > 
> 
> I add a line in matrix.c :
> /* 3) See if a good general converter is registered for the desired class */
> fprintf(stderr, "Breakpoint : %p %p %p\n", B, B->ops, B->ops->convert);
> if (!conv) conv = B->ops->convert;
>     ierr = MatDestroy(B);CHKERRQ(ierr);
>     if (conv) goto foundconv;
> 
> The output is :
> Breakpoint : 0x11c6670 0x11c6e30 (nil)
> [0]PETSC ERROR: --------------------- Error Message
> ----------------------------
> --------
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: Mat type mpiadj!
> [0]PETSC ERROR:
> ----------------------------------------------------------------
> --------
> [0]PETSC ERROR: Petsc Release Version 2.3.2, Patch 8, Tue Jan  2
> 14:33:59 PST 20
> 07 HG revision: ebeddcedcc065e32fc252af32cf1d01ed4fc7a80
> 
> Where is the function that can convert a mpiaij into a mpiadj matrix ?
> 
> 




More information about the petsc-users mailing list