Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 5220bcb

Browse files
authored
Merge pull request #987 from edgargabriel/pr/fcoll-dynamic_gen2
fcoll/dynamic_gen2: add new component
2 parents f1b9a5d + bdd70ec commit 5220bcb

File tree

8 files changed

+3091
-0
lines changed

8 files changed

+3091
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2005 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
14+
# $COPYRIGHT$
15+
#
16+
# Additional copyrights may follow
17+
#
18+
# $HEADER$
19+
#
20+
21+
sources = \
22+
fcoll_dynamic_gen2.h \
23+
fcoll_dynamic_gen2_module.c \
24+
fcoll_dynamic_gen2_component.c \
25+
fcoll_dynamic_gen2_file_read_all.c \
26+
fcoll_dynamic_gen2_file_write_all.c
27+
28+
# Make the output library in this directory, and name it either
29+
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
30+
# (for static builds).
31+
32+
if MCA_BUILD_ompi_fcoll_dynamic_gen2_DSO
33+
component_noinst =
34+
component_install = mca_fcoll_dynamic_gen2.la
35+
else
36+
component_noinst = libmca_fcoll_dynamic_gen2.la
37+
component_install =
38+
endif
39+
40+
mcacomponentdir = $(ompilibdir)
41+
mcacomponent_LTLIBRARIES = $(component_install)
42+
mca_fcoll_dynamic_gen2_la_SOURCES = $(sources)
43+
mca_fcoll_dynamic_gen2_la_LDFLAGS = -module -avoid-version
44+
45+
noinst_LTLIBRARIES = $(component_noinst)
46+
libmca_fcoll_dynamic_gen2_la_SOURCES =$(sources)
47+
libmca_fcoll_dynamic_gen2_la_LDFLAGS = -module -avoid-version
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2006 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* $COPYRIGHT$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#ifndef MCA_FCOLL_DYNAMIC_EXPORT_H
23+
#define MCA_FCOLL_DYNAMIC_EXPORT_H
24+
25+
#include "ompi_config.h"
26+
27+
#include "mpi.h"
28+
#include "ompi/mca/mca.h"
29+
#include "ompi/mca/fcoll/fcoll.h"
30+
#include "ompi/mca/fcoll/base/base.h"
31+
#include "ompi/mca/io/ompio/io_ompio.h"
32+
33+
BEGIN_C_DECLS
34+
35+
/* Globally exported variables */
36+
37+
extern int mca_fcoll_dynamic_gen2_priority;
38+
extern int mca_fcoll_dynamic_gen2_num_groups;
39+
extern int mca_fcoll_dynamic_gen2_write_chunksize;
40+
41+
OMPI_MODULE_DECLSPEC extern mca_fcoll_base_component_2_0_0_t mca_fcoll_dynamic_gen2_component;
42+
43+
/* API functions */
44+
45+
int mca_fcoll_dynamic_gen2_component_init_query(bool enable_progress_threads,
46+
bool enable_mpi_threads);
47+
struct mca_fcoll_base_module_1_0_0_t *
48+
mca_fcoll_dynamic_gen2_component_file_query (mca_io_ompio_file_t *fh, int *priority);
49+
50+
int mca_fcoll_dynamic_gen2_component_file_unquery (mca_io_ompio_file_t *file);
51+
52+
int mca_fcoll_dynamic_gen2_module_init (mca_io_ompio_file_t *file);
53+
int mca_fcoll_dynamic_gen2_module_finalize (mca_io_ompio_file_t *file);
54+
55+
int mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh,
56+
void *buf,
57+
int count,
58+
struct ompi_datatype_t *datatype,
59+
ompi_status_public_t * status);
60+
61+
62+
int mca_fcoll_dynamic_gen2_file_write_all (mca_io_ompio_file_t *fh,
63+
const void *buf,
64+
int count,
65+
struct ompi_datatype_t *datatype,
66+
ompi_status_public_t * status);
67+
68+
69+
END_C_DECLS
70+
71+
#endif /* MCA_FCOLL_DYNAMIC_EXPORT_H */
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2005 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
15+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
16+
* reserved.
17+
* $COPYRIGHT$
18+
*
19+
* Additional copyrights may follow
20+
*
21+
* $HEADER$
22+
*
23+
* These symbols are in a file by themselves to provide nice linker
24+
* semantics. Since linkers generally pull in symbols by object
25+
* files, keeping these symbols as the only symbols in this file
26+
* prevents utility programs such as "ompi_info" from having to import
27+
* entire components just to query their version and parameters.
28+
*/
29+
30+
#include "ompi_config.h"
31+
#include "fcoll_dynamic_gen2.h"
32+
#include "mpi.h"
33+
34+
/*
35+
* Public string showing the fcoll ompi_dynamic_gen2 component version number
36+
*/
37+
const char *mca_fcoll_dynamic_gen2_component_version_string =
38+
"Open MPI dynamic_gen2 collective MCA component version " OMPI_VERSION;
39+
40+
/*
41+
* Global variables
42+
*/
43+
int mca_fcoll_dynamic_gen2_priority = 10;
44+
int mca_fcoll_dynamic_gen2_num_groups = 1;
45+
int mca_fcoll_dynamic_gen2_write_chunksize = -1;
46+
47+
/*
48+
* Local function
49+
*/
50+
static int dynamic_gen2_register(void);
51+
52+
/*
53+
* Instantiate the public struct with all of our public information
54+
* and pointers to our public functions in it
55+
*/
56+
mca_fcoll_base_component_2_0_0_t mca_fcoll_dynamic_gen2_component = {
57+
58+
/* First, the mca_component_t struct containing meta information
59+
* about the component itself */
60+
61+
.fcollm_version = {
62+
MCA_FCOLL_BASE_VERSION_2_0_0,
63+
64+
/* Component name and version */
65+
.mca_component_name = "dynamic_gen2",
66+
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
67+
OMPI_RELEASE_VERSION),
68+
.mca_register_component_params = dynamic_gen2_register,
69+
},
70+
.fcollm_data = {
71+
/* The component is checkpoint ready */
72+
MCA_BASE_METADATA_PARAM_CHECKPOINT
73+
},
74+
75+
.fcollm_init_query = mca_fcoll_dynamic_gen2_component_init_query,
76+
.fcollm_file_query = mca_fcoll_dynamic_gen2_component_file_query,
77+
.fcollm_file_unquery = mca_fcoll_dynamic_gen2_component_file_unquery,
78+
};
79+
80+
81+
static int
82+
dynamic_gen2_register(void)
83+
{
84+
mca_fcoll_dynamic_gen2_priority = 10;
85+
(void) mca_base_component_var_register(&mca_fcoll_dynamic_gen2_component.fcollm_version,
86+
"priority", "Priority of the dynamic_gen2 fcoll component",
87+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
88+
OPAL_INFO_LVL_9,
89+
MCA_BASE_VAR_SCOPE_READONLY, &mca_fcoll_dynamic_gen2_priority);
90+
91+
mca_fcoll_dynamic_gen2_num_groups = 1;
92+
(void) mca_base_component_var_register(&mca_fcoll_dynamic_gen2_component.fcollm_version,
93+
"num_groups", "Number of subgroups created by the dynamic_gen2 component",
94+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
95+
OPAL_INFO_LVL_9,
96+
MCA_BASE_VAR_SCOPE_READONLY, &mca_fcoll_dynamic_gen2_num_groups);
97+
98+
mca_fcoll_dynamic_gen2_write_chunksize = -1;
99+
(void) mca_base_component_var_register(&mca_fcoll_dynamic_gen2_component.fcollm_version,
100+
"write_chunksize", "Chunk size written at once. Default: stripe_size of the file system",
101+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
102+
OPAL_INFO_LVL_9,
103+
MCA_BASE_VAR_SCOPE_READONLY, &mca_fcoll_dynamic_gen2_write_chunksize);
104+
105+
return OMPI_SUCCESS;
106+
}

0 commit comments

Comments
 (0)