<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>
Shane Snyder pushed to branch dev-modular
at <a href="https://xgitlab.cels.anl.gov/darshan/darshan">darshan / darshan</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/75bd30201d6b1cb374508fc4ccd7c87ce1a757e5">75bd3020</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2016-02-04T17:57:12-06:00</i>
</div>
<pre class='commit-message'>small reorg of darshan init code
this reorganization prevents darshan from being "enabled"
(i.e., accessible to modules) until the initialization
has completely finished.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-runtime/lib/darshan-core.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/75bd30201d6b1cb374508fc4ccd7c87ce1a757e5#diff-0'>
<strong>
darshan-runtime/lib/darshan-core.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-core.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-core.c
</span><span style="color: #aaaaaa">@@ -119,6 +119,7 @@ static void darshan_core_cleanup(
</span>
void darshan_core_initialize(int argc, char **argv)
{
<span style="color: #000000;background-color: #ddffdd">+ struct darshan_core_runtime *init_core = NULL;
</span> int i;
int internal_timing_flag = 0;
double init_start, init_time, init_max;
<span style="color: #aaaaaa">@@ -166,25 +167,25 @@ void darshan_core_initialize(int argc, char **argv)
</span> }
/* allocate structure to track darshan_core_runtime information */
<span style="color: #000000;background-color: #ffdddd">- darshan_core = malloc(sizeof(*darshan_core));
- if(darshan_core)
</span><span style="color: #000000;background-color: #ddffdd">+ init_core = malloc(sizeof(*init_core));
+ if(init_core)
</span> {
<span style="color: #000000;background-color: #ffdddd">- memset(darshan_core, 0, sizeof(*darshan_core));
</span><span style="color: #000000;background-color: #ddffdd">+ memset(init_core, 0, sizeof(*init_core));
</span>
<span style="color: #000000;background-color: #ffdddd">- darshan_core->log_job.uid = getuid();
- darshan_core->log_job.start_time = time(NULL);
- darshan_core->log_job.nprocs = nprocs;
- darshan_core->wtime_offset = DARSHAN_MPI_CALL(PMPI_Wtime)();
</span><span style="color: #000000;background-color: #ddffdd">+ init_core->log_job.uid = getuid();
+ init_core->log_job.start_time = time(NULL);
+ init_core->log_job.nprocs = nprocs;
+ init_core->wtime_offset = DARSHAN_MPI_CALL(PMPI_Wtime)();
</span>
/* record exe and arguments */
for(i=0; i<argc; i++)
{
<span style="color: #000000;background-color: #ffdddd">- chars_left = DARSHAN_EXE_LEN-strlen(darshan_core->exe);
- strncat(darshan_core->exe, argv[i], chars_left);
</span><span style="color: #000000;background-color: #ddffdd">+ chars_left = DARSHAN_EXE_LEN-strlen(init_core->exe);
+ strncat(init_core->exe, argv[i], chars_left);
</span> if(i < (argc-1))
{
<span style="color: #000000;background-color: #ffdddd">- chars_left = DARSHAN_EXE_LEN-strlen(darshan_core->exe);
- strncat(darshan_core->exe, " ", chars_left);
</span><span style="color: #000000;background-color: #ddffdd">+ chars_left = DARSHAN_EXE_LEN-strlen(init_core->exe);
+ strncat(init_core->exe, " ", chars_left);
</span> }
}
<span style="color: #aaaaaa">@@ -193,22 +194,22 @@ void darshan_core_initialize(int argc, char **argv)
</span> */
if(argc == 0)
{
<span style="color: #000000;background-color: #ffdddd">- chars_left = DARSHAN_EXE_LEN-strlen(darshan_core->exe);
- strncat(darshan_core->exe, __progname_full, chars_left);
- chars_left = DARSHAN_EXE_LEN-strlen(darshan_core->exe);
- strncat(darshan_core->exe, " <unknown args>", chars_left);
</span><span style="color: #000000;background-color: #ddffdd">+ chars_left = DARSHAN_EXE_LEN-strlen(init_core->exe);
+ strncat(init_core->exe, __progname_full, chars_left);
+ chars_left = DARSHAN_EXE_LEN-strlen(init_core->exe);
+ strncat(init_core->exe, " <unknown args>", chars_left);
</span> }
if(chars_left == 0)
{
/* we ran out of room; mark that string was truncated */
truncate_offset = DARSHAN_EXE_LEN - strlen(truncate_string);
<span style="color: #000000;background-color: #ffdddd">- sprintf(&darshan_core->exe[truncate_offset], "%s",
</span><span style="color: #000000;background-color: #ddffdd">+ sprintf(&init_core->exe[truncate_offset], "%s",
</span> truncate_string);
}
/* collect information about command line and mounted file systems */
<span style="color: #000000;background-color: #ffdddd">- darshan_core->trailing_data = darshan_get_exe_and_mounts(darshan_core);
</span><span style="color: #000000;background-color: #ddffdd">+ init_core->trailing_data = darshan_get_exe_and_mounts(init_core);
</span>
/* bootstrap any modules with static initialization routines */
i = 0;
<span style="color: #aaaaaa">@@ -232,6 +233,10 @@ void darshan_core_initialize(int argc, char **argv)
</span> }
}
<span style="color: #000000;background-color: #ddffdd">+ /* if darshan was successfully initialized, set the global pointer */
+ if(init_core)
+ darshan_core = init_core;
+
</span> return;
}
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/75bd30201d6b1cb374508fc4ccd7c87ce1a757e5">View it on GitLab</a>.
<br>
You're receiving this email because of your account on xgitlab.cels.anl.gov.
If you'd like to receive fewer emails, you can
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://xgitlab.cels.anl.gov/darshan/darshan/commit/75bd30201d6b1cb374508fc4ccd7c87ce1a757e5"}}</script>
</p>
</div>
</body>
</html>