Skip to content

Commit 80bd9de

Browse files
authored
Merge pull request #13533 from mentOS31/op_fix_example_type
op/example fix warnings and error at compilation
2 parents 28d0458 + 28e27db commit 80bd9de

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

ompi/mca/op/example/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ do:
5656
- `op_example_component.c`: The main "component" source file.
5757
- `op_example_module.c`: The main "module" source file.
5858
- `op_example.h`: information that is shared between the `.c` files.
59-
- `.ompi_ignore`: the presence of this file causes OMPI's `autogen.pl`
59+
- `.opal_ignore`: the presence of this file causes OMPI's `autogen.pl`
6060
to skip this component in the configure/build/install process (see
6161
below).
6262

@@ -69,18 +69,18 @@ shell$ cp -r example foo
6969
shell$ cd foo
7070
```
7171

72-
Remove the `.ompi_ignore` file (which makes the component "visible" to
73-
all developers) *OR* add an `.ompi_unignore` file with one username per
72+
Remove the `.opal_ignore` file (which makes the component "visible" to
73+
all developers) *OR* add an `.opal_unignore` file with one username per
7474
line (as reported by `whoami`). OMPI's `autogen.pl` will skip any
75-
component with a `.ompi_ignore` file *unless* there is also an
76-
.ompi_unignore file containing your user ID in it. This is a handy
75+
component with a `.opal_ignore` file *unless* there is also an
76+
`.opal_unignore` file containing your user ID in it. This is a handy
7777
mechanism to have a component in the tree but have it not built / used
7878
by most other developers:
7979

8080
```
81-
shell$ rm .ompi_ignore
81+
shell$ rm .opal_ignore
8282
*OR*
83-
shell$ whoami > .ompi_unignore
83+
shell$ whoami > .opal_unignore
8484
```
8585

8686
Now rename any file that contains `example` in the filename to have

ompi/mca/op/example/op_example_component.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ static char *example_component_version;
123123
*/
124124
static int example_component_register(void)
125125
{
126-
int val;
127126
char *str;
128127

129128
opal_output(ompi_op_base_framework.framework_output, "example component register");

ompi/mca/op/example/op_example_module_bxor.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static OBJ_CLASS_INSTANCE(module_bxor_t,
109109
/**
110110
* Bxor function for C int
111111
*/
112-
static void bxor_int(void *in, void *out, int *count,
112+
static void bxor_int(const void *in, void *out, int *count,
113113
ompi_datatype_t **type, ompi_op_base_module_t *module)
114114
{
115115
module_bxor_t *m = (module_bxor_t*) module;
@@ -143,7 +143,7 @@ static void bxor_int(void *in, void *out, int *count,
143143
/**
144144
* Bxor function for C long
145145
*/
146-
static void bxor_long(void *in, void *out, int *count,
146+
static void bxor_long(const void *in, void *out, int *count,
147147
ompi_datatype_t **type, ompi_op_base_module_t *module)
148148
{
149149
module_bxor_t *m = (module_bxor_t*) module;
@@ -157,7 +157,7 @@ static void bxor_long(void *in, void *out, int *count,
157157
/**
158158
* Bxor function for Fortran INTEGER
159159
*/
160-
static void bxor_integer(void *in, void *out, int *count,
160+
static void bxor_integer(const void *in, void *out, int *count,
161161
ompi_datatype_t **type, ompi_op_base_module_t *module)
162162
{
163163
module_bxor_t *m = (module_bxor_t*) module;
@@ -191,10 +191,10 @@ ompi_op_base_module_t *ompi_op_example_setup_bxor(ompi_op_t *op)
191191
(i.e., they're already assigned on the op). */
192192

193193
/* C int */
194-
module->super.opm_fns[OMPI_OP_BASE_TYPE_INT] = bxor_int;
195-
module->fallback_int = op->o_func.intrinsic.fns[OMPI_OP_BASE_TYPE_INT];
194+
module->super.opm_fns[OMPI_OP_BASE_TYPE_INT32_T] = bxor_int;
195+
module->fallback_int = op->o_func.intrinsic.fns[OMPI_OP_BASE_TYPE_INT32_T];
196196
module->fallback_int_module =
197-
op->o_func.intrinsic.modules[OMPI_OP_BASE_TYPE_INT];
197+
op->o_func.intrinsic.modules[OMPI_OP_BASE_TYPE_INT32_T];
198198
/* If you cache a fallback function, you *must* RETAIN (i.e.,
199199
increase the refcount) its module so that the module knows that
200200
it is being used and won't be freed/destructed. */

ompi/mca/op/example/op_example_module_max.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static OBJ_CLASS_INSTANCE(module_max_t,
118118
/**
119119
* Max function for C float
120120
*/
121-
static void max_float(void *in, void *out, int *count,
121+
static void max_float(const void *in, void *out, int *count,
122122
ompi_datatype_t **type, ompi_op_base_module_t *module)
123123
{
124124
module_max_t *m = (module_max_t*) module;
@@ -152,7 +152,7 @@ static void max_float(void *in, void *out, int *count,
152152
/**
153153
* Max function for C double
154154
*/
155-
static void max_double(void *in, void *out, int *count,
155+
static void max_double(const void *in, void *out, int *count,
156156
ompi_datatype_t **type, ompi_op_base_module_t *module)
157157
{
158158
module_max_t *m = (module_max_t*) module;
@@ -166,7 +166,7 @@ static void max_double(void *in, void *out, int *count,
166166
/**
167167
* Max function for Fortran REAL
168168
*/
169-
static void max_real(void *in, void *out, int *count,
169+
static void max_real(const void *in, void *out, int *count,
170170
ompi_datatype_t **type, ompi_op_base_module_t *module)
171171
{
172172
module_max_t *m = (module_max_t*) module;
@@ -180,7 +180,7 @@ static void max_real(void *in, void *out, int *count,
180180
/**
181181
* Max function for Fortran DOUBLE PRECISION
182182
*/
183-
static void max_double_precision(void *in, void *out, int *count,
183+
static void max_double_precision(const void *in, void *out, int *count,
184184
ompi_datatype_t **type,
185185
ompi_op_base_module_t *module)
186186
{

0 commit comments

Comments
 (0)