Skip to content

Commit

Permalink
Globally include "czmq_containers.h"
Browse files Browse the repository at this point in the history
Problem: To avoid bugs in most OS distro's versions of czmq,
we want internal flux callers to use the internal "fzhashx" library
instead of the czmq "zhashx" library whenever a "zhashx" is used.

Solution: Include the file "czmq_containers.h" whereever zhashx data
structures are used.  Update Makefile.am files to add
libczmqcontainers.la when appropriate.

Fixes #3591
  • Loading branch information
chu11 committed Apr 16, 2021
1 parent a5cd32a commit 6771b05
Show file tree
Hide file tree
Showing 53 changed files with 80 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/broker/content-cache.c
Expand Up @@ -20,6 +20,7 @@
#include "src/common/libutil/blobref.h"
#include "src/common/libutil/iterators.h"
#include "src/common/libutil/log.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "attr.h"
#include "content-cache.h"
Expand Down
1 change: 1 addition & 0 deletions src/broker/runat.c
Expand Up @@ -28,6 +28,7 @@

#include "src/common/libutil/log.h"
#include "src/common/libutil/monotime.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "runat.h"

Expand Down
5 changes: 4 additions & 1 deletion src/cmd/Makefile.am
Expand Up @@ -90,11 +90,13 @@ fluxcmd_PROGRAMS = \

flux_start_LDADD = \
$(fluxcmd_ldadd) \
$(top_builddir)/src/common/libpmi/libpmi_server.la
$(top_builddir)/src/common/libpmi/libpmi_server.la \
$(top_builddir)/src/common/libczmqcontainers/libczmqcontainers.la

flux_job_LDADD = \
$(fluxcmd_ldadd) \
$(top_builddir)/src/shell/libmpir.la \
$(top_builddir)/src/common/libczmqcontainers/libczmqcontainers.la \
$(top_builddir)/src/common/libdebugged/libdebugged.la \
$(top_builddir)/src/common/libterminus/libterminus.la

Expand All @@ -108,6 +110,7 @@ flux_terminus_LDADD = \
flux_R_LDADD = \
$(fluxcmd_ldadd) \
$(top_builddir)/src/common/librlist/librlist.la \
$(top_builddir)/src/common/libczmqcontainers/libczmqcontainers.la \
$(top_builddir)/src/common/libhostlist/libhostlist.la \
$(top_builddir)/src/common/libidset/libidset.la \
$(top_builddir)/src/common/libutil/libutil.la \
Expand Down
1 change: 1 addition & 0 deletions src/cmd/flux-exec.c
Expand Up @@ -24,6 +24,7 @@
#include "src/common/libutil/monotime.h"
#include "src/common/libidset/idset.h"
#include "src/common/libutil/log.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

static struct optparse_option cmdopts[] = {
{ .name = "rank", .key = 'r', .has_arg = 1, .arginfo = "IDSET",
Expand Down
1 change: 1 addition & 0 deletions src/common/libflux/Makefile.am
Expand Up @@ -169,6 +169,7 @@ test_ldadd = \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libtomlc99/libtomlc99.la \
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/libczmqcontainers/libczmqcontainers.la \
$(ZMQ_LIBS) \
$(LIBUUID_LIBS) \
$(JANSSON_LIBS) \
Expand Down
2 changes: 2 additions & 0 deletions src/common/libflux/attr.c
Expand Up @@ -16,6 +16,8 @@
#include <czmq.h>
#include <jansson.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "attr.h"
#include "rpc.h"

Expand Down
1 change: 1 addition & 0 deletions src/common/libflux/msg_handler.c
Expand Up @@ -25,6 +25,7 @@

#include "src/common/libutil/log.h"
#include "src/common/libutil/iterators.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

struct dispatch {
flux_t *h;
Expand Down
2 changes: 2 additions & 0 deletions src/common/libjob/job_hash.c
Expand Up @@ -14,6 +14,8 @@
#include <flux/core.h>
#include <czmq.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job_hash.h"

/* Hash numerical jobid in 'key'.
Expand Down
2 changes: 2 additions & 0 deletions src/common/libjob/job_hash.h
Expand Up @@ -14,6 +14,8 @@
#include <flux/core.h>
#include <czmq.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

/* Create a zhashx_t with hasher and comparator set to use flux_jobid_t
* as the hash key. The default key duplicator and destructor are disabled
* on the presumption that the id is a member of the job object.
Expand Down
1 change: 1 addition & 0 deletions src/common/libpmi/Makefile.am
Expand Up @@ -57,6 +57,7 @@ test_ldadd = \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libtomlc99/libtomlc99.la \
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/libczmqcontainers/libczmqcontainers.la \
$(ZMQ_LIBS) \
$(LIBUUID_LIBS) \
$(JANSSON_LIBS) \
Expand Down
2 changes: 2 additions & 0 deletions src/common/libpmi/simple_server.c
Expand Up @@ -73,6 +73,8 @@
#include <sys/param.h>
#include <czmq.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "simple_server.h"
#include "keyval.h"
#include "pmi.h"
Expand Down
2 changes: 2 additions & 0 deletions src/common/librlist/rlist.c
Expand Up @@ -22,6 +22,8 @@

#include "src/common/libidset/idset.h"
#include "src/common/libhostlist/hostlist.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "rnode.h"
#include "rlist.h"
#include "rhwloc.h"
Expand Down
2 changes: 2 additions & 0 deletions src/common/librlist/rnode.c
Expand Up @@ -20,6 +20,8 @@
#include <jansson.h>
#include <flux/idset.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "rnode.h"

static int idset_subtract (struct idset *from, struct idset *ids)
Expand Down
1 change: 1 addition & 0 deletions src/common/librouter/disconnect.c
Expand Up @@ -34,6 +34,7 @@
#include <czmq.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "disconnect.h"

Expand Down
1 change: 1 addition & 0 deletions src/common/librouter/router.c
Expand Up @@ -16,6 +16,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "router.h"
#include "subhash.h"
Expand Down
1 change: 1 addition & 0 deletions src/common/librouter/servhash.c
Expand Up @@ -37,6 +37,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "servhash.h"

Expand Down
1 change: 1 addition & 0 deletions src/common/librouter/subhash.c
Expand Up @@ -40,6 +40,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "subhash.h"

Expand Down
2 changes: 2 additions & 0 deletions src/common/libutil/iterators.h
Expand Up @@ -11,6 +11,8 @@
#ifndef FLUX_ITERATORS_H
#define FLUX_ITERATORS_H

#include "src/common/libczmqcontainers/czmq_containers.h"

#define FOREACH_ZLIST(LIST, VAR) \
for((VAR) = zlist_first(LIST); \
VAR; \
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-exec/job-exec.c
Expand Up @@ -95,6 +95,8 @@
#include "src/common/libeventlog/eventlogger.h"
#include "src/common/libutil/fsd.h"
#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job-exec.h"

static double kill_timeout=5.0;
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-ingest/job-ingest.c
Expand Up @@ -24,6 +24,7 @@
#include "src/common/libjob/sign_none.h"
#include "src/common/libjob/job_hash.h"
#include "src/common/libeventlog/eventlog.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "validate.h"

Expand Down
1 change: 1 addition & 0 deletions src/modules/job-list/idsync.c
Expand Up @@ -19,6 +19,7 @@

#include "src/common/libutil/errno_safe.h"
#include "src/common/libjob/job_hash.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "idsync.h"
#include "job_state.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-list/job-list.c
Expand Up @@ -14,6 +14,8 @@
#include <czmq.h>
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job-list.h"
#include "job_state.h"
#include "list.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-list/job-list.h
Expand Up @@ -14,6 +14,8 @@
#include <flux/core.h>
#include <czmq.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job_state.h"

struct list_ctx {
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-list/job_state.c
Expand Up @@ -24,6 +24,7 @@
#include "src/common/libjob/job_hash.h"
#include "src/common/librlist/rlist.h"
#include "src/common/libidset/idset.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job_state.h"
#include "idsync.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-list/job_state.h
Expand Up @@ -17,6 +17,7 @@
#include "job-list.h"
#include "stats.h"
#include "src/common/libutil/grudgeset.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

/* To handle the common case of user queries on job state, we will
* store jobs in three different lists.
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-list/list.c
Expand Up @@ -18,6 +18,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "idsync.h"
#include "list.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/alloc.c
Expand Up @@ -25,6 +25,8 @@
#include <flux/schedutil.h>
#include <assert.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "alloc.h"
#include "event.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/annotate.c
Expand Up @@ -26,6 +26,8 @@
#include <ctype.h>
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"
#include "annotate.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/drain.c
Expand Up @@ -19,6 +19,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "drain.h"
#include "submit.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/event.c
Expand Up @@ -51,6 +51,7 @@
#include "event.h"

#include "src/common/libeventlog/eventlog.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

const double batch_timeout = 0.01;

Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/getattr.c
Expand Up @@ -26,6 +26,7 @@
#include <flux/core.h>

#include "src/common/libutil/errno_safe.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "job-manager.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/job-manager.c
Expand Up @@ -14,6 +14,7 @@
#include <flux/core.h>

#include "src/common/libjob/job_hash.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "submit.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/job-manager.h
Expand Up @@ -11,6 +11,8 @@
#ifndef _FLUX_JOB_MANAGER_H
#define _FLUX_JOB_MANAGER_H

#include "src/common/libczmqcontainers/czmq_containers.h"

struct job_manager {
flux_t *h;
flux_msg_handler_t **handlers;
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/jobtap.c
Expand Up @@ -24,6 +24,8 @@

#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "annotate.h"
#include "prioritize.h"
#include "event.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/kill.c
Expand Up @@ -30,6 +30,8 @@
#include <signal.h>
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"
#include "kill.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/list.c
Expand Up @@ -27,6 +27,7 @@
#include <flux/core.h>

#include "src/common/libjob/job.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "list.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/prioritize.c
Expand Up @@ -17,6 +17,8 @@
#endif
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"
#include "alloc.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/raise.c
Expand Up @@ -31,6 +31,8 @@
#include <ctype.h>
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"
#include "raise.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/restart.c
Expand Up @@ -19,6 +19,7 @@
#include <flux/core.h>

#include "src/common/libutil/fluid.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "restart.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/start.c
Expand Up @@ -85,6 +85,8 @@
#include <flux/core.h>
#include <assert.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"

Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/submit.c
Expand Up @@ -27,6 +27,7 @@
#include "submit.h"

#include "src/common/libeventlog/eventlog.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

struct submit {
struct job_manager *ctx;
Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/submit.h
Expand Up @@ -16,6 +16,8 @@
#include <jansson.h>
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "job-manager.h"

Expand Down
2 changes: 2 additions & 0 deletions src/modules/job-manager/urgency.c
Expand Up @@ -28,6 +28,8 @@
#endif
#include <flux/core.h>

#include "src/common/libczmqcontainers/czmq_containers.h"

#include "job.h"
#include "event.h"
#include "alloc.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/job-manager/wait.c
Expand Up @@ -55,6 +55,7 @@
#include "src/common/libutil/errno_safe.h"
#include "src/common/libeventlog/eventlog.h"
#include "src/common/libjob/job_hash.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "drain.h"
#include "submit.h"
Expand Down
1 change: 1 addition & 0 deletions src/modules/kvs/cache.c
Expand Up @@ -32,6 +32,7 @@
#include "src/common/libutil/log.h"
#include "src/common/libutil/iterators.h"
#include "src/common/libkvs/kvs_util_private.h"
#include "src/common/libczmqcontainers/czmq_containers.h"

#include "waitqueue.h"
#include "cache.h"
Expand Down

0 comments on commit 6771b05

Please sign in to comment.