Skip to content

Commit

Permalink
Merge remote branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
shefty committed Sep 10, 2015
2 parents 025c04d + 2b94096 commit d2418b2
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 48 deletions.
42 changes: 22 additions & 20 deletions config/cron-run-all-md2nroff.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
if (!defined($repo_arg));
die "Must specify a git source branch"
if (!defined($source_branch_arg));
die "Must specify a git pages branch"
if (!defined($pages_branch_arg));

#####################################################################

Expand Down Expand Up @@ -103,8 +101,10 @@ sub verbose {
doit(0, "git clone --single-branch --branch $source_branch_arg $repo_arg source", "git-clone");

# Next, git clone the pages branch of repo
verbose("*** Cloning repo: $repo_arg / $pages_branch_arg...\n");
doit(0, "git clone --single-branch --branch $pages_branch_arg $repo_arg pages", "git-clone2");
if (defined($pages_branch_arg)) {
verbose("*** Cloning repo: $repo_arg / $pages_branch_arg...\n");
doit(0, "git clone --single-branch --branch $pages_branch_arg $repo_arg pages", "git-clone2");
}

#####################################################################

Expand All @@ -118,29 +118,31 @@ sub verbose {
#####################################################################

# Copy each of the markdown files to the pages branch checkout
chdir("pages/master");
foreach my $file (@markdown_files) {
doit(0, "cp ../../source/man/$file man/$file", "loop-cp");
if (defined($pages_branch_arg)) {
chdir("pages/master");
foreach my $file (@markdown_files) {
doit(0, "cp ../../source/man/$file man/$file", "loop-cp");

# Is there a new man page? If so, we need to "git add" it.
my $out = `git status --porcelain man/$file`;
doit(0, "git add man/$file", "loop-git-add")
if ($out =~ /^\?\?/);
}

# Is there a new man page? If so, we need to "git add" it.
my $out = `git status --porcelain man/$file`;
doit(0, "git add man/$file", "loop-git-add")
if ($out =~ /^\?\?/);
# Git commit those files in the pages repo and push them to the
# upstream repo so that they go live. If nothing changed, the commit
# and push will be no-ops.
chdir("..");
doit(1, "git commit --no-verify -a -m \"Updated Markdown man pages from $source_branch_arg\"",
"git-commit-first");
doit(1, "git push", "git-push-first");
}

# Git commit those files in the pages repo and push them to the
# upstream repo so that they go live. If nothing changed, the commit
# and push will be no-ops.
chdir("..");
doit(1, "git commit --no-verify -a -m \"Updated Markdown man pages from $source_branch_arg\"",
"git-commit-first");
doit(1, "git push", "git-push-first");

#####################################################################

# Now process each of the Markdown files in the source repo and
# generate new nroff man pages.
chdir("../source/man");
chdir("$tmpdir/source/man");
foreach my $file (@markdown_files) {
doit(0, "../config/md2nroff.pl --source $file", "loop2-md2nroff");

Expand Down
38 changes: 38 additions & 0 deletions config/ofiwg-bot@flatbed:crontab.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Update the git clone of libfabric
#
# Split this into two lines so that we can have it run every 15 minutes
# *except* 3:00am (when the nightly tarball is created, which does
# its own git pull).
#
# Update master:
0,15,30,45 0-2,4-23 * * * (cd $HOME/cron/git/libfabric; git pull --rebase > /dev/null 2>&1; cd $HOME/cron/git/fabtests; git pull --rebase > /dev/null 2>&1)
15,30,45 3 * * * (cd $HOME/cron/git/libfabric; git pull --rebase > /dev/null 2>&1; cd $HOME/cron/git/fabtests; git pull --rebase > /dev/null 2>&1)
#
# Update v1.1.x:
1,16,31,46 0-2,4-23 * * * (cd $HOME/cron/git/libfabric-1.1.x; git pull --rebase > /dev/null 2>&1)
15,30,45 3 * * * (cd $HOME/cron/git/libfabric-1.1.x; git pull --rebase > /dev/null 2>&1)
#
# Using the script from newly-updated libfabric master clone,
# generate new man pages
#
5,20,35,50 * * * * (PATH=$HOME/cron/local/bin:$PATH; /home/ofiwg-bot/cron/git/libfabric/config/cron-run-all-md2nroff.pl --repo git@github.com:ofiwg/libfabric.git --source-branch master --pages-branch gh-pages --logfile-dir ~/cron/build-logs)
#
# Also update man pages on v1.x branch
# Do not auto-publish the new pages to gh-pages
#
6,21,36,51 * * * * (PATH=$HOME/cron/local/bin:$PATH; /home/ofiwg-bot/cron/git/libfabric/config/cron-run-all-md2nroff.pl --repo git@github.com:ofiwg/libfabric.git --source-branch v1.1.x --logfile-dir ~/cron/build-logs/v1.1.x)
#
# Make a nightly tarball snapshot from:
# - libfabric master
# - fabtests master
#
0 3 * * * (PATH=$HOME/cron/local/bin:$PATH; $HOME/cron/git/libfabric/config/cron-make-nightly-tarball.pl --libfabric-source-dir $HOME/cron/git/libfabric --fabtests-source-dir $HOME/cron/git/fabtests --download-dir=/var/www/html/downloads/ofiwg/nightly_tarballs/v1.2.x --logfile-dir ~/cron/build-logs/v1.2.x --libfabric-coverity-token `cat ~/coverity-libfabric-token.txt` --fabtests-coverity-token `cat ~/coverity-fabtests-token.txt`)
#
# Make a nightly tarball snapshot from:
# - libfabric v1.1.x branch
# - fabtests master
#
# No Coverity submissions for this build.
#
15 3 * * * (PATH=$HOME/cron/local/bin:$PATH; $HOME/cron/git/libfabric/config/cron-make-nightly-tarball.pl --libfabric-source-dir $HOME/cron/git/libfabric-1.1.x --fabtests-source-dir $HOME/cron/git/fabtests --download-dir=/var/www/html/downloads/ofiwg/nightly_tarballs/v1.1.x --logfile-dir ~/cron/build-logs/v1.1.x)
2 changes: 1 addition & 1 deletion man/fi_rma.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct fi_msg_rma {
const struct iovec *msg_iov; /* local scatter-gather array */
void **desc; /* operation descriptor */
size_t iov_count; /* # elements in msg_iov */
const void *addr; /* optional endpoint address */
fi_addr_t addr; /* optional endpoint address */
const struct fi_rma_iov *rma_iov;/* remote SGL */
size_t rma_iov_count;/* # elements in rma_iov */
void *context; /* user-defined context */
Expand Down
32 changes: 32 additions & 0 deletions man/fi_sockets.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,38 @@ performance numbers are lower compared to other providers implemented
over high-speed fabric, and lower than what an application might see
implementing to sockets directly.

# RUNTIME PARAMETERS

The sockets provider checks for the following environment variables -

*FI_SOCKETS_PE_WAITTIME*
: An integer value that specifies how many milliseconds to spin while waiting for progress in *FI_PROGRESS_AUTO* mode.

*FI_SOCKETS_MAX_CONN_RETRY*
: An integer value that specifies the number of socket connection retries before reporting as failure.

*FI_SOCKETS_DEF_CONN_MAP_SZ*
: An integer to specify the default connection map size.

*FI_SOCKETS_DEF_AV_SZ*
: An integer to specify the default address vector size.

*FI_SOCKETS_DEF_CQ_SZ*
: An integer to specify the default completion queue size.

*FI_SOCKETS_DEF_EQ_SZ*
: An integer to specify the default event queue size.

*FI_SOCKETS_DGRAM_DROP_RATE*
: An integer value to specify the drop rate of dgram frame when endpoint is *FI_EP_DGRAM*. This is for debugging purpose only.

*FI_SOCKETS_PE_AFFINITY*
: If specified, progress thread is bound to the indicated range(s) of Linux virtual processor ID(s). This option is currently not supported on OS X. The usage is - id_start[-id_end[:stride]][,].

# LARGE SCALE JOBS

For large scale runs one can use these environment variables to set the default parameters e.g. size of the address vector(AV), completion queue (CQ), connection map etc. that satisfies the requriment of the particular benchmark. The recommended parameters for large scale runs are *FI_SOCKETS_MAX_CONN_RETRY*, *FI_SOCKETS_DEF_CONN_MAP_SZ*, *FI_SOCKETS_DEF_AV_SZ*, *FI_SOCKETS_DEF_CQ_SZ*, *FI_SOCKETS_DEF_EQ_SZ*.

# SEE ALSO

[`fabric`(7)](fabric.7.html),
Expand Down
4 changes: 2 additions & 2 deletions man/man3/fi_rma.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH fi_rma 3 "2015\-08\-19" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_rma 3 "2015\-09\-10" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.SH NAME
.PP
fi_rma - Remote memory access operations
Expand Down Expand Up @@ -148,7 +148,7 @@ struct\ fi_msg_rma\ {
\ \ \ \ const\ struct\ iovec\ *msg_iov;\ \ \ \ \ /*\ local\ scatter-gather\ array\ */
\ \ \ \ void\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ **desc;\ \ \ \ \ \ \ /*\ operation\ descriptor\ */
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ \ \ \ iov_count;\ \ \ \ /*\ #\ elements\ in\ msg_iov\ */
\ \ \ \ const\ void\ \ \ \ \ \ \ \ \ *addr;\ \ \ \ \ \ \ \ /*\ optional\ endpoint\ address\ */
\ \ \ \ fi_addr_t\ \ \ \ \ \ \ \ \ \ addr;\ \ \ \ \ \ \ \ /*\ optional\ endpoint\ address\ */
\ \ \ \ const\ struct\ fi_rma_iov\ *rma_iov;/*\ remote\ SGL\ */
\ \ \ \ size_t\ \ \ \ \ \ \ \ \ \ \ \ \ rma_iov_count;/*\ #\ elements\ in\ rma_iov\ */
\ \ \ \ void\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *context;\ \ \ \ \ /*\ user-defined\ context\ */
Expand Down
44 changes: 43 additions & 1 deletion man/man7/fi_sockets.7
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH fi_sockets 7 "2015\-05\-05" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.TH fi_sockets 7 "2015\-09\-08" "Libfabric Programmer\[aq]s Manual" "\@VERSION\@"
.SH NAME
.PP
The Sockets Fabric Provider
Expand Down Expand Up @@ -44,6 +44,48 @@ implemented over TCP sockets.
As a result, the performance numbers are lower compared to other
providers implemented over high-speed fabric, and lower than what an
application might see implementing to sockets directly.
.SH RUNTIME PARAMETERS
.PP
The sockets provider checks for the following environment variables -
.PP
\f[I]FI_SOCKETS_PE_WAITTIME\f[] : An integer value that specifies how
many milliseconds to spin while waiting for progress in
\f[I]FI_PROGRESS_AUTO\f[] mode.
.PP
\f[I]FI_SOCKETS_MAX_CONN_RETRY\f[] : An integer value that specifies the
number of socket connection retries before reporting as failure.
.PP
\f[I]FI_SOCKETS_DEF_CONN_MAP_SZ\f[] : An integer to specify the default
connection map size.
.PP
\f[I]FI_SOCKETS_DEF_AV_SZ\f[] : An integer to specify the default
address vector size.
.PP
\f[I]FI_SOCKETS_DEF_CQ_SZ\f[] : An integer to specify the default
completion queue size.
.PP
\f[I]FI_SOCKETS_DEF_EQ_SZ\f[] : An integer to specify the default event
queue size.
.PP
\f[I]FI_SOCKETS_DGRAM_DROP_RATE\f[] : An integer value to specify the
drop rate of dgram frame when endpoint is \f[I]FI_EP_DGRAM\f[].
This is for debugging purpose only.
.PP
\f[I]FI_SOCKETS_PE_AFFINITY\f[] : If specified, progress thread is bound
to the indicated range(s) of Linux virtual processor ID(s).
This option is currently not supported on OS X.
The usage is - id_start[-id_end[:stride]][,].
.SH LARGE SCALE JOBS
.PP
For large scale runs one can use these environment variables to set the
default parameters e.g.
size of the address vector(AV), completion queue (CQ), connection map
etc.
that satisfies the requriment of the particular benchmark.
The recommended parameters for large scale runs are
\f[I]FI_SOCKETS_MAX_CONN_RETRY\f[], \f[I]FI_SOCKETS_DEF_CONN_MAP_SZ\f[],
\f[I]FI_SOCKETS_DEF_AV_SZ\f[], \f[I]FI_SOCKETS_DEF_CQ_SZ\f[],
\f[I]FI_SOCKETS_DEF_EQ_SZ\f[].
.SH SEE ALSO
.PP
\f[C]fabric\f[](7), \f[C]fi_provider\f[](7), \f[C]fi_getinfo\f[](3)
Expand Down
10 changes: 8 additions & 2 deletions prov/sockets/src/sock_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,17 @@ static int sock_ep_atomic_valid(struct fid_ep *ep, enum fi_datatype datatype,
op == FI_BXOR || op == FI_MSWAP)
return -FI_ENOENT;
break;

case FI_FLOAT_COMPLEX:
case FI_DOUBLE_COMPLEX:
case FI_LONG_DOUBLE_COMPLEX:
return -FI_ENOENT;
if (op == FI_BOR || op == FI_BAND ||
op == FI_BXOR || op == FI_MSWAP ||
op == FI_MIN || op == FI_MAX ||
op == FI_CSWAP_LE || op == FI_CSWAP_LT ||
op == FI_CSWAP_GE || op == FI_CSWAP_GT)
return -FI_ENOENT;
break;
default:
break;
}
Expand Down
22 changes: 14 additions & 8 deletions prov/sockets/src/sock_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ static int sock_av_insertsym(struct fid_av *av, const char *node, size_t nodecnt
const char *service, size_t svccnt, fi_addr_t *fi_addr,
uint64_t flags, void *context)
{
int ret = 0, success = 0, err_code = 0;
int ret = 0, success = 0, err_code = 0, len1, len2;
int var_port, var_host;
char base_host[FI_NAME_MAX] = {0};
char tmp_host[FI_NAME_MAX] = {0};
char tmp_port[FI_NAME_MAX] = {0};
int hostlen, offset = 0, fmt, i, j;

if (!node || !service) {
if (!node || !service || node[0] == '\0') {
SOCK_LOG_ERROR("Node/service not provided\n");
return -FI_EINVAL;
}
Expand All @@ -386,20 +386,26 @@ static int sock_av_insertsym(struct fid_av *av, const char *node, size_t nodecnt
fmt = 0;
else
fmt = offset;


assert((hostlen-offset) < FI_NAME_MAX);
strncpy(base_host, node, hostlen - (offset));
var_port = atoi(service);
var_host = atoi(node + hostlen - offset);

for (i = 0; i < nodecnt; i++) {
for (j = 0; j < svccnt; j++) {
sprintf(tmp_host, "%s%0*d", base_host, fmt, var_host + i);
sprintf(tmp_port, "%d", var_port + j);
if ((ret = _sock_av_insertsvc(av, tmp_host, tmp_port, fi_addr, flags,
len1 = snprintf(tmp_host, FI_NAME_MAX, "%s%0*d", base_host, fmt, var_host + i);
len2 = snprintf(tmp_port, FI_NAME_MAX, "%d", var_port + j);
if (len1 > 0 && len1 < FI_NAME_MAX && len2 > 0 && len2 < FI_NAME_MAX) {
if ((ret = _sock_av_insertsvc(av, tmp_host, tmp_port, fi_addr, flags,
context, i * nodecnt + j)) == 1) {
success++;
success++;
} else {
err_code = ret;
}
} else {
err_code = ret;
SOCK_LOG_ERROR("Node/service value is not valid\n");
err_code = FI_ETOOSMALL;
}
}
}
Expand Down
32 changes: 25 additions & 7 deletions prov/sockets/src/sock_fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int sock_cm_def_map_sz = SOCK_CMAP_DEF_SZ;
int sock_av_def_sz = SOCK_AV_DEF_SZ;
int sock_cq_def_sz = SOCK_CQ_DEF_SZ;
int sock_eq_def_sz = SOCK_EQ_DEF_SZ;
char *sock_pe_affinity_str = NULL;
#if ENABLE_DEBUG
int sock_dgram_drop_rate = 0;
#endif
Expand All @@ -73,6 +74,7 @@ const struct fi_fabric_attr sock_fabric_attr = {
static struct dlist_entry sock_fab_list;
static struct dlist_entry sock_dom_list;
static fastlock_t sock_list_lock;
static int read_default_params = 0;

void sock_dom_add_to_list(struct sock_domain *domain)
{
Expand Down Expand Up @@ -307,6 +309,23 @@ static struct fi_ops sock_fab_fi_ops = {
.ops_open = fi_no_ops_open,
};

static void sock_read_default_params() {
if (!read_default_params) {
fi_param_get_int(&sock_prov, "pe_waittime", &sock_pe_waittime);
fi_param_get_int(&sock_prov, "max_conn_retry", &sock_conn_retry);
fi_param_get_int(&sock_prov, "def_conn_map_sz", &sock_cm_def_map_sz);
fi_param_get_int(&sock_prov, "def_av_sz", &sock_av_def_sz);
fi_param_get_int(&sock_prov, "def_cq_sz", &sock_cq_def_sz);
fi_param_get_int(&sock_prov, "def_eq_sz", &sock_eq_def_sz);
if(fi_param_get_str(&sock_prov, "pe_affinity", &sock_pe_affinity_str) != FI_SUCCESS)
sock_pe_affinity_str = NULL;
#if ENABLE_DEBUG
fi_param_get_int(&sock_prov, "dgram_drop_rate", &sock_dgram_drop_rate);
#endif
read_default_params = 1;
}
}

static int sock_fabric(struct fi_fabric_attr *attr,
struct fid_fabric **fabric, void *context)
{
Expand All @@ -319,6 +338,8 @@ static int sock_fabric(struct fi_fabric_attr *attr,
if (!fab)
return -FI_ENOMEM;

sock_read_default_params();

fastlock_init(&fab->lock);
dlist_init(&fab->service_list);

Expand Down Expand Up @@ -583,35 +604,32 @@ SOCKETS_INI
{
fi_param_define(&sock_prov, "pe_waittime", FI_PARAM_INT,
"How many milliseconds to spin while waiting for progress");
fi_param_get_int(&sock_prov, "pe_waittime", &sock_pe_waittime);

fi_param_define(&sock_prov, "max_conn_retry", FI_PARAM_INT,
"Number of connection retries before reporting as failure");
fi_param_get_int(&sock_prov, "max_conn_retry", &sock_conn_retry);

fi_param_define(&sock_prov, "def_conn_map_sz", FI_PARAM_INT,
"Default connection map size");
fi_param_get_int(&sock_prov, "def_conn_map_sz", &sock_cm_def_map_sz);

fi_param_define(&sock_prov, "def_av_sz", FI_PARAM_INT,
"Default address vector size");
fi_param_get_int(&sock_prov, "def_av_sz", &sock_av_def_sz);

fi_param_define(&sock_prov, "def_cq_sz", FI_PARAM_INT,
"Default completion queue size");
fi_param_get_int(&sock_prov, "def_cq_sz", &sock_cq_def_sz);

fi_param_define(&sock_prov, "def_eq_sz", FI_PARAM_INT,
"Default event queue size");
fi_param_get_int(&sock_prov, "def_eq_sz", &sock_eq_def_sz);

fi_param_define(&sock_prov, "pe_affinity", FI_PARAM_STRING,
"If specified, bind the progress thread to the indicated range(s) of Linux virtual processor ID(s). "
"This option is currently not supported on OS X. Usage: id_start[-id_end[:stride]][,]");

fastlock_init(&sock_list_lock);
dlist_init(&sock_fab_list);
dlist_init(&sock_dom_list);
#if ENABLE_DEBUG
fi_param_define(&sock_prov, "dgram_drop_rate", FI_PARAM_INT,
"Drop every Nth dgram frame (debug only)");
fi_param_get_int(&sock_prov, "dgram_drop_rate", &sock_dgram_drop_rate);
#endif
return (&sock_prov);
}
Loading

0 comments on commit d2418b2

Please sign in to comment.