@@ -46,13 +46,24 @@ opal_pointer_array_t ompi_mpi_windows = {{0}};
4646ompi_predefined_win_t ompi_mpi_win_null = {{{0 }}};
4747ompi_predefined_win_t * ompi_mpi_win_null_addr = & ompi_mpi_win_null ;
4848mca_base_var_enum_t * ompi_win_accumulate_ops = NULL ;
49+ mca_base_var_enum_t * ompi_win_accumulate_order = NULL ;
4950
5051static mca_base_var_enum_value_t accumulate_ops_values [] = {
5152 {.value = OMPI_WIN_ACCUMULATE_OPS_SAME_OP_NO_OP , .string = "same_op_no_op" ,},
5253 {.value = OMPI_WIN_ACCUMULATE_OPS_SAME_OP , .string = "same_op" ,},
5354 {.value = -1 , .string = NULL },
5455};
5556
57+ static mca_base_var_enum_value_flag_t accumulate_order_flags [] = {
58+ {.flag = OMPI_WIN_ACC_ORDER_NONE , .string = "none" , .conflicting_flag = OMPI_WIN_ACC_ORDER_RAR |
59+ OMPI_WIN_ACC_ORDER_WAR | OMPI_WIN_ACC_ORDER_RAW | OMPI_WIN_ACC_ORDER_WAW },
60+ {.flag = OMPI_WIN_ACC_ORDER_RAR , .string = "rar" , .conflicting_flag = OMPI_WIN_ACC_ORDER_NONE },
61+ {.flag = OMPI_WIN_ACC_ORDER_WAR , .string = "war" , .conflicting_flag = OMPI_WIN_ACC_ORDER_NONE },
62+ {.flag = OMPI_WIN_ACC_ORDER_RAW , .string = "raw" , .conflicting_flag = OMPI_WIN_ACC_ORDER_NONE },
63+ {.flag = OMPI_WIN_ACC_ORDER_WAW , .string = "waw" , .conflicting_flag = OMPI_WIN_ACC_ORDER_NONE },
64+ {},
65+ };
66+
5667static void ompi_win_construct (ompi_win_t * win );
5768static void ompi_win_destruct (ompi_win_t * win );
5869
@@ -86,6 +97,11 @@ ompi_win_init(void)
8697 return ret ;
8798 }
8899
100+ ret = mca_base_var_enum_create_flag ("accumulate_order" , accumulate_order_flags , & ompi_win_accumulate_order );
101+ if (OPAL_SUCCESS != ret ) {
102+ return ret ;
103+ }
104+
89105 return OMPI_SUCCESS ;
90106}
91107
@@ -115,6 +131,7 @@ int ompi_win_finalize(void)
115131 OBJ_DESTRUCT (& ompi_mpi_win_null .win );
116132 OBJ_DESTRUCT (& ompi_mpi_windows );
117133 OBJ_RELEASE (ompi_win_accumulate_ops );
134+ OBJ_RELEASE (ompi_win_accumulate_order );
118135
119136 return OMPI_SUCCESS ;
120137}
@@ -123,7 +140,7 @@ static int alloc_window(struct ompi_communicator_t *comm, ompi_info_t *info, int
123140{
124141 ompi_win_t * win ;
125142 ompi_group_t * group ;
126- int acc_ops , flag , ret ;
143+ int acc_ops , acc_order , flag , ret ;
127144
128145 /* create the object */
129146 win = OBJ_NEW (ompi_win_t );
@@ -140,6 +157,18 @@ static int alloc_window(struct ompi_communicator_t *comm, ompi_info_t *info, int
140157 }
141158
142159 win -> w_acc_ops = (ompi_win_accumulate_ops_t )acc_ops ;
160+
161+ ret = ompi_info_get_value_enum (info , "accumulate_order" , & acc_order ,
162+ OMPI_WIN_ACC_ORDER_RAR | OMPI_WIN_ACC_ORDER_WAR |
163+ OMPI_WIN_ACC_ORDER_RAW | OMPI_WIN_ACC_ORDER_WAW ,
164+ ompi_win_accumulate_order , & flag );
165+ if (OMPI_SUCCESS != ret ) {
166+ OBJ_RELEASE (win );
167+ return ret ;
168+ }
169+
170+ win -> w_acc_order = acc_order ;
171+
143172 win -> w_flavor = flavor ;
144173
145174 /* setup data that is independent of osc component */
0 commit comments