Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
- remove unused vars
- fix file copyrights
- fix indentation
- fix stale comment
  • Loading branch information
shanedsnyder committed Oct 18, 2023
1 parent b8ca13a commit 88974dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
37 changes: 18 additions & 19 deletions darshan-runtime/lib/darshan-ldms.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2016 Intel Corporation.
* See COPYRIGHT notice in top-level directory.
*
* Copyright (C) 2019 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/

#ifdef HAVE_CONFIG_H
Expand Down Expand Up @@ -60,7 +60,6 @@ static void event_cb(ldms_t x, ldms_xprt_event_t e, void *cb_arg)
ldms_t setup_connection(const char *xprt, const char *host,
const char *port, const char *auth)
{
char hostname[PATH_MAX];
const char *timeout = "5";
int rc;
struct timespec ts;
Expand Down Expand Up @@ -126,13 +125,13 @@ void darshan_ldms_connector_initialize(struct darshan_core_runtime *init_core)
dC.exename = strtok(init_core->log_exemnt_p, " ");

/* Pull executable name from proc if no arguemments are given. */
if (dC.exename == NULL)
{
if (dC.exename == NULL)
{
char buff[DARSHAN_EXE_LEN];
int len = readlink("/proc/self/exe", buff, sizeof(buff)-1);
buff[len] = '\0';
dC.exename = buff;
}
}

/* Set flags for various LDMS environment variables */
if (getenv("POSIX_ENABLE_LDMS"))
Expand Down Expand Up @@ -161,7 +160,7 @@ void darshan_ldms_connector_initialize(struct darshan_core_runtime *init_core)
dC.hdf5_enable_ldms = 1;

if (!getenv("DARSHAN_LDMS_STREAM"))
dC.env_ldms_stream = "darshanConnector";
dC.env_ldms_stream = "darshanConnector";

const char* env_ldms_xprt = getenv("DARSHAN_LDMS_XPRT");
const char* env_ldms_host = getenv("DARSHAN_LDMS_HOST");
Expand All @@ -176,16 +175,16 @@ void darshan_ldms_connector_initialize(struct darshan_core_runtime *init_core)

pthread_mutex_lock(&dC.ln_lock);
dC.ldms_darsh = setup_connection(env_ldms_xprt, env_ldms_host, env_ldms_port, env_ldms_auth);
if (dC.conn_status != 0) {
printf("Error setting up connection to LDMS streams daemon: %i -- exiting\n", dC.conn_status);
pthread_mutex_unlock(&dC.ln_lock);
return;
}
else if (dC.ldms_darsh->disconnected){
printf("Disconnected from LDMS streams daemon -- exiting\n");
pthread_mutex_unlock(&dC.ln_lock);
return;
}
if (dC.conn_status != 0) {
printf("Error setting up connection to LDMS streams daemon: %i -- exiting\n", dC.conn_status);
pthread_mutex_unlock(&dC.ln_lock);
return;
}
else if (dC.ldms_darsh->disconnected){
printf("Disconnected from LDMS streams daemon -- exiting\n");
pthread_mutex_unlock(&dC.ln_lock);
return;
}
pthread_mutex_unlock(&dC.ln_lock);
return;
}
Expand Down Expand Up @@ -232,7 +231,7 @@ void darshan_ldms_connector_send(uint64_t record_id, int64_t rank, int64_t recor
{
filepath = "N/A";
dC.exename = "N/A";
dC.schema = "N/A";
dC.schema = "N/A";
}

/* convert the start and end times to timespecs and report absolute timestamps */
Expand Down
4 changes: 0 additions & 4 deletions darshan-runtime/lib/darshan-ldms.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ typedef struct darshanConnector {
* specified module from the set environment variables (i.e. *MODULENAME*_ENABLE_LDMS)
* to LDMSD streams plugin.
*
* LDMS related function to retrieve and set the meta data of each Darshan
* run (i.e. record id, rank, etc.). These values will not be updated unless a different module
* is detected or a new run is executed.
*
*/
void darshan_ldms_connector_initialize(struct darshan_core_runtime *);

Expand Down

0 comments on commit 88974dd

Please sign in to comment.