Skip to content

Commit

Permalink
Merge pull request flux-framework#1457 from garlick/hwloc_lite
Browse files Browse the repository at this point in the history
Colllection of small fixes for splash project (part 2)
  • Loading branch information
grondo authored Apr 13, 2018
2 parents c2502c4 + 5650070 commit 0ebaf83
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
7 changes: 5 additions & 2 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,8 +1477,11 @@ static int handle_event (broker_ctx_t *ctx, const flux_msg_t *msg)
}
ctx->event_recv_seq = seq;

(void)overlay_mcast_child (ctx->overlay, msg);
(void)overlay_sendmsg_relay (ctx->overlay, msg);
if (overlay_mcast_child (ctx->overlay, msg) < 0)
flux_log_error (ctx->h, "%s: overlay_mcast_child", __FUNCTION__);
if (overlay_sendmsg_relay (ctx->overlay, msg) < 0)
flux_log_error (ctx->h, "%s: overlay_sendmsg_relay", __FUNCTION__);


/* Internal services may install message handlers for events.
*/
Expand Down
12 changes: 3 additions & 9 deletions src/broker/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,9 @@ const char *overlay_get_relay (overlay_t *ov)

int overlay_sendmsg_relay (overlay_t *ov, const flux_msg_t *msg)
{
int rc = -1;

if (!ov->relay || !ov->relay->zs) {
errno = EINVAL;
goto done;
}
rc = flux_msg_sendzsock (ov->relay->zs, msg);
done:
return rc;
if (!ov->relay)
return 0;
return flux_msg_sendzsock (ov->relay->zs, msg);
}

static void child_cb (flux_reactor_t *r, flux_watcher_t *w,
Expand Down
23 changes: 23 additions & 0 deletions src/common/libjsc/jstatctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,29 @@ static int query_rdesc (flux_t *h, int64_t j, json_object **jcb)
return 0;
}

int jsc_query_rdesc_efficiently (flux_t *h, int64_t jobid,
int64_t *nnodes, int64_t *ntasks,
int64_t *ncores, int64_t *walltime)
{
if (nnodes) {
if (extract_raw_nnodes (h, jobid, nnodes) < 0)
return -1;
}
if (ntasks) {
if (extract_raw_ntasks (h, jobid, ntasks) < 0)
return -1;
}
if (ncores) {
if (extract_raw_ncores (h, jobid, ncores) < 0)
return -1;
}
if (walltime) {
if (extract_raw_walltime (h, jobid, walltime) < 0)
return -1;
}
return 0;
}

static int query_rdl (flux_t *h, int64_t j, json_object **jcb)
{
char *rdlstr = NULL;
Expand Down
9 changes: 9 additions & 0 deletions src/common/libjsc/jstatctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ int jsc_update_jcb (flux_t *h, int64_t jobid, const char *key, const char *jcb);
const char *jsc_job_num2state (job_state_t s);
int jsc_job_state2num (const char *s);

/**
* Accessor for nnodes, ntasks, ncores, walltime that circumvents
* JSON encode/decode. N.B. this is a workaround for performance issu
* encountered when scheduling high throughput workloads.
*/
int jsc_query_rdesc_efficiently (flux_t *h, int64_t jobid,
int64_t *nnodes, int64_t *ntasks,
int64_t *ncores, int64_t *walltime);

#ifdef __cplusplus
}
#endif
Expand Down
10 changes: 4 additions & 6 deletions src/modules/resource-hwloc/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ static int ctx_hwloc_init (flux_t *h, resource_ctx_t *ctx)
flux_log_error (h, "flux_topology_init");
goto done;
}
if (hwloc_topology_set_flags (ctx->topology,
HWLOC_TOPOLOGY_FLAG_WHOLE_IO) < 0) {
flux_log_error (h, "hwloc_topology_set_flags");
goto done;
}

if (hwloc_topology_ignore_type (ctx->topology, HWLOC_OBJ_CACHE) < 0)
flux_log (h, LOG_ERR, "hwloc_topology_ignore_type OBJ_CACHE failed");
if (hwloc_topology_ignore_type (ctx->topology, HWLOC_OBJ_GROUP) < 0)
flux_log (h, LOG_ERR, "hwloc_topology_ignore_type OBJ_GROUP failed");
key = xasprintf ("config.resource.hwloc.xml.%" PRIu32, ctx->rank);
if (!(f = flux_kvs_lookup (h, 0, key))) {
flux_log_error (h, "flux_kvs_lookup");
Expand Down

0 comments on commit 0ebaf83

Please sign in to comment.