How use scalar type and complex type at the same time?

Lisandro Dalcin dalcinl at gmail.com
Wed Aug 20 14:14:43 CDT 2008


On Wed, Aug 20, 2008 at 2:57 PM, Chetan Jhurani <chetan at ices.utexas.edu> wrote:
>
>> On Wed, Aug 20, 2008 at 7:19 AM, Zhifeng Sheng  <z.sheng at ewi.tudelft.nl> wrote:
>>
>> Is there any way that I can handle both real matrix and complex matrix at
>> the same time? (without changing my old code too much?)
>
> Not that I've tried this workaround in context of PETSc, but
> one could create two shared objects/DLLs,
>
> As to how it will be affected by MPI, I am not so sure.
>

As long as each PETSc configuration use the same MPI, and the MPI libs
are shared (so, dll, or equivalent) this should also work. But this
approach still requires the codes being "uncoupled". And then, IMHO, I
still believe that using a "chat" protocol based on MPI is more
powerful. For example, you can easily assign different number of
processors for each problem. Additionally, as long as your MPI have
decent support for dynamic process management (MPICH2 and OpenMPI do
have), the "MPI chatting" approach is simpler, more portable, and you
do not even need to have an MPI  with shared libs.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594




More information about the petsc-users mailing list