Skip to content

predefined MPI object padding: set to fixed number of bytes #3634

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions ompi/communicator/communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Inria. All rights reserved.
Expand Down Expand Up @@ -242,6 +242,15 @@ typedef struct ompi_communicator_t ompi_communicator_t;
* the ompi_communicator_t without impacting the size of the
* ompi_predefined_communicator_t structure for some number of additions.
*
* Note: we used to define the PAD as a multiple of sizeof(void*).
* However, this makes a different size PAD, depending on
* sizeof(void*). In some cases
* (https://github.com/open-mpi/ompi/issues/3610), 32 bit builds can
* run out of space when 64 bit builds are still ok. So we changed to
* use just a naked byte size. As a rule of thumb, however, the size
* should probably still be a multiple of 8 so that it has the
* possibility of being nicely aligned.
*
* As an example:
* If the size of ompi_communicator_t is less than the size of the _PAD then
* the _PAD ensures that the size of the ompi_predefined_communicator_t is
Expand All @@ -258,7 +267,7 @@ typedef struct ompi_communicator_t ompi_communicator_t;
* the PREDEFINED_COMMUNICATOR_PAD macro?
* A: Most likely not, but it would be good to check.
*/
#define PREDEFINED_COMMUNICATOR_PAD (sizeof(void*) * 64)
#define PREDEFINED_COMMUNICATOR_PAD 512

struct ompi_predefined_communicator_t {
struct ompi_communicator_t comm;
Expand Down
4 changes: 2 additions & 2 deletions ompi/datatype/ompi_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
Expand Down Expand Up @@ -95,7 +95,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_datatype_t);
/* Using set constant for padding of the DATATYPE handles because the size of
* base structure is very close to being the same no matter the bitness.
*/
#define PREDEFINED_DATATYPE_PAD (512)
#define PREDEFINED_DATATYPE_PAD 512

struct ompi_predefined_datatype_t {
struct ompi_datatype_t dt;
Expand Down
4 changes: 2 additions & 2 deletions ompi/file/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 University of Houston. All rights reserved.
Expand Down Expand Up @@ -103,7 +103,7 @@ typedef struct ompi_file_t ompi_file_t;
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_FILE_PAD (sizeof(void*) * 192)
#define PREDEFINED_FILE_PAD 1536

struct ompi_predefined_file_t {
struct ompi_file_t file;
Expand Down
4 changes: 2 additions & 2 deletions ompi/group/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
Expand Down Expand Up @@ -107,7 +107,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_group_t);
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_GROUP_PAD (sizeof(void*) * 32)
#define PREDEFINED_GROUP_PAD 256

struct ompi_predefined_group_t {
struct ompi_group_t group;
Expand Down
4 changes: 2 additions & 2 deletions ompi/info/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
Expand Down Expand Up @@ -55,7 +55,7 @@ typedef struct ompi_info_t ompi_info_t;
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_INFO_PAD (sizeof(void*) * 32)
#define PREDEFINED_INFO_PAD 256

struct ompi_predefined_info_t {
struct ompi_info_t info;
Expand Down
4 changes: 2 additions & 2 deletions ompi/message/message.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011-2012 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -38,7 +38,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_message_t);
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_MESSAGE_PAD (sizeof(void*) * 32)
#define PREDEFINED_MESSAGE_PAD 256

struct ompi_predefined_message_t {
struct ompi_message_t message;
Expand Down
4 changes: 2 additions & 2 deletions ompi/op/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 UT-Battelle, LLC
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
Expand Down Expand Up @@ -199,7 +199,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_op_t);
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_OP_PAD (sizeof(void*) * 256)
#define PREDEFINED_OP_PAD 2048

struct ompi_predefined_op_t {
struct ompi_op_t op;
Expand Down
4 changes: 2 additions & 2 deletions ompi/request/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
Expand Down Expand Up @@ -127,7 +127,7 @@ typedef struct ompi_request_t ompi_request_t;
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_REQUEST_PAD (sizeof(void*) * 32)
#define PREDEFINED_REQUEST_PAD 256

struct ompi_predefined_request_t {
struct ompi_request_t request;
Expand Down
4 changes: 2 additions & 2 deletions ompi/win/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
Expand Down Expand Up @@ -119,7 +119,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_win_t);
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
* for full explanation why we chose the following padding construct for predefines.
*/
#define PREDEFINED_WIN_PAD (sizeof(void*) * 64)
#define PREDEFINED_WIN_PAD 512

struct ompi_predefined_win_t {
struct ompi_win_t win;
Expand Down