<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello Filippo,<br>
we had to write a wrapper around Petsc to use both double and
double complex functions in the same code.<br>
We achieved it by creating two shared object libraries and hiding
Petsc symbols.<br>
Once we had to achieve it for a statically linked executable, this
was really painful, we had to change symbols in the object files.
<br>
<br>
If your wrapper can make this process easier, it would be great.<br>
I'm not interested in developing as such, but I'm interested in
the product and in a good performance.<br>
Michael.<br>
<br>
On 4/2/2017 3:15 PM, Filippo Leonardi wrote:<br>
</div>
<blockquote
cite="mid:CAE6aJUBoQmJonAO-gZHUJf97m1v=vuM1n_uKmyQuQVF_yXcNFQ@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr"><br>
<div>Hello,</div>
<div><br>
</div>
<div>I have a project in mind and seek feedback.</div>
<div><br>
</div>
<div>Disclaimer: I hope I am not abusing of this mailing list
with this idea. If so, please ignore.</div>
<div><br>
</div>
<div>As a thought experiment, and to have a bit of fun, I am
currently writing/thinking on writing, a small (modern) C++
wrapper around PETSc.</div>
<div><br>
</div>
<div><span style="line-height:15.6px">Premise: PETSc is awesome,
I love it and use in many projects. Sometimes I am just not
super comfortable writing C. (I know my idea goes against
PETSc's design philosophy).</span><br>
</div>
<div><br>
</div>
<div>I know there are many around, and there is not really a
need for this (especially since PETSc has his own
object-oriented style), but there are a few things I would
like to <span style="line-height:1.5">really include in this
wrapper, that I found nowhere):</span></div>
<div><span style="line-height:1.5">- I am currently only
thinking about the Vector/Matrix/KSP/DM part of the
Framework, there are many </span><span
style="line-height:1.5">other cool things that PETSc does
that I do not have the brainpower to consider those as well.</span></div>
<div>- expression templates (in my opinion this is where C++
shines): this would replace all code bloat that a user might
need with cool/easy to read expressions (this could increase
the number of axpy-like routines);</div>
<div>- those expression templates should use SSE and AVX
whenever available;</div>
<div>- expressions like x += alpha * y should fall back to BLAS
axpy (tough sometimes this is not even faster than a simple
loop);</div>
<div>- all calls to PETSc should be less verbose, more C++-like:</div>
<div> * for instance a VecGlobalToLocalBegin could return an
empty object that calls VecGlobalToLocalEnd <span
style="line-height:1.5">when it is destroyed.</span></div>
<div> * some cool idea to easily write GPU kernels.</div>
<div>- the idea would be to have safer routines<span
class="inbox-inbox-Apple-converted-space"
style="line-height:15.6px"> </span><span
style="line-height:15.6px">(at compile time)</span><span
style="line-height:1.5">, by means of RAII etc.</span></div>
<div><br>
</div>
<div>I aim for zero/near-zero/negligible overhead with full
optimization, for that I include benchmarks and extensive test
units.</div>
<div><br>
</div>
<div>So my question is:</div>
<div>- anyone that would be interested (in the product/in
developing)?</div>
<div>- anyone that has suggestions (maybe that what I have in
mind is nonsense)?</div>
<div><br>
</div>
<div>If you have read up to here, thanks.</div>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>