@@ -47,6 +47,15 @@ int mca_fs_lustre_priority = 20;
4747int mca_fs_lustre_stripe_size = 0 ;
4848int mca_fs_lustre_stripe_width = 0 ;
4949int mca_fs_lustre_lock_algorithm = 0 ; /* auto */
50+
51+ static const mca_base_var_enum_value_t ompi_fs_lustre_lock_algorithm_modes [] = {
52+ {.value = 0 , .string = "auto" },
53+ {.value = 1 , .string = "skip locking" },
54+ {.value = 2 , .string = "always lock entire file" },
55+ {.value = 3 , .string = "lock specific ranges" },
56+ {.string = NULL },
57+ };
58+
5059/*
5160 * Instantiate the public struct with all of our public information
5261 * and pointers to our public functions in it
@@ -77,6 +86,8 @@ mca_fs_base_component_2_0_0_t mca_fs_lustre_component = {
7786static int
7887lustre_register (void )
7988{
89+ mca_base_var_enum_t * new_enum ;
90+
8091 mca_fs_lustre_priority = 20 ;
8192 (void ) mca_base_component_var_register (& mca_fs_lustre_component .fsm_version ,
8293 "priority" , "Priority of the lustre fs component" ,
@@ -95,15 +106,18 @@ lustre_register(void)
95106 MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
96107 OPAL_INFO_LVL_9 ,
97108 MCA_BASE_VAR_SCOPE_READONLY , & mca_fs_lustre_stripe_width );
109+
110+ (void ) mca_base_var_enum_create ("mca_fs_lustre_lock_algorithm" , ompi_fs_lustre_lock_algorithm_modes , & new_enum );
111+
98112 mca_fs_lustre_lock_algorithm = 0 ;
99113 (void ) mca_base_component_var_register (& mca_fs_lustre_component .fsm_version ,
100- "lock_algorithm" , "Locking algorithm used by the fs ufs component. "
101- " 0: auto (default), 1: skip locking, 2: always lock entire file, "
102- "3: lock only specific ranges" ,
103- MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
114+ "lock_algorithm" , "Locking algorithm used by the fs lustre component. "
115+ "(default: auto)" ,
116+ MCA_BASE_VAR_TYPE_INT , new_enum , 0 , 0 ,
104117 OPAL_INFO_LVL_9 ,
105118 MCA_BASE_VAR_SCOPE_READONLY ,
106- & mca_fs_lustre_lock_algorithm );
119+ & mca_fs_lustre_lock_algorithm );
120+ OBJ_RELEASE (new_enum );
107121
108122 return OMPI_SUCCESS ;
109123}
0 commit comments