[petsc-users] Calling MATLAB code within a parallel C/C++ code

Satish Balay balay at mcs.anl.gov
Mon Jun 8 20:39:00 CDT 2020


there is src/tao/leastsquares/tutorials/matlab/matlab_ls_test.c

also, src/vec/vec/tests/ex31.c has matlab calls - but isn't getting tested - so likely broken.

Satish

On Mon, 8 Jun 2020, Amneet Bhalla wrote:

> Great!
> 
> Clicking on some of the functions pointed me to this example
> https://www.mcs.anl.gov/petsc/petsc-3.13/src/snes/tutorials/ex5.c.html
> 
> Are there more examples, which are perhaps simpler than the above, which I
> can refer to?
> 
> On Mon, Jun 8, 2020 at 5:51 PM Barry Smith <bsmith at petsc.dev> wrote:
> 
> >
> >   You should use the PetscMatlabEngine
> > https://www.mcs.anl.gov/petsc/petsc-3.13/docs/manualpages/Sys/PetscMatlabEngine.html
> >
> >   Barry
> >
> >
> > On Jun 8, 2020, at 7:09 PM, Amneet Bhalla <mail2amneet at gmail.com> wrote:
> >
> > Hi Folks,
> >
> > My parallel application written in C++ (which also uses PETSc library for
> > linear solvers) requires calling control and optimization toolbox of MATLAB
> > at every time step to get a small number of double values. Likewise the
> > MATLAB function will need to know some values from the parallel C++
> > application to return those doubles. I'm wondering if there is a
> > recommended way of calling MATLAB from parallel C/C++/Fortran codes, and if
> > PETSc has some interface that could be leveraged for this exchange.
> >
> > Thanks,
> > --
> > --Amneet
> >
> >
> >
> >
> >
> 
> 



More information about the petsc-users mailing list