1. 26 Nov, 2014 1 commit
  2. 12 Nov, 2014 1 commit
    • Wesley Bland's avatar
      Change errflag to be an enum · 3850e6bf
      Wesley Bland authored
      The errflag value being used in the MPIC helper functions only
      propagated whether or not an error occurred. It did not contain any
      information about what kind of error occurred, which made returning the
      correct error code after a process failure impossible.
      This patch converts the binary value to an enum with three options:
      The original use of TRUE and false maps to MPIR_ERR_NONE and
      MPIR_ERR_PROC_FAILED indicates that the error occurred
      because of a process failure. It uses the new bit set aside from the tag
      space to track such information between processes.
      This change required modifying lots of function signatures and type
      declarations to use the new enum type, but these are actually not very
      intrusive changes and shouldn't be a problem going forward.
      Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
  3. 20 Oct, 2014 1 commit
  4. 03 Oct, 2014 1 commit
    • Igor Ivanov's avatar
      mpi/comm: Fix MPI_Intercomm_merge · 051449e7
      Igor Ivanov authored and Pavan Balaji's avatar Pavan Balaji committed
      Previous code is based on a trick to get true context id using
      invalid communicator. There is a call of MPIR_Get_contextid()
      for new communicator that is not completelly built (no comm_commit
      and comm_hook calls).
      netmod/mxm uses comm_hook and can not work with this trick.
      This changes allow to avoid call of invalid communicator using
      temporary (intermediate) communicator.
      Signed-off-by: default avatarIgor Ivanov <Igor.Ivanov@itseez.com>
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
  5. 03 Sep, 2014 1 commit
    • Huiwei Lu's avatar
      Fixes deadlock in multi-threaded MPI_Comm_idup · 0eeed17d
      Huiwei Lu authored
      This patch implements the "eager" protocol used in MPI_Comm_idup.
      Without this patch, test/mpi/threads/comm/comm_idup will crash due to
      segmentation fault caused by livelock.
      It uses the same algorithm as multi-threaded
      MPIR_Get_contextid_sparse_group to avoid deadlock in multi-threaded
      context_id allocation, but in a nonblocking way. The nonblocking
      mechanism is explained in the comment of function
      Fixes #2069
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
  6. 25 Aug, 2014 1 commit
    • Huiwei Lu's avatar
      Adds a canceling case for barrier_smp_intra · 07e6da06
      Huiwei Lu authored
      barrier_smp_intra completes the barrier in two steps, first for intra
      smp nodes, then for inter smp nodes. It uses an additional node_comm
      for intra smp barrier.
      This node_comm should also be cancelled inside MPIDI_CH3U_Clean_recvq
      when communicator is revoked.
      Signed-off-by: default avatarWesley Bland <wbland@anl.gov>
  7. 31 Jul, 2014 5 commits
    • Wesley Bland's avatar
      Change MPID_Comm_valid_ptr to optionally ignore revoke · 05cb62bd
      Wesley Bland authored
      Adds a parameter to MPID_Comm_valid_ptr to take a second parameter that will
      either cause the macro to ignore the revoke flag or not.
      Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
    • Wesley Bland's avatar
      Add MPIX_Comm_agree · 1f0ee136
      Wesley Bland authored
      Adds function implementing an agreement algorithm for the user. This function
      lets the user manually perform an agreement as well as detect unacknowledged
      Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
    • Wesley Bland's avatar
      Add MPIX_Comm_shrink functionality · 5be10ce9
      Wesley Bland authored
      This adds a new function MPIX_COMM_SHRINK. This is a communicator creation
      function that creates a new communicator based on a previous communicator, but
      excluding any failed processes.
      As part of the operation, the shrink call needs to perform an agreement to
      determine the group of failed processes. This is done using the algorithm
      published by Hursey et al. in his EuroMPI '12 paper.
      The list of failed processes is collected using a bit array. This happens via
      a few new functions in the CH3 layer to create and send a bitarry to the
      master process and receive an updated bitarray. Obviously, this is not a very
      scalable implementation yet, but something better can easily be plugged in
      here to replace the naïve implementation. This is also a use case for an
      MPI_Recv_reduce for future reference.
      Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
    • Wesley Bland's avatar
      Add MPI_Comm_revoke · 57f6ee88
      Wesley Bland authored
      MPI_Comm_revoke is a special function because it does not have a matching call
      on the "receiving side". This is because it has to act as an out-of-band,
      resilient broadcast algorithm. Because of this, in this commit, in addition to
      the usual functions to implement MPI communication calls (MPI/MPID/CH3/etc.),
      we add a new CH3 packet type that will handle revoking a communicator without
      involving a matching call from the MPI layer (similar to how RMA is currently
      The thing that must be handled most carefully when revoking a communicator is
      to ensure that a previously used context ID will eventually be returned to the
      pool of available context IDs and that after this occurs, no old messages will
      match the new usage of the context ID (for instance, if some messages are very
      slow and show up late). To accomplish this, revoke is implemented as an
      all-to-all algorithm. When one process calls revoke, it will send a message to
      all other processes in the communicator, which will trigger that process to
      send a message to all other processes, and so on. Once a process has already
      revoked its communicator locally, it won't send out another wave of messages.
      As each process receives the revoke messages from the other processes, it will
      track how many messages have been received. Once it has either received a
      revoke message or a message about a process failure for each other process, it
      will release its refcount on the communicator object. After the application
      has freed all of its references to the communicator (and all requests, files,
      etc. associated with it), the context ID will be returned to the available
      Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
    • Wesley Bland's avatar
      Add MPIX_Comm_failure_ack/get_acked · 8652e0ad
      Wesley Bland authored
      This commit adds the new functions MPI(X)_COMM_FAILURE_ACK and
      MPI(X)_COMM_FAILURE_GET_ACKED. These two functions together allow the user to
      get the group of failed processes.
      Most of the implementation for this is pushed into the MPID layer since some
      systems won't support this (PAMI). The existing function
      MPIDI_CH3U_Check_for_failed_procs has been modified to give back the group of
      acknowledged failed processes. There is an inefficiency here in that the list
      of failed processes is retrieved from PMI and parsed every time the user calls
      both failure_ack and get_acked, but this means we don't have to try to cache
      the list that comes back from PMI (which could potentially be expensive, but
      would have some cost even in the failure-free case).
      This commit adds a failed to the MPID_Comm structure. There is now a field
      called last_ack_rank. This is a single integer that stores the last
      acknowledged failure for this communicator which is used to determine when to
      stop parsing when getting back the list of acknowledged failed processes.
      Lastly, this commit includes a test to make sure that all of the above works
      (test/mpi/ft/failure_ack). This tests that a failure is appropriately included
      in the failed group and excluded if the failure was not previously
      Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
  8. 30 Jul, 2014 1 commit
  9. 07 Jul, 2014 1 commit
  10. 17 Jun, 2014 1 commit
    • Huiwei Lu's avatar
      Clean up MPI_Comm_idup code for '--enable-threads=single' case. · eb8837de
      Huiwei Lu authored and Pavan Balaji's avatar Pavan Balaji committed
      This patch clean the code for the MPI_Comm_idup single-threaded case to
      use the same code of the multi-threaded case. In order to do this, three
      variables are made visible to both single-threaded and multi-threaded
      case: mask_in_use, lowestContextId and lowestTag.
      Also, before this patch, #1935 has been fixed for multi-threaded case
      but will still fail for single-threaded case. After this patch, the
      single-threaded case will be fixed.
      Here is a history of related changes: The patch [05eeccb5] fixed
      MPI_Comm_idup for multi-threaded case, but forgot to fix the
      single-threaded case. A temporary patch [18de1dbe
      ] is used to revert
      the single-threaded case to use old code before multi-thread patch.
      The current patch fixes the second patch.
      See also #1935.
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
  11. 03 Jun, 2014 1 commit
  12. 31 May, 2014 1 commit
    • Huiwei Lu's avatar
      Fixes MPI_Comm_idup · 05eeccb5
      Huiwei Lu authored
      This patch fixes two related tickets:
      1. MPI_Comm_idup in multithreaded environments
      2. MPI_Comm_idup fails to create multiple communicators
      Because these two tickets are tightly coupled, so they are fixed in this
      single patch.
      The original code did not consider the multithreaded case and did not
      use progress engine in correct order when saving a copy of global mask
      to local thread.
      Following changes were made to implement the MPI_Comm_idup correctly:
      1. It shares the same global flag 'mask_in_use' with other communicator
      functions to protect access to context_mask. And use CONTEXTID lock to
      protext critical sections.
      2. It uses the same algorithm as multithreaded MPI_Comm_dup
      (multi-threaded vertion of MPIR_Get_contextid_sparse_group) to allocate
      a context id, but in a nonblocking way. In the case of conflicts, the
      algorithm needs to retry the allocation process again. In the
      nonblocking algorithm, 1) new entries are inserted to the end of
      schedule to replace the 'while' loop in MPI_Comm_dup algorithm; 2) all
      arguments passed to sched_get_cid_nonblock are saved to gcn_state in
      order to be called in the future; 3) in sched_cb_gcn_allocate_cid, if
      the first try failed, it will insert sched_cb_gcn_copy_mask to the
      schedule again.
      3. There is a subtle difference between INTRACOMM and INTERCOMM when
      duplicating a communicator.  They needed to be treated differently in
      current algorithm. Specifically, 1) when calling sched_get_cid_nonblock,
      the parameters are different; 2) updating newcommp->recvcontext_id in
      MPIR_Get_intercomm_contextid_nonblock has been moved to
      sched_cb_gcn_bcast because this should happen after
      sched_cb_gcn_allocate_cid has succeed.
      Fixes #1935
      Fixes #1913
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
  13. 14 Apr, 2014 1 commit
    • Kenneth Raffenetti's avatar
      correct validation of MPI_Info handle · 59afcee7
      Kenneth Raffenetti authored
      MPIR_ERRTEST_ARGNULL is incorrect for validating an MPI_Info
      handle, since MPI_INFO_NULL is not defined as 0. This updates the
      test in MPI_Comm_set_info to match the one in MPI_Win_set_info.
      Patch originally from thakur@mcs.anl.gov
  14. 01 Apr, 2014 2 commits
    • Pavan Balaji's avatar
      Move symbols to correct libraries. · 9c337914
      Pavan Balaji authored and Kenneth Raffenetti's avatar Kenneth Raffenetti committed
      Maintain a list of files that go into each library.  If a particular
      binding is not enabled, the list variable still exists, but will just
      be empty.  This simplifies the management of which files/symbols go
      into which library.
      Move all MPI_ symbols to the libmpi library and all other symbols to
      the libpmpi library.  All Fortran 77 symbols go into libmpif77.so,
      while C symbols go into libmpi.so.  There are some exceptions, such as
      status_f2c, which are handled by the Fortran code but used in C.  Our
      Fortran 90 build only creates a few symbols and uses the f77 symbols
      for everything else.  These few symbols go into libmpifort.so.
      Also update compiler wrappers to link to correct libraries.  mpif77
      should now link with libmpif77.  mpif90 links with both libmpifort and
      libmpif77, since our F90 build still keeps the core Fortran library
      symbols in libf77.
      We completely ignored the F77 library earlier.  This was OK because
      all of the Fortran symbols were ending up in libmpi.  Now that we have
      separated out the symbols to the right library, we now need to link to
      libmpif77 as well.
      Also added inter-library dependencies.
      libmpi has a dependency on several internal libraries: libmpl, libopa.
      libmpicxx did not have a dependency on libmpi, added.
      libmpif77 did not have a dependency on libmpi, added.
      libmpifort did not have a dependency on libmpi, added.
      This dependency model is sufficient for C and F77, but not for C++ and
      F90.  The C and F77 libraries contain all the symbols the application
      relies on, but the F90 and C++ libraries don't.  In the case of F90,
      symbols such as mpi_bcast are missing and are borrowed from the F77
      library.  In the case of C++, mpicxx.h contains calls directly to C
      functions (such as MPI_Reduce_local), which get embedded into the
      Fixes #2023.
      Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
    • Pavan Balaji's avatar
      Incorrect placement of the MPIR_Comm_split_type_impl symbol. · 0ab70e76
      Pavan Balaji authored and Kenneth Raffenetti's avatar Kenneth Raffenetti committed
      This symbol should go into libmpich, not libpmpich.
      Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
  15. 26 Feb, 2014 1 commit
  16. 10 Feb, 2014 1 commit
    • Pavan Balaji's avatar
      Remove overly conservative assertion. · 16005083
      Pavan Balaji authored
      MPI_COMM_IDUP currently just asserts out when we use it in
      multithreaded mode.  This is overly conservative.  MPI_COMM_IDUP works
      fine in such modes unless it is executed concurrently with another
      routine that also tries to allocate or free a context ID.  Removing
      this assertion till we find a more appropriate way of tracking this
      Fixes #2020.
      Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
  17. 19 Dec, 2013 1 commit
  18. 27 Nov, 2013 3 commits
  19. 26 Oct, 2013 1 commit
  20. 25 Jul, 2013 2 commits
    • Wesley Bland's avatar
      Rename MPIC_Sendrecv_ft to MPIC_Sendrecv · e98feb06
      Wesley Bland authored and Pavan Balaji's avatar Pavan Balaji committed
      The FT functions are now the default (only) way to call the collective
      helper functions. This is one of a few patches to migrate all uses to no
      longer use the MPIC_*_ft naming scheme.Rename MPIC_Send_ft to MPIC_Send
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
    • Wesley Bland's avatar
      Move MPIC_* usage over to MPIC_*_ft functions. · 34d594d4
      Wesley Bland authored and Pavan Balaji's avatar Pavan Balaji committed
      All usages of the non-ft versions have moved over to use the ft versions
      to avoid the need to maintain both and to ensure that we provide some
      ability to provide ft everywhere. There are times where this isn't
      necessary or useful and in those cases, the value of *errflag can be
      ignored and just the return value can be checked to see if the function
      was successful or not.
      The MPIC_* functions that have an ft mirror
      (e.g. MPIC_Send -> MPIC_Send_ft) are no longer accessible outside of
      helper_fns.c. Now the MPIC_*_ft functions should be called directly.
      Note that this is not going to be a long lived policy. Instead, the
      MPIC_*_ft functions will be merged with the standard MPIC_* functions
      and will replace them.
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
  21. 03 Jul, 2013 1 commit
    • Wesley Bland's avatar
      Fixes #1868. · f92fcb3c
      Wesley Bland authored
      Bill found some misuse of MPIR_ERR_RECOVERABLE and few other error
      messages and wrote a test in autogen.sh to discover/report them. This
      fixes the errors raised by that test and re-enables it at autogen time.
      Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
  22. 15 May, 2013 1 commit
    • Pavan Balaji's avatar
      Naming updates to IBM's NBC patch. · 57f5b7b1
      Pavan Balaji authored
      We now provide two types of function pointers: _sched and _req.  The
      _sched functions just add instructions to the schedule, but no request
      is created.  The _req functions return an MPID request.
      Reviewed by Mike Blocksome @ IBM.
  23. 09 May, 2013 1 commit
  24. 22 Apr, 2013 1 commit
  25. 12 Apr, 2013 1 commit
  26. 07 Apr, 2013 4 commits
  27. 05 Apr, 2013 1 commit
  28. 01 Apr, 2013 1 commit
    • Ralf Gunter's avatar
      Add info hint support to communicators. · 9bb89788
      Ralf Gunter authored
      Communicators now accept info hints both at creation time
      (`MPI_Comm_dup_with_info`) as well as at any later point in their
      life cycle (`MPI_Comm_set_info`).
      Hints are stored in a hash table, and may be added by defining a
      function of type
        int fun(MPID_Comm *, MPID_Info *, void *)
      which applies the hint to the communicator, and then registered with
      MPICH via the function `MPIR_Comm_register_hint_fn`. The third
      (optional) argument can be used to pass extra data to the handler, such
      as local context from when it was registered with the runtime.
      Reviewed-by: goodell
  29. 21 Feb, 2013 1 commit
    • James Dinan's avatar
      Added missing thread safety to Comm_compare · 1f189709
      James Dinan authored
      This function was missing thread safety CS_ENTER/EXIT locks.  The global
      lock is necessary for this function because it accesses multiple parts
      of the comm object, calls several internal routines that assume the
      global lock is held, and upates the ref counts on the groups of each
      Reported by Steve Oyanagi @ Cray.  This closes ticket #1796.
      Reviewer: goodell