2004-08-02 04:24:22 +04:00
|
|
|
/*
|
2010-03-13 02:57:50 +03:00
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-24 20:38:08 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2008-06-15 17:43:28 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2009-01-08 17:39:00 +03:00
|
|
|
* Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
|
2009-02-13 06:44:29 +03:00
|
|
|
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
2013-03-28 01:09:41 +04:00
|
|
|
* Copyright (c) 2010-2013 Los Alamos National Security, LLC.
|
2010-06-09 20:58:52 +04:00
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2008-06-15 17:43:28 +04:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2008-06-15 17:43:28 +04:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-10-20 05:03:09 +04:00
|
|
|
#include "ompi_config.h"
|
2009-07-16 22:27:33 +04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2006-07-13 02:12:07 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
#endif /* HAVE_UNISTD_H*/
|
2007-07-14 00:49:30 +04:00
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif /* HAVE_STDLIB_H */
|
|
|
|
#include <errno.h>
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/base/base.h"
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/allocator/base/base.h"
|
2004-06-17 00:01:19 +04:00
|
|
|
#include "mpool_sm.h"
|
2010-06-09 20:58:52 +04:00
|
|
|
#include "ompi/mca/common/sm/common_sm.h"
|
2006-09-26 20:02:31 +04:00
|
|
|
#include "ompi/proc/proc.h"
|
2004-06-16 19:41:29 +04:00
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-10-16 19:09:00 +04:00
|
|
|
#include "opal/runtime/opal_cr.h"
|
|
|
|
#endif
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
static int
|
|
|
|
mca_mpool_sm_register(void);
|
|
|
|
|
2013-01-11 20:24:56 +04:00
|
|
|
static int
|
|
|
|
mca_mpool_sm_open(void);
|
|
|
|
|
|
|
|
static int
|
|
|
|
mca_mpool_sm_close(void);
|
|
|
|
|
|
|
|
static mca_mpool_base_module_t *
|
|
|
|
mca_mpool_sm_init(struct mca_mpool_base_resources_t* resources);
|
2004-06-18 00:33:52 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_mpool_sm_component_t mca_mpool_sm_component = {
|
2004-06-16 19:41:29 +04:00
|
|
|
{
|
2004-08-02 04:24:22 +04:00
|
|
|
/* First, the mca_base_component_t struct containing meta
|
|
|
|
information about the component itself */
|
|
|
|
|
|
|
|
{
|
2008-07-29 02:40:57 +04:00
|
|
|
MCA_MPOOL_BASE_VERSION_2_0_0,
|
2004-08-02 04:24:22 +04:00
|
|
|
|
|
|
|
"sm", /* MCA component name */
|
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
|
|
|
OMPI_MAJOR_VERSION, /* MCA component major version */
|
|
|
|
OMPI_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
OMPI_RELEASE_VERSION, /* MCA component release version */
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_mpool_sm_open, /* component open */
|
2013-03-28 01:09:41 +04:00
|
|
|
mca_mpool_sm_close,
|
|
|
|
NULL,
|
|
|
|
mca_mpool_sm_register
|
2004-08-02 04:24:22 +04:00
|
|
|
},
|
|
|
|
{
|
2008-10-16 19:09:00 +04:00
|
|
|
/* The component is checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
2004-08-02 04:24:22 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
mca_mpool_sm_init
|
2004-06-16 19:41:29 +04:00
|
|
|
}
|
|
|
|
};
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
static long default_min = 67108864;
|
|
|
|
static unsigned long long ompi_mpool_sm_min_size;
|
|
|
|
static int ompi_mpool_sm_verbose;
|
|
|
|
|
|
|
|
static int mca_mpool_sm_register(void)
|
|
|
|
{
|
|
|
|
/* register SM component parameters */
|
|
|
|
(void) mca_base_var_group_component_register(&mca_mpool_sm_component.super.mpool_version,
|
|
|
|
"Shared memory pool");
|
|
|
|
|
|
|
|
mca_mpool_sm_component.sm_allocator_name = "bucket";
|
|
|
|
(void) mca_base_component_var_register(&mca_mpool_sm_component.super.mpool_version,
|
|
|
|
"allocator", "Name of allocator component "
|
|
|
|
"to use with sm mpool", MCA_BASE_VAR_TYPE_STRING,
|
|
|
|
NULL, 0, 0, OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&mca_mpool_sm_component.sm_allocator_name);
|
|
|
|
|
|
|
|
/* register as an unsigned long long to get up to 64 bits for the size */
|
|
|
|
ompi_mpool_sm_min_size = default_min;
|
|
|
|
(void) mca_base_component_var_register(&mca_mpool_sm_component.super.mpool_version,
|
|
|
|
"min_size", "Minimum size of the sm mpool shared memory file",
|
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_LONG_LONG, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&ompi_mpool_sm_min_size);
|
|
|
|
|
|
|
|
ompi_mpool_sm_verbose = 0;
|
|
|
|
(void) mca_base_component_var_register(&mca_mpool_sm_component.super.mpool_version,
|
|
|
|
"verbose", "Enable verbose output for mpool sm component",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&ompi_mpool_sm_verbose);
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2009-01-08 17:39:00 +03:00
|
|
|
|
2004-06-16 19:41:29 +04:00
|
|
|
/**
|
|
|
|
* component open/close/init function
|
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
static int mca_mpool_sm_open(void)
|
2004-06-16 19:41:29 +04:00
|
|
|
{
|
2013-03-28 01:09:41 +04:00
|
|
|
if (ompi_mpool_sm_verbose != 0) {
|
2013-01-11 20:24:56 +04:00
|
|
|
mca_mpool_sm_component.verbose = opal_output_open(NULL);
|
2007-07-14 00:49:30 +04:00
|
|
|
} else {
|
2013-01-11 20:24:56 +04:00
|
|
|
mca_mpool_sm_component.verbose = -1;
|
2007-07-14 00:49:30 +04:00
|
|
|
}
|
2006-09-26 20:02:31 +04:00
|
|
|
|
2004-06-16 19:41:29 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2006-07-13 02:12:07 +04:00
|
|
|
static int mca_mpool_sm_close( void )
|
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2004-06-16 19:41:29 +04:00
|
|
|
|
2013-01-11 20:24:56 +04:00
|
|
|
static mca_mpool_base_module_t *
|
|
|
|
mca_mpool_sm_init(struct mca_mpool_base_resources_t *resources)
|
2004-06-16 19:41:29 +04:00
|
|
|
{
|
2013-01-11 20:24:56 +04:00
|
|
|
mca_mpool_sm_module_t *mpool_module;
|
2007-07-14 00:49:30 +04:00
|
|
|
mca_allocator_base_component_t* allocator_component;
|
2006-09-26 20:02:31 +04:00
|
|
|
ompi_proc_t **procs;
|
|
|
|
size_t num_all_procs, i, num_local_procs = 0;
|
2008-06-15 17:43:28 +04:00
|
|
|
|
2007-02-01 20:18:35 +03:00
|
|
|
/* README: this needs to change if procs in different jobs (even
|
2013-01-11 20:24:56 +04:00
|
|
|
* spawned ones) are to talk using shared memory */
|
|
|
|
if (NULL == (procs = ompi_proc_world(&num_all_procs))) {
|
|
|
|
/* out of resources, so just bail */
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-09-26 20:02:31 +04:00
|
|
|
for (i = 0 ; i < num_all_procs ; ++i) {
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
if (OPAL_PROC_ON_LOCAL_NODE(procs[i]->proc_flags)) {
|
2006-09-26 20:02:31 +04:00
|
|
|
num_local_procs++;
|
|
|
|
}
|
|
|
|
}
|
2007-07-14 00:49:30 +04:00
|
|
|
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
/* Make a new mpool module */
|
|
|
|
mpool_module =
|
2013-01-11 20:24:56 +04:00
|
|
|
(mca_mpool_sm_module_t *)malloc(sizeof(mca_mpool_sm_module_t));
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
mca_mpool_sm_module_init(mpool_module);
|
|
|
|
|
2009-02-20 22:51:57 +03:00
|
|
|
/* set sm_size */
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
mpool_module->sm_size = resources->size;
|
2007-07-14 00:49:30 +04:00
|
|
|
|
2009-02-20 22:51:57 +03:00
|
|
|
/* clip at the min size */
|
2013-03-28 01:09:41 +04:00
|
|
|
if (mpool_module->sm_size < (long) ompi_mpool_sm_min_size) {
|
|
|
|
mpool_module->sm_size = (long) ompi_mpool_sm_min_size;
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
}
|
2006-09-26 20:02:31 +04:00
|
|
|
|
2005-06-07 06:09:57 +04:00
|
|
|
allocator_component = mca_allocator_component_lookup(
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_mpool_sm_component.sm_allocator_name);
|
2004-06-17 00:01:19 +04:00
|
|
|
|
2007-07-14 00:49:30 +04:00
|
|
|
/* if specified allocator cannot be loaded - look for an alternative */
|
2013-01-11 20:24:56 +04:00
|
|
|
if (NULL == allocator_component) {
|
2013-03-28 01:17:31 +04:00
|
|
|
if (opal_list_get_size(&ompi_allocator_base_framework.framework_components) == 0) {
|
2013-01-11 20:24:56 +04:00
|
|
|
mca_base_component_list_item_t *item =
|
|
|
|
(mca_base_component_list_item_t *)
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_list_get_first(&ompi_allocator_base_framework.framework_components);
|
2013-01-11 20:24:56 +04:00
|
|
|
allocator_component =
|
|
|
|
(mca_allocator_base_component_t *)item->cli_component;
|
|
|
|
opal_output(
|
|
|
|
0, "mca_mpool_sm_init: "
|
|
|
|
"unable to locate allocator: %s - using %s\n",
|
|
|
|
mca_mpool_sm_component.sm_allocator_name,
|
|
|
|
allocator_component->allocator_version.mca_component_name);
|
2004-06-17 00:01:19 +04:00
|
|
|
} else {
|
2013-01-11 20:24:56 +04:00
|
|
|
opal_output(0, "mca_mpool_sm_init: "
|
|
|
|
"unable to locate allocator: %s\n",
|
|
|
|
mca_mpool_sm_component.sm_allocator_name);
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
free(procs);
|
2004-06-17 00:01:19 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
2007-07-14 00:49:30 +04:00
|
|
|
|
2009-03-15 01:08:26 +03:00
|
|
|
mpool_module->mem_node = resources->mem_node;
|
2006-07-13 02:12:07 +04:00
|
|
|
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(mca_mpool_sm_component.verbose,
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
"mca_mpool_sm_init: shared memory size used: (%ld)",
|
|
|
|
mpool_module->sm_size);
|
|
|
|
|
2013-01-11 20:24:56 +04:00
|
|
|
if (NULL == (mpool_module->sm_common_module =
|
|
|
|
mca_common_sm_module_attach(&resources->bs_meta_buf,
|
2010-06-09 20:58:52 +04:00
|
|
|
sizeof(mca_common_sm_module_t), 8))) {
|
2013-01-11 20:24:56 +04:00
|
|
|
opal_output(mca_mpool_sm_component.verbose, "mca_mpool_sm_init: "
|
|
|
|
"unable to create shared memory mapping (%s)",
|
|
|
|
resources->bs_meta_buf.seg_name);
|
2008-06-06 00:04:38 +04:00
|
|
|
free(mpool_module);
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
free(procs);
|
2004-06-17 00:01:19 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
free(procs);
|
2004-06-17 00:01:19 +04:00
|
|
|
|
2006-07-13 02:12:07 +04:00
|
|
|
/* setup allocator */
|
2005-05-31 21:06:55 +04:00
|
|
|
mpool_module->sm_allocator =
|
|
|
|
allocator_component->allocator_init(true,
|
2010-06-09 20:58:52 +04:00
|
|
|
mca_common_sm_seg_alloc,
|
Fixes trac:1988. The little bug that turned out to be huge. Yoinks.
* Various cosmetic/style updates in the btl sm
* Clean up concept of mpool module (I think that code was written way
back when the concept of "modules" was fuzzy)
* Bring over some old fixes from the /tmp/timattox-sm-coll/ tree to
fix potential segv's when mmap'ed regions were at different
addresses in different processes (thanks Tim!).
* Change sm coll to no longer use mpool as its main source of shmem;
rather, just mmap its own segment (because it's fixed size --
there was nothing to be gained by using mpool; shedding the use of
mpool saved a lot of complexity in the sm coll setup). This
effectively made Tim's fixes moot (because now everything is an
offset into the mmap that is computed locally; there are no global
pointers). :-)
* Slightly updated common/sm to allow making mmap's for a specific
set of procs (vs. ''all'' procs in the process). This potentially
allows for same-host-inter-proc mmaps -- yay!
* Fixed many, many things in the coll sm (particularly in reduce):
* Fixed handling of MPI_IN_PLACE in reduce and allreduce
* Fixed handling of non-contiguous datatypes in reduce
* Changed the order of reductions to go from process (n-1)'s data
to process 0's data, because that's how all other OMPI coll
components work
* Fixed lots of usage of ddt functions
* When using a non-contiguous datatype, if the root process is not
(n-1), now we used a 2nd convertor to copy from shmem to the rbuf
(saves a memory copy vs. what was done before)
* Lots and lots of little cleanups, clarifications, and minor
optimizations (although still more could be done -- e.g., I think
the use of write memory barriers is fairly sub-optimal; they
could be ganged together at the root, for example)
I'm marking this as "fixes trac:1988" and closing the ticket; if something
is still broken, we can re-open the ticket.
This commit was SVN r21967.
The following Trac tickets were found above:
Ticket 1988 --> https://svn.open-mpi.org/trac/ompi/ticket/1988
2009-09-15 04:25:21 +04:00
|
|
|
NULL, &(mpool_module->super));
|
2013-01-11 20:24:56 +04:00
|
|
|
if (NULL == mpool_module->sm_allocator) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "mca_mpool_sm_init: unable to initialize allocator");
|
2008-06-06 00:04:38 +04:00
|
|
|
free(mpool_module);
|
2004-06-17 00:01:19 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
2005-05-31 21:06:55 +04:00
|
|
|
|
|
|
|
return &mpool_module->super;
|
2004-06-16 19:41:29 +04:00
|
|
|
}
|
2005-05-31 21:06:55 +04:00
|
|
|
|