1
1
Граф коммитов

1415 Коммитов

Автор SHA1 Сообщение Дата
Jeff Squyres
67ba8da76f ompi_mpi_init: fix race condition
There was a race condition in 35438ae9b5: if multiple threads invoked
ompi_mpi_init() simultaneously (which could happen from both MPI and
OSHMEM), the code did not catch this condition -- Bad Things would
happen.

Now use an atomic cmp/set to ensure that only one thread is able to
advance ompi_mpi_init from NOT_INITIALIZED to INIT_STARTED.

Additionally, change the prototype of ompi_mpi_init() so that
oshmem_init() can safely invoke ompi_mpi_init() multiple times (as
long as MPI_FINALIZE has not started) without displaying an error.  If
multiple threads invoke oshmem_init() simultaneously, one of them will
actually do the initialization, and the rest will loop waiting for it
to complete.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-06-05 18:09:13 -07:00
Gilles Gouaillardet
05b3546151 java: do not use MPI1 deprecated subroutines
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-06-04 10:49:52 +09:00
Jeff Squyres
35438ae9b5 mpi/finalized: revamp INITIALIZED/FINALIZED
Per MPI-3.1:8.7.1 p361:11-13, it's valid for MPI_FINALIZED to be
invoked during an attribute destruction callback (e.g., during the
destruction of keyvals on MPI_COMM_SELF during the very beginning of
MPI_FINALIZE).  In such cases, MPI_FINALIZED must return "false".

Prior to this commit, we hung in FINALIZED if it were invoked during
a COMM_SELF attribute destruction callback in FINALIZE.  See
https://github.com/open-mpi/ompi/issues/5084.

This commit converts the MPI_INITIALIZED / MPI_FINALIZED
infrastructure to use a single enum (ompi_mpi_state, set atomically)
to represent the state of MPI:

- not initialized
- init started
- init completed
- finalize started
- finalize past COMM_SELF destruction
- finalize completed

The "finalize past COMM_SELF destruction" state is what allows us to
return "false" from MPI_FINALIZED before COMM_SELF has been fully
destroyed / all attribute callbacks have been invoked.

Since this state is checked at nearly every MPI API call (to see if
we're outside of the INIT/FINALIZE epoch), care was taken to use
atomics to *set* the ompi_mpi_state value in ompi_mpi_init() and
ompi_mpi_finalize(), but performance-critical code paths can simply
read the variable without needing to use a slow call to an
opal_atomic_*() function.

Thanks to @AndrewGaspar for reporting the issue.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-06-01 13:36:29 -07:00
Gilles Gouaillardet
9f7586465d fortran/mpif-h: fix MPI1 compatibility Makefile
appends MPI1 compatible source files instead of redefining all the source files
fix a typo from open-mpi/ompi@89da9651bb

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-06-01 09:52:22 +09:00
Nathan Hjelm
b323655809 mpi: make C++ bindings compile when MPI-1 compat is disabled
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2018-05-31 09:44:19 -06:00
Nathan Hjelm
89da9651bb ompi: disable functions removed from MPI-3.0 by default
This commit adds a new configure option: --enable-mpi1-compat. Without
this option we will no longer provide APIs, typedefs, and defines that
were removed from the standard in MPI-3.0. This option will exist for
one major release (Open MPI v4.x.x) and then the option and associated
code will be removed in Open MPI v5.x.x. Open MPI has already
internally prepared for this change. Please prepare your codes
accordingly.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2018-05-31 09:44:19 -06:00
Kurita, Takehiro
11ae771b82 java: Improve descriptions of javadoc
- Improve descriptions
- Fix some typos
- Remove MPI-1 functions and replace them with MPI-2 functions

Signed-off-by: Kurita, Takehiro <fj6370fp@aa.jp.fujitsu.com>
2018-05-31 15:02:35 +09:00
Jeff Squyres
9f21ea437c java: clean up MPI Java configury
The Java configury is split into two parts:

1. Determine if we want MPI Java bindings.
2. Find the Java compiler (and related).

This commit does a few things:

- Move the "Find the Java compiler" step from OPAL to OMPI (because
  there is no Java in OPAL, and there doesn't appear to be any
  immanent danger that there will be).
  - As a direct consequence, remove the --enable-java CLI option
    (--enable-mpi-java still remains).  Enabling the MPI Java bindings
    and enabling Java are now considered the same thing (since there
    is no Java elsewhere in the code base, the different was
    meaningless).
- Only invoke the "Find the Java compiler" step if we actually want
  the MPI Java bindings.
- A few miscellaneous Java-related cleanups in configury (E.g., change
  testing "$foo" == "1" to $foo -eq 1, etc.

This commit is mostly s/opal/ompi/gi in many places in configury and
shifting code around.  But it looks bigger than it actually is because
of two reasons:

1. Some files were renamed:
   * ompi_setup_java.m4 -> ompi_setup_mpi_java.m4 (setup MPI Java bindings)
   * opal_setup_java.m4 -> ompi_setup_java.m4 (setup Java compiler)
2. Indenting level changed in (the new) ompi_setup_java.m4.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-05-15 15:15:22 -07:00
Themos Tsikas
4d126c16fa mpi/fortran: use conformant dummy names for Fortran bindings
The MPI spec defines that the "mpi" and "mpi_f08" module Fortran
bindings support passing by parameters by name.  Hence, we need to use
the MPI-spec-defined parameter names ("dummy variables", in Fortran
parlance) for the "mpi" and "mpi_f08" modules.

Specifically, Fortran allows calls to procedures to be written with
keyword arguments, e.g., "call mpi_sizeof(x=x,size=rsize,ierror=ier)"
An "explicit interface" for the procedure must be in scope for this to
be allowed in a Fortran program unit.  Therefore, the explicit
interface blocks we provide in the "mpi" and "mpi_f08" modules must
match the MPI published standard, including the names of the dummy
variables (i.e., parameter names), as that is how Fortran programs may
call them.

Note that we didn't find this issue previously because even though the
MPI spec *allows* for name-based parameter passing, not many people
actually use it.  I suspect that we might have some more incorrect
parameter names -- we should probably do a full "mpi" / "mpi_f08"
module parameter name audit someday.

Thanks to Themos Tsikas for reporting the issue and supplying the
initial fix.

Signed-off-by: themos.tsikas@nag.co.uk
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-05-02 09:42:19 +09:00
Jeff Squyres
72f2c3befe
Merge pull request #5121 from blegat/bl/cartcreatebracket
Remove brackets for ndims for c++ doc of Cart_create
2018-05-01 13:37:14 -04:00
Nathan Hjelm
bfd8ee7d57
Merge pull request #4898 from bosilca/topic/dist_graph
Allow MPI_PROC_NULL as neighbor.
2018-05-01 09:55:27 -06:00
Benoît Legat
709c4f6646 Remove brackets for ndims for c++ doc of Cart_create
Signed-off-by: Benoît Legat <benoit.legat@gmail.com>
2018-05-01 12:00:55 +02:00
Jeff Squyres
5bd02f6649 fortran/tkr: Fix Makefile.am warnings
Set mpi.lo dependencies outside of AM conditionals.  Per
https://github.com/open-mpi/ompi/issues/5085, make mpi.lo depend on
whatever we decide the sizeof source files are (which may be empty, if
this compiler does not support the Right Stuff for MPI_SIZEOF, or it
may be mpi-tkr-sizeof.[h|f90]).

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-04-25 10:24:01 -07:00
Gilles Gouaillardet
2abeada060 fortran: build MPI_Sizeof() interface in use-mpi-tkr bindings
whenever possible.

Add the missing OMPI_FORTRAN_BUILD_SIZEOF macro to Fortran
and add a missing dependency.

Thanks Themos Tsikas for reporting this issue.

Refs open-mpi/ompi#5085

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-04-25 15:09:33 +09:00
KAWASHIMA Takahiro
5e12e0f2e5
Merge pull request #5001 from ggouaillardet/topic/javah
configury: use javac vs javah whenever possible.
2018-04-06 11:30:20 +09:00
Jeff Squyres
fc8ebbb0e0 MPI_Comm_spawn_multiple.3in: update Fortran string array notes
Per 0ab6b201fe, note in the MPI_Comm_spawn_multiple.3in man page that
the array_of_commands does not need to be terminated -- it just need
to have exactly "count" entries.  In the Fortran binding, at least,
this is different than in prior released versions of Open MPI (it's
not a backwards incompatibility, since prior versions of Open MPI
required array_of_commands to be blank-string-terminated in Fortran --
this change makes Open MPI be *less* restrictive, and therefore still
backwards compatible).

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-04-05 06:52:46 -07:00
Jeff Squyres
0ab6b201fe mpi/fortran: fix parsing arrays of Fortran strings
MPI defines the "argv" param to Fortran MPI_COMM_SPAWN as being
terminated by a blank string.  While not precisely defined (except
through a non-binding example, Example 10.2, MPI-3.1 p382:6-29), one
can infer that the "array_of_argv" param to Fortran
MPI_COMM_SPAWN_MULTIPLE is also a set of argv, each of which are
terminated by a blank line.

The "array_of_commands" argument to Fortran MPI_COMM_SPAWN_MULTIPLE is
a little less well-defined.  It is *assumed* to be of length "count"
(another parameter to MPI_COMM_SPAWN_MULTIPLE) -- and *not* be
terminated by a blank string.  This is also given credence by the same
example 10.2 in MPI-3.1.

The previous code assumed that "array_of_commands" should also be
terminated by a blank line -- but per the above, this is incorrect.
Instead, we should just parse our "count" number of strings from
"array_of_commands" and *not* look for a blank line termination.

This commit separates these two cases:

* ompi_fortran_argv_blank_f2c(): parse a Fortran array of strings out
  and stop when reaching a blank string.
* ompi_fortran_argv_count_f2c(): parse a Fortran array of strings out
  and stop when "count" number of strings have been parsed.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-04-04 18:56:44 -07:00
Gilles Gouaillardet
5370586d98 configury: use javac vs javah whenever possible
javah is no more available from Java 10, so try
javac -h first (available since Java 8) and fallback on javah

Refs. open-mpi/ompi#5000

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-04-05 10:37:35 +09:00
Gilles Gouaillardet
132ea1a6b0 java: cleanup the list of automatically generated header files
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-04-05 09:27:34 +09:00
Jeff Squyres
dca66b9775 comm_join: fix CID 1323170
Enusre that the port name is always NULL-terminated.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-03-26 14:21:21 -07:00
Nathan Hjelm
1c75aa82fc use-mpi-f08: fix rma function signatures
The various RMA functions need to have the asynchronous property on
all buffers. This property was missing and some buffers were
incorrectly marked as intent(in). This commit fixes the function
signatures.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2018-03-26 15:11:07 -06:00
Jeff Squyres
c3adcb05eb Miscellaneous compiler warnings fixes
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2018-03-23 11:45:30 -07:00
bosilca
bf3dd8af19
Merge pull request #4884 from bosilca/topic/fix_wtime
Improve the range and accuracy of MPI_Wtime.
2018-03-16 14:09:33 +09:00
Benoît Legat
00600c7cbb Fix typo in MPI_Cart_shift doc
Signed-off-by: Benoît Legat <benoit.legat@gmail.com>
2018-03-13 15:25:42 +01:00
George Bosilca
0f0c27a184
Allow MPI_PROC_NULL as neighbor.
Allowing MPI_PROC_NULL as a neighbor in any topology allows us to add
gaps on the send and recv buffers. This does make the traditional
neighbor collective have a similar behavior as the V version, but in
same time it allows the users to skip the step where they prepare the
counts and the displacement array.

For more info please take a look at issue #4675.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
2018-03-09 12:20:26 +09:00
George Bosilca
9bced03213
Improve the range and accuracy of MPI_Wtime.
As discussed on https://github.com/mpi-forum/mpi-issues/issues/77#issuecomment-369663119
the conversion to double in the MPI_Wtime decrease the range
and accuracy of the resulting timer. By setting the timer to
0 at the first usage we basically maintain the accuracy for
194 days even for gettimeofday.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
2018-03-08 14:26:02 +09:00
Nathan Hjelm
5ed2fc2d48 mca/base: add support for additional variable types
This commit adds long, int32_t, uint32_t, int64_t, and uint64_t as
possible MCA variable types.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2018-03-01 20:42:27 -07:00
Gilles Gouaillardet
cb5dfbe5b1 man: fix indentation of MPI_Comm_spawn[_multiple]
no code change.

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-01-15 11:29:15 +09:00
Jeff Squyres
1c5664fdec
Merge pull request #4681 from nathanweeks/issue/f08_mpi_errcodes_ignore
Fix type of mpi_f08 MPI_ERRCODES_IGNORE
2018-01-10 12:34:16 -05:00
Gilles Gouaillardet
02f8215b25 ompi: enhance MPI_File_set_view datatype check.
Per MPI 3.1 chapter 13.3 :
"Derived etypes can be constructed by using any of the MPI
datatype constructor routines, provided all resulting typemap
displacements are non-negative and monotonically nondecreasing."
Same restriction applies to ftypes.

add the OMPI_DATATYPE_CHECK_FOR_VIEW() macro that is
check the underlying opal_datatype_t is monotonic, on top
of all checks performed in OMPI_DATATYPE_CHECK_FOR_RECV().

Since checking monotoniciy is expensive, check is only performed
when needed, but the result is cached by ompi_datatype_is_monotonic().

Thanks Wei-keng Liao for the valuable feedback.
Thanks George for the guidance.

Refs. open-mpi/ompi#4682

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-01-09 18:05:15 +09:00
Nathan T. Weeks
3158d2c5ed Fix type of mpi_f08 MPI_ERRCODES_IGNORE
Signed-off-by: Nathan T. Weeks <weeks@iastate.edu>
2018-01-07 05:36:41 -08:00
KAWASHIMA Takahiro
710080be63
Merge pull request #4667 from kawashima-fj/pr/f08-pmpi
fortran: Fix PMPI interface bugs in mpi_f08 module
2018-01-05 03:45:10 -06:00
KAWASHIMA Takahiro
bd2fe9c324 fortran: Call PMPI from PMPI_Status_set_cancelled_f08
This is a bug which was forgotten to change in c08f97b030.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 15:53:12 +09:00
KAWASHIMA Takahiro
00e3c7a973 fortran: Align indentation
This change makes comparison of `mpi-f08-interfaces.F90` and
`pmpi-f08-interfaces.F90` easier.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 14:39:09 +09:00
KAWASHIMA Takahiro
056eb39b12 fortran: Correct type of info_used
It is incorrectly typed as `MPI_Comm` in only `pmpi` in 24f7bd327e.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 14:39:09 +09:00
KAWASHIMA Takahiro
0c3a534b32 fortran: Use C_PTR for buffer_addr
It was changed to use `C_PTR` in only `mpi` in fc69c0be24.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 14:39:09 +09:00
KAWASHIMA Takahiro
d4fc404dc6 fortran: Change PMPI_Aint_{add,diff} to functions.
They were incorrectly changed to subroutines in only `pmpi`
in 258d1aa160.

Strictly speaking, this change involves binary incompatibility.
But nobody used these subroutines and nobody will be affected because
these subroutines were useless (didn't return a calculated value).

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 14:39:09 +09:00
KAWASHIMA Takahiro
9240967b8f fortran: Remove ASYNCHRONOUS from mpi_f08 pmpi
It was removed from only `mpi` as a bug fix in db41d749c1.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2017-12-26 14:39:09 +09:00
Tsubasa Yanagibashi
3f4b373856 Add missing Fortran 2008 binding subroutines
added missing Fortran 2008 binding pmpi_{*} subroutines to Open MPI.

Signed-off-by: Tsubasa Yanagibashi <fj2505dt@aa.jp.fujitsu.com>
2017-12-22 13:45:53 +09:00
Jed Brown
533800070e MPI_Attr_get: doc fix: MPI_Comm_create_attr -> MPI_Comm_get_attr
MPI_Comm_create_attr does not exist.

Signed-off-by: Jed Brown <jed@jedbrown.org>
2017-12-17 07:44:22 -07:00
Gilles Gouaillardet
794cc09d3e mpiext: fix path to Fortran 2008 modules
OMPI_FORTRAN_USEMPIF08_MOD macro was removed in open-mpi/ompi@791bcee6c0
so this macro is now manually expanded to mpi/fortran/use-mpi-f08/mod

Thanks to Nathan T. Weeks for reporting

Refs open-mpi/ompi#3605

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-12-11 11:02:43 +09:00
Gilles Gouaillardet
b8e77ba759 mpi/c: use OPAL_THREAD[UN]LOCK() instead of opal_mutex_[un]lock()
in order to keep consistency between ompi_communicator_t, ompi_file_t
and ompi_win_t.

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-12-01 16:06:32 +09:00
Gilles Gouaillardet
5f1a967351 ompi/file: rename ompi_file_t's f_mutex into f_lock
in order to use a consistent name between ompi_file_t,
ompi_win_t and ompi_communicator_t

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-12-01 16:06:22 +09:00
Gilles Gouaillardet
f1778d2778 communicator: remove the USE_MUTEX_FOR_COMMS macro
It should have always been #define'd in order to correctly handle the
multi-threaded case.

Also fix indentation in ompi/mpi/c/comm_get_errhandler.c

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-11-30 14:29:11 +09:00
Gilles Gouaillardet
7c3e675479 fix communicator's c_lock usage
- initialize c_lock in the ompi_communicator_t constructor
 - USE_OPAL_THREAD_[UN]LOCK(c_lock)
 - #ifdef USE_MUTEX_FOR_COMMS protect c_lock access

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-11-30 14:27:59 +09:00
Nathan Hjelm
6b68d1cfc8 ompi/errhandler: make set/get actually thread safe
The current versions of these functions have a fatal flaw. If a
errhandler set and free call is made by another thread while the
thread calling get is between the cmpset and retain then we will
retain an invalid object. Fixing this by just using locking. This is
not a critical path so this should be ok.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2017-11-27 15:14:17 -07:00
Nathan Hjelm
3ff34af355 opal: rename opal_atomic_cmpset* to opal_atomic_bool_cmpset*
This commit renames the atomic compare-and-swap functions to indicate
the return value. This is in preperation for adding support for a
compare-and-swap that returns the old value. At the same time the
return type has been changed to bool.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2017-10-31 12:47:23 -06:00
George Bosilca
bdbea63a1c
Update the MPI standard reference.
Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
2017-10-03 16:48:50 -04:00
Gilles Gouaillardet
b9315edb85 configury: remove the --disable-mpi-io option
Fixes open-mpi/ompi#2185

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-09-20 14:39:09 +09:00
Gilles Gouaillardet
ecb6b81a05 mpi: correctly handle MPI_IN_PLACE by memchecker in neighborhood collectives
MPI_IN_PLACE is not a valid send buffer for neighborhood collectives, so do not
invoke memchecker in this case.

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2017-09-04 11:21:32 +09:00