1
1

shmem: use C99 struct initialization

Use .member=foo initialization for the shmem framework and components
and modules.
Этот коммит содержится в:
Jeff Squyres 2015-02-26 13:59:15 -08:00
родитель 3fd8dc099d
Коммит 62259a74f5
7 изменённых файлов: 69 добавлений и 100 удалений

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Los Alamos National Security, LLC. * Copyright (c) 2010-2011 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -57,37 +57,27 @@ static int mmap_runtime_query(mca_base_module_t **module,
* and pointers to our public functions in it * and pointers to our public functions in it
*/ */
opal_shmem_mmap_component_t mca_shmem_mmap_component = { opal_shmem_mmap_component_t mca_shmem_mmap_component = {
/* ////////////////////////////////////////////////////////////////////// */ .super = {
/* super */ .base_version = {
/* ////////////////////////////////////////////////////////////////////// */
{
/**
* common MCA component data
*/
{
OPAL_SHMEM_BASE_VERSION_2_0_0, OPAL_SHMEM_BASE_VERSION_2_0_0,
/* component name and version */ /* component name and version */
"mmap", .mca_component_name = "mmap",
OPAL_MAJOR_VERSION, .mca_component_major_version = OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION, .mca_component_minor_version = OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION, .mca_component_release_version = OPAL_RELEASE_VERSION,
/* component open */ .mca_open_component = mmap_open,
mmap_open, .mca_close_component = mmap_close,
/* component close */ .mca_query_component = mmap_query,
mmap_close, .mca_register_component_params = mmap_register,
/* component query */
mmap_query,
/* component register */
mmap_register
}, },
/* MCA v2.0.0 component meta data */ /* MCA v2.0.0 component meta data */
{ .base_data = {
/* the component is checkpoint ready */ /* the component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT MCA_BASE_METADATA_PARAM_CHECKPOINT
}, },
mmap_runtime_query, .runtime_query = mmap_runtime_query,
}, },
}; };

Просмотреть файл

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2010-2014 Los Alamos National Security, LLC. * Copyright (c) 2010-2014 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
@ -100,15 +100,14 @@ enough_space(const char *filename,
* mmap shmem module * mmap shmem module
*/ */
opal_shmem_mmap_module_t opal_shmem_mmap_module = { opal_shmem_mmap_module_t opal_shmem_mmap_module = {
/* super */ .super = {
{ .module_init = module_init,
module_init, .segment_create = segment_create,
segment_create, .ds_copy = ds_copy,
ds_copy, .segment_attach = segment_attach,
segment_attach, .segment_detach = segment_detach,
segment_detach, .unlink = segment_unlink,
segment_unlink, .module_finalize = module_finalize
module_finalize
} }
}; };

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Los Alamos National Security, LLC. * Copyright (c) 2010-2011 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
@ -70,38 +70,27 @@ static bool rt_successful = false;
* and pointers to our public functions in it * and pointers to our public functions in it
*/ */
opal_shmem_posix_component_t mca_shmem_posix_component = { opal_shmem_posix_component_t mca_shmem_posix_component = {
/* ////////////////////////////////////////////////////////////////////// */ .super = {
/* super */ .base_version = {
/* ////////////////////////////////////////////////////////////////////// */
{
/* common MCA component data */
{
OPAL_SHMEM_BASE_VERSION_2_0_0, OPAL_SHMEM_BASE_VERSION_2_0_0,
/* component name and version */ /* component name and version */
"posix", .mca_component_name = "posix",
OPAL_MAJOR_VERSION, .mca_component_major_version = OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION, .mca_component_minor_version = OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION, .mca_component_release_version = OPAL_RELEASE_VERSION,
/* component open */ .mca_open_component = posix_open,
posix_open, .mca_query_component = posix_query,
/* component close */ .mca_register_component_params = posix_register
NULL,
/* component query */
posix_query,
posix_register
}, },
/* MCA v2.0.0 component meta data */ /* MCA v2.0.0 component meta data */
{ .base_data = {
/* the component is checkpoint ready */ /* the component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT MCA_BASE_METADATA_PARAM_CHECKPOINT
}, },
posix_runtime_query, .runtime_query = posix_runtime_query,
}, },
/* ////////////////////////////////////////////////////////////////////// */
/* posix component-specific information */
/* see: shmem_posix.h for more information */
}; };

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Los Alamos National Security, LLC. * Copyright (c) 2010-2012 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
@ -90,15 +90,14 @@ module_finalize(void);
/* posix shmem module */ /* posix shmem module */
opal_shmem_posix_module_t opal_shmem_posix_module = { opal_shmem_posix_module_t opal_shmem_posix_module = {
/* super */ .super = {
{ .module_init = module_init,
module_init, .segment_create = segment_create,
segment_create, .ds_copy = ds_copy,
ds_copy, .segment_attach = segment_attach,
segment_attach, .segment_detach = segment_detach,
segment_detach, .unlink = segment_unlink,
segment_unlink, .module_finalize = module_finalize
module_finalize
} }
}; };

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved.
* Copyright (c) 2010-2011 Los Alamos National Security, LLC. * Copyright (c) 2010-2011 Los Alamos National Security, LLC.
@ -180,9 +180,12 @@ typedef struct opal_shmem_base_module_2_0_0_t opal_shmem_base_module_t;
* macro for use in components that are of type shmem * macro for use in components that are of type shmem
* see: opal/mca/mca.h for more information * see: opal/mca/mca.h for more information
*/ */
#define OPAL_SHMEM_BASE_VERSION_2_0_0 \ #define OPAL_SHMEM_BASE_VERSION_2_0_0 \
MCA_BASE_VERSION_2_0_0, \ MCA_BASE_VERSION_2_0_0, \
"shmem", 2, 0, 0 .mca_type_name = "shmem", \
.mca_type_major_version = 2, \
.mca_type_minor_version = 0, \
.mca_type_release_version = 0
END_C_DECLS END_C_DECLS

Просмотреть файл

@ -74,38 +74,28 @@ static int sysv_runtime_query(mca_base_module_t **module,
* and pointers to our public functions in it * and pointers to our public functions in it
*/ */
opal_shmem_sysv_component_t mca_shmem_sysv_component = { opal_shmem_sysv_component_t mca_shmem_sysv_component = {
/* ////////////////////////////////////////////////////////////////////// */ .super = {
/* super */
/* ////////////////////////////////////////////////////////////////////// */
{
/* common MCA component data */ /* common MCA component data */
{ {
OPAL_SHMEM_BASE_VERSION_2_0_0, OPAL_SHMEM_BASE_VERSION_2_0_0,
/* component name and version */ /* component name and version */
"sysv", .mca_component_name = "sysv",
OPAL_MAJOR_VERSION, .mca_component_major_version = OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION, .mca_component_minor_version = OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION, .mca_component_release_version = OPAL_RELEASE_VERSION,
/* component open */ .mca_open_component = sysv_open,
sysv_open, .mca_query_component = sysv_query,
/* component close */ .mca_register_component_params = sysv_register
NULL,
/* component query */
sysv_query,
sysv_register
}, },
/* MCA v2.0.0 component meta data */ /* MCA v2.0.0 component meta data */
{ .base_data = {
/* the component is checkpoint ready */ /* the component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT MCA_BASE_METADATA_PARAM_CHECKPOINT
}, },
sysv_runtime_query, .runtime_query = sysv_runtime_query,
}, },
/* ////////////////////////////////////////////////////////////////////// */
/* sysv component-specific information */
/* see: shmem_sysv.h for more information */
}; };
/* ////////////////////////////////////////////////////////////////////////// */ /* ////////////////////////////////////////////////////////////////////////// */

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Los Alamos National Security, LLC. * Copyright (c) 2010-2012 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
@ -92,15 +92,14 @@ module_finalize(void);
/* sysv shmem module */ /* sysv shmem module */
opal_shmem_sysv_module_t opal_shmem_sysv_module = { opal_shmem_sysv_module_t opal_shmem_sysv_module = {
/* super */ .super = {
{ .module_init = module_init,
module_init, .segment_create = segment_create,
segment_create, .ds_copy = ds_copy,
ds_copy, .segment_attach = segment_attach,
segment_attach, .segment_detach = segment_detach,
segment_detach, .unlink = segment_unlink,
segment_unlink, .module_finalize = module_finalize
module_finalize
} }
}; };