<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">There are some different options that
require different levels of development effort. A really clean
solution would require modification to Darshan to implement an
optional mode that doesn't make any MPI calls. You might not have
to use a constructor. Each wrapper could just do an
initialization check and call the init function if needed.
atexit() could probably be used to register the finalize function.<br>
<br>
For a shorter term solution that avoids modifying internal Darshan
code, you would need to pull in a full MPI library and initialize
and finalize it so that the existing Darshan code doesn't complain
about lack of MPI functionality. Even if you used a dummy/stub
MPI implementation in place of a real MPI library, it would still
at a minimum will need to correctly handle MPI_File_write_at_* and
a subset of derived MPI datatypes to write log files correctly the
way that Darshan is doing it now. You couldn't just return 0 for
all MPI functions.<br>
<br>
I don't think there is any show stopper technical limitation
preventing Darshan from being used like this (and I think it would
definitely be valuable functionality), but there is some work
required either way.<br>
<br>
-Phil<br>
<br>
On 06/05/2013 03:05 PM, Kevin Harms wrote:<br>
</div>
<blockquote
cite="mid:44024ADB-83B7-43DB-8A67-D587C7644BAF@alcf.anl.gov"
type="cite">
<pre wrap="">
I'd like to start with, I'm not saying this is a good idea, just an idea. You could build a shim which wraps main and is listed in the LD_PRELOAD variable along with darshan. The main wrapper would call the PMPI_Init and then call the real main. You could either call PMPI_Finalize after the real main returns or try using atexit() to register a helper function that calls PMPI_Finalize() to catch cases where applications exit at places other than main. (Or maybe register PMPI_Finalize directly?) I'm also making the assumption you can intercept main which I don't know if that is true. Then in the LD_PRELOAD you list your library, darshan and maybe MPI? although i think the dynamic loader should load MPI when darshan.so is loaded without naming it explicitly.
something to try anyway.
kevin
On Jun 5, 2013, at 1:22 AM, Michael Kluge <a class="moz-txt-link-rfc2396E" href="mailto:michael.kluge@tu-dresden.de"><michael.kluge@tu-dresden.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Julian,
the problem is that I'm looking for a tool that works with all dynamic binaries, even those, where I don't have the source and that are not using MPI. There is no hope with darshan for this type of binaries?
Regards, Michael
On 05.06.2013 00:24, Julian Kunkel wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi
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.
This way you only have to recompile POSIX apps wrapping against you
"darshaning" main method.
Regards
Julian
-- send with android. Sorry for typos.
Am 04.06.2013 19:03 schrieb "Michael Kluge" <<a class="moz-txt-link-abbreviated" href="mailto:michael.kluge@tu-dresden.de">michael.kluge@tu-dresden.de</a>
<a class="moz-txt-link-rfc2396E" href="mailto:michael.kluge@tu-dresden.de"><mailto:michael.kluge@tu-dresden.de></a>>:
Hi Kevin,
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 ...
Regards, Michael
Am 04.06.2013 18 <tel:04.06.2013%2018>:49, schrieb Kevin Harms:
Michael,
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().
Using:
void __attribute__ ((constructor)) PMPI_Init()
i think would work to initialize darshan, but you still need
to call PMPI_Finalize at some point to get the log.
kevin
On Jun 4, 2013, at 8:37 AM, Michael Kluge
<<a class="moz-txt-link-abbreviated" href="mailto:michael.kluge@tu-dresden.de">michael.kluge@tu-dresden.de</a>
<a class="moz-txt-link-rfc2396E" href="mailto:michael.kluge@tu-dresden.de"><mailto:michael.kluge@tu-dresden.de></a>> wrote:
Dear list,
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?
Is there any chance that an approach that uses
void __attribute__ ((constructor)) my_lib_init()
(see:
<a class="moz-txt-link-freetext" href="http://gcc.gnu.org/onlinedocs/__gcc/Function-Attributes.html">http://gcc.gnu.org/onlinedocs/__gcc/Function-Attributes.html</a>
<a class="moz-txt-link-rfc2396E" href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html"><http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html></a>)
from gcc would work as well for pure POSIX programs?
Regards, Michael
--
Dr.-Ing. Michael Kluge
Technische Universität Dresden
Center for Information Services and
High Performance Computing (ZIH)
D-01062 Dresden
Germany
Contact:
Willersbau, Room WIL A 208
Phone: (+49) 351 463-34217 <tel:%28%2B49%29%20351%20463-34217>
Fax: (+49) 351 463-37773 <tel:%28%2B49%29%20351%20463-37773>
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:michael.kluge@tu-dresden.de">michael.kluge@tu-dresden.de</a>
<a class="moz-txt-link-rfc2396E" href="mailto:michael.kluge@tu-dresden.de"><mailto:michael.kluge@tu-dresden.de></a>
WWW: <a class="moz-txt-link-freetext" href="http://www.tu-dresden.de/zih">http://www.tu-dresden.de/zih</a>
_________________________________________________
Darshan-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Darshan-users@lists.mcs.anl.__gov">Darshan-users@lists.mcs.anl.__gov</a>
<a class="moz-txt-link-rfc2396E" href="mailto:Darshan-users@lists.mcs.anl.gov"><mailto:Darshan-users@lists.mcs.anl.gov></a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/__mailman/listinfo/darshan-users">https://lists.mcs.anl.gov/__mailman/listinfo/darshan-users</a>
<a class="moz-txt-link-rfc2396E" href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users"><https://lists.mcs.anl.gov/mailman/listinfo/darshan-users></a>
_________________________________________________
Darshan-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Darshan-users@lists.mcs.anl.__gov">Darshan-users@lists.mcs.anl.__gov</a>
<a class="moz-txt-link-rfc2396E" href="mailto:Darshan-users@lists.mcs.anl.gov"><mailto:Darshan-users@lists.mcs.anl.gov></a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/__mailman/listinfo/darshan-users">https://lists.mcs.anl.gov/__mailman/listinfo/darshan-users</a>
<a class="moz-txt-link-rfc2396E" href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users"><https://lists.mcs.anl.gov/mailman/listinfo/darshan-users></a>
</pre>
</blockquote>
<pre wrap="">
--
Dr.-Ing. Michael Kluge
Technische Universität Dresden
Center for Information Services and
High Performance Computing (ZIH)
D-01062 Dresden
Germany
Contact:
Willersbau, Room A 208
Phone: (+49) 351 463-34217
Fax: (+49) 351 463-37773
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:michael.kluge@tu-dresden.de">michael.kluge@tu-dresden.de</a>
WWW: <a class="moz-txt-link-freetext" href="http://www.tu-dresden.de/zih">http://www.tu-dresden.de/zih</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Darshan-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Darshan-users@lists.mcs.anl.gov">Darshan-users@lists.mcs.anl.gov</a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users">https://lists.mcs.anl.gov/mailman/listinfo/darshan-users</a>
</pre>
</blockquote>
<br>
</body>
</html>