<p dir="ltr">Hi<br>
With ld's wrap option I think you can provide a main() replacement which calls (p)mpi_init() then the real main and (p)mpi_finalize() afterwards. </p>
<p dir="ltr">This way you only have to recompile POSIX apps wrapping against you "darshaning" main method.</p>
<p dir="ltr">Regards<br>
Julian</p>
<p dir="ltr">-- send with android. Sorry for typos.</p>
<div class="gmail_quote">Am 04.06.2013 19:03 schrieb "Michael Kluge" <<a href="mailto:michael.kluge@tu-dresden.de">michael.kluge@tu-dresden.de</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Kevin,<br>
<br>
if I really want to use darshan for POSIX programs on single hosts, then it should be fairly easy to emulate the semantics of the MPI calls through a couple of pthread calls. It might even be possible to replace the few MPI funktions used in darshan with a generic abstraction layer and create an MPI and POSIX-only implementation of that layer. Just thinking ...<br>

<br>
<br>
Regards, Michael<br>
<br>
Am <a href="tel:04.06.2013%2018" value="+49406201318" target="_blank">04.06.2013 18</a>:49, schrieb Kevin Harms:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Michael,<br>
<br>
   Darshan itself needs MPI. It uses some collective calls and file routines when generating the log. The log is written when MPI_Finalize is called. If you're going to modify your POSIX program, then it seems easier to just instrument your main() with MPI_Init() and MPI_Finalize().<br>

<br>
   Using:<br>
<br>
void __attribute__ ((constructor)) PMPI_Init()<br>
<br>
   i think would work to initialize darshan, but you still need to call PMPI_Finalize at some point to get the log.<br>
<br>
kevin<br>
<br>
On Jun 4, 2013, at 8:37 AM, Michael Kluge <<a href="mailto:michael.kluge@tu-dresden.de" target="_blank">michael.kluge@tu-dresden.de</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear list,<br>
<br>
if I understand all the documentation well, darshan collects profiles of MPI programs only because it will initialize itself from a wrapper to MPI_Init(). Is this the only case, why pure POSIX programs (maybe multithreaded) would not work together with darshan?<br>

<br>
Is there any chance that an approach that uses<br>
<br>
void __attribute__ ((constructor)) my_lib_init()<br>
(see: <a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html" target="_blank">http://gcc.gnu.org/onlinedocs/<u></u>gcc/Function-Attributes.html</a>)<br>
<br>
from gcc would work as well for pure POSIX programs?<br>
<br>
<br>
Regards, Michael<br>
<br>
--<br>
Dr.-Ing. Michael Kluge<br>
<br>
Technische Universität Dresden<br>
Center for Information Services and<br>
High Performance Computing (ZIH)<br>
D-01062 Dresden<br>
Germany<br>
<br>
Contact:<br>
Willersbau, Room WIL A 208<br>
Phone:  <a href="tel:%28%2B49%29%20351%20463-34217" value="+4935146334217" target="_blank">(+49) 351 463-34217</a><br>
Fax:    <a href="tel:%28%2B49%29%20351%20463-37773" value="+4935146337773" target="_blank">(+49) 351 463-37773</a><br>
e-mail: <a href="mailto:michael.kluge@tu-dresden.de" target="_blank">michael.kluge@tu-dresden.de</a><br>
WWW:    <a href="http://www.tu-dresden.de/zih" target="_blank">http://www.tu-dresden.de/zih</a><br>
<br>
______________________________<u></u>_________________<br>
Darshan-users mailing list<br>
<a href="mailto:Darshan-users@lists.mcs.anl.gov" target="_blank">Darshan-users@lists.mcs.anl.<u></u>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/listinfo/darshan-users</a><br>
</blockquote>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Darshan-users mailing list<br>
<a href="mailto:Darshan-users@lists.mcs.anl.gov" target="_blank">Darshan-users@lists.mcs.anl.<u></u>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/listinfo/darshan-users</a><br>
</blockquote></div>