Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libczmqcontainers: introduce new internal library of czmq zhashx library #3596

Merged
merged 2 commits into from Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -495,6 +495,7 @@ AC_CONFIG_FILES( \
src/common/libterminus/Makefile \
src/common/libhostlist/Makefile \
src/common/librlist/Makefile \
src/common/libczmqcontainers/Makefile \
src/bindings/Makefile \
src/bindings/lua/Makefile \
src/bindings/python/Makefile \
Expand Down
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
4 changes: 3 additions & 1 deletion src/common/Makefile.am
Expand Up @@ -21,7 +21,8 @@ SUBDIRS = \
libterminus \
libcontent \
libhostlist \
librlist
librlist \
libczmqcontainers

AM_CFLAGS = $(WARNING_CFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_LDFLAGS = $(CODE_COVERAGE_LIBS)
Expand All @@ -42,6 +43,7 @@ libflux_internal_la_LIBADD = \
$(builddir)/libioencode/libioencode.la \
$(builddir)/librouter/librouter.la \
$(builddir)/libhostlist/libhostlist.la \
$(builddir)/libczmqcontainers/libczmqcontainers.la \
$(JANSSON_LIBS) \
$(ZMQ_LIBS) \
$(LIBUUID_LIBS) \
Expand Down
22 changes: 22 additions & 0 deletions src/common/libczmqcontainers/Makefile.am
@@ -0,0 +1,22 @@
AM_CFLAGS = \
$(WARNING_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)

AM_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS)

AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/include \
$(ZMQ_CFLAGS)

noinst_LTLIBRARIES = \
libczmqcontainers.la

libczmqcontainers_la_SOURCES = \
czmq_containers.h \
czmq_internal.h \
zhashx.h \
zhashx.c \
zhash_primes.inc \
zhashx_map.h
24 changes: 24 additions & 0 deletions src/common/libczmqcontainers/czmq_containers.h
@@ -0,0 +1,24 @@
/************************************************************\
* Copyright 2021 Lawrence Livermore National Security, LLC
* (c.f. AUTHORS, NOTICE.LLNS, COPYING)
*
* This file is part of the Flux resource manager framework.
* For details, see https://github.com/flux-framework.
*
* SPDX-License-Identifier: LGPL-3.0
\************************************************************/

#ifndef _CZMQ_CONTAINERS_H
#define _CZMQ_CONTAINERS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "zhashx.h"

#ifdef __cplusplus
}
#endif

#endif
42 changes: 42 additions & 0 deletions src/common/libczmqcontainers/czmq_internal.h
@@ -0,0 +1,42 @@
/* =========================================================================
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of CZMQ, the high-level C binding for 0MQ:
http://czmq.zeromq.org.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
=========================================================================
*/

/* To avoid copying in an excess amount of code from czmq, the
* following have been manually cut and pasted in
*/

#ifndef __CZMQ_INTERNAL__
#define __CZMQ_INTERNAL__

#if HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdlib.h>

#ifdef NDEBUG
#undef NDEBUG
#include <assert.h>
#define NDEBUG
#else
#include <assert.h>
#endif

#define freen(x) do {free(x); x = NULL;} while(0)

#ifndef CZMQ_EXPORT
#define CZMQ_EXPORT
#endif

typedef struct _zhashx_t fzhashx_t;

#endif