Skip to content

Commit 6185a5f

Browse files
committed
Merge pull request open-mpi#770 from edgargabriel/pr/commits-of-week-47
Pr/commits of week 47
2 parents 473d06b + a9e6544 commit 6185a5f

File tree

5 files changed

+201
-184
lines changed

5 files changed

+201
-184
lines changed

config/ompi_check_lustre.m4

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,30 @@ AC_DEFUN([OMPI_CHECK_LUSTRE],[
6161
[$ompi_check_lustre_dir], [$ompi_check_lustre_libdir], [ompi_check_lustre_happy="yes"],
6262
[ompi_check_lustre_happy="no"])
6363

64+
AC_MSG_CHECKING([for required lustre data structures])
65+
cat > conftest.c <<EOF
66+
#include "lustre/liblustreapi.h"
67+
void alloc_lum()
68+
{
69+
int v1, v3;
70+
v1 = sizeof(struct lov_user_md_v1) +
71+
LOV_MAX_STRIPE_COUNT * sizeof(struct lov_user_ost_data_v1);
72+
v3 = sizeof(struct lov_user_md_v3) +
73+
LOV_MAX_STRIPE_COUNT * sizeof(struct lov_user_ost_data_v1);
74+
}
75+
EOF
76+
77+
# Try the compile
78+
OPAL_LOG_COMMAND(
79+
[$CC $CFLAGS -I$with_lustre/include -c conftest.c],
80+
[ompi_check_lustre_struct_happy="yes"],
81+
[ompi_check_lustre_struct_happy="no"
82+
ompi_check_lustre_happy="no"]
83+
)
84+
rm -f conftest.c conftest.o
85+
AC_MSG_RESULT([$ompi_check_lustre_struct_happy])
86+
87+
6488
AS_IF([test "$ompi_check_lustre_happy" = "yes"],
6589
[$2],
6690
[AS_IF([test ! -z "$with_lustre" && test "$with_lustre" != "no"],

ompi/mca/io/ompio/io_ompio.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,29 @@ int ompi_io_ompio_set_aggregator_props (struct mca_io_ompio_file_t *fh,
10311031
fh->f_flags |= OMPIO_AGGREGATOR_IS_SET;
10321032

10331033
if (-1 == num_aggregators) {
1034-
mca_io_ompio_create_groups(fh,bytes_per_proc);
1034+
if ( SIMPLE == mca_io_ompio_grouping_option ||
1035+
NO_REFINEMENT == mca_io_ompio_grouping_option ) {
1036+
fh->f_aggregator_index = 0;
1037+
fh->f_final_num_aggrs = fh->f_init_num_aggrs;
1038+
fh->f_procs_per_group = fh->f_init_procs_per_group;
1039+
1040+
fh->f_procs_in_group = (int*)malloc (fh->f_procs_per_group * sizeof(int));
1041+
if (NULL == fh->f_procs_in_group) {
1042+
opal_output (1, "OUT OF MEMORY\n");
1043+
return OMPI_ERR_OUT_OF_RESOURCE;
1044+
}
1045+
1046+
for (j=0 ; j<fh->f_procs_per_group ; j++) {
1047+
fh->f_procs_in_group[j] = fh->f_init_procs_in_group[j];
1048+
}
1049+
}
1050+
else {
1051+
mca_io_ompio_create_groups(fh,bytes_per_proc);
1052+
}
10351053
return OMPI_SUCCESS;
10361054
}
10371055

10381056
//Forced number of aggregators
1039-
else
1040-
{
10411057
/* calculate the offset at which each group of processes will start */
10421058
procs_per_group = ceil ((float)fh->f_size/num_aggregators);
10431059

@@ -1063,7 +1079,6 @@ int ompi_io_ompio_set_aggregator_props (struct mca_io_ompio_file_t *fh,
10631079
fh->f_final_num_aggrs = num_aggregators;
10641080

10651081
return OMPI_SUCCESS;
1066-
}
10671082
}
10681083

10691084

ompi/mca/io/ompio/io_ompio.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,22 @@ OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
101101
#define OMPIO_MERGE 1
102102
#define OMPIO_SPLIT 2
103103
#define OMPIO_RETAIN 3
104+
104105
#define DATA_VOLUME 1
105106
#define UNIFORM_DISTRIBUTION 2
106-
#define OMPIO_UNIFORM_DIST_THRESHOLD 0.5
107107
#define CONTIGUITY 3
108-
#define OMPIO_CONTG_THRESHOLD 1048576
109108
#define OPTIMIZE_GROUPING 4
110-
#define OMPIO_PROCS_PER_GROUP_TAG 0
111-
#define OMPIO_PROCS_IN_GROUP_TAG 1
112-
#define OMPIO_MERGE_THRESHOLD 0.5
109+
#define SIMPLE 5
110+
#define NO_REFINEMENT 6
111+
112+
113+
#define OMPIO_UNIFORM_DIST_THRESHOLD 0.5
114+
#define OMPIO_CONTG_THRESHOLD 1048576
115+
#define OMPIO_CONTG_FACTOR 8
116+
#define OMPIO_DEFAULT_STRIPE_SIZE 1048576
117+
#define OMPIO_PROCS_PER_GROUP_TAG 0
118+
#define OMPIO_PROCS_IN_GROUP_TAG 1
119+
#define OMPIO_MERGE_THRESHOLD 0.5
113120

114121
/*---------------------------*/
115122

@@ -543,6 +550,9 @@ int mca_io_ompio_cart_based_grouping(mca_io_ompio_file_t *ompio_fh);
543550
int mca_io_ompio_fview_based_grouping(mca_io_ompio_file_t *fh,
544551
int *num_groups,
545552
contg *contg_groups);
553+
int mca_io_ompio_simple_grouping(mca_io_ompio_file_t *fh,
554+
int *num_groups,
555+
contg *contg_groups);
546556

547557
int mca_io_ompio_finalize_initial_grouping(mca_io_ompio_file_t *fh,
548558
int num_groups,

ompi/mca/io/ompio/io_ompio_component.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int mca_io_ompio_record_offset_info = 0;
3838
int mca_io_ompio_coll_timing_info = 0;
3939
int mca_io_ompio_sharedfp_lazy_open = 1;
4040

41-
int mca_io_ompio_grouping_option=0;
41+
int mca_io_ompio_grouping_option=5;
4242

4343
/*
4444
* Private functions
@@ -202,10 +202,13 @@ static int register_component(void)
202202
MCA_BASE_VAR_SCOPE_READONLY,
203203
&mca_io_ompio_sharedfp_lazy_open);
204204

205-
mca_io_ompio_grouping_option = 0;
205+
mca_io_ompio_grouping_option = 5;
206206
(void) mca_base_component_var_register(&mca_io_ompio_component.io_version,
207207
"grouping_option",
208-
"Option for grouping of processes in the aggregator selection",
208+
"Option for grouping of processes in the aggregator selection "
209+
"1: Data volume based grouping 2: maximizing group size uniformity 3: maximimze "
210+
"data contiguity 4: hybrid optimization 5: simple (default) "
211+
"6: skip refinement step",
209212
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
210213
OPAL_INFO_LVL_9,
211214
MCA_BASE_VAR_SCOPE_READONLY,

0 commit comments

Comments
 (0)