@@ -123,13 +123,13 @@ qv_scope_nobjs(
123
123
qv_context_t *ctx,
124
124
qv_scope_t *scope,
125
125
qv_hw_obj_type_t obj,
126
- int *n
126
+ int *nobjs
127
127
) {
128
- if (!ctx || !scope || !n ) {
128
+ if (!ctx || !scope || !nobjs ) {
129
129
return QV_ERR_INVLD_ARG;
130
130
}
131
131
132
- return qvi_scope_nobjs (scope, obj, n );
132
+ return qvi_scope_nobjs (scope, obj, nobjs );
133
133
}
134
134
135
135
int
@@ -191,25 +191,23 @@ qv_scope_barrier(
191
191
return qvi_scope_barrier (scope);
192
192
}
193
193
194
+ // TODO(skg) Add Fortran interface.
194
195
int
195
- qv_scope_split (
196
+ qv_scope_create (
196
197
qv_context_t *ctx,
197
198
qv_scope_t *scope,
198
- int npieces,
199
- int color,
199
+ qv_hw_obj_type_t type,
200
+ int nobjs,
201
+ qv_scope_create_hint_t hint,
200
202
qv_scope_t **subscope
201
203
) {
202
- if (!ctx || !scope || (npieces <= 0 ) | !subscope) {
204
+ if (!ctx || !scope || (nobjs < 0 ) | | !subscope) {
203
205
return QV_ERR_INVLD_ARG;
204
206
}
205
207
206
208
qv_scope_t *isubscope = nullptr ;
207
- // We use the sentinel value QV_HW_OBJ_LAST to differentiate between calls
208
- // from split() and split_at(). Since this call doesn't have a hardware type
209
- // argument, we use QV_HW_OBJ_LAST as the hardware type.
210
- int rc = qvi_scope_split (
211
- scope, npieces, color,
212
- QV_HW_OBJ_LAST, &isubscope
209
+ int rc = qvi_scope_create (
210
+ scope, type, nobjs, hint, &isubscope
213
211
);
214
212
if (rc != QV_SUCCESS) {
215
213
qvi_scope_free (&isubscope);
@@ -219,20 +217,24 @@ qv_scope_split(
219
217
}
220
218
221
219
int
222
- qv_scope_split_at (
220
+ qv_scope_split (
223
221
qv_context_t *ctx,
224
222
qv_scope_t *scope,
225
- qv_hw_obj_type_t type ,
226
- int group_id ,
223
+ int npieces ,
224
+ int color ,
227
225
qv_scope_t **subscope
228
226
) {
229
- if (!ctx || !scope || !subscope) {
227
+ if (!ctx || !scope || (npieces <= 0 ) | !subscope) {
230
228
return QV_ERR_INVLD_ARG;
231
229
}
232
230
233
231
qv_scope_t *isubscope = nullptr ;
234
- int rc = qvi_scope_split_at (
235
- scope, type, group_id, &isubscope
232
+ // We use the sentinel value QV_HW_OBJ_LAST to differentiate between calls
233
+ // from split() and split_at(). Since this call doesn't have a hardware type
234
+ // argument, we use QV_HW_OBJ_LAST as the hardware type.
235
+ int rc = qvi_scope_split (
236
+ scope, npieces, color,
237
+ QV_HW_OBJ_LAST, &isubscope
236
238
);
237
239
if (rc != QV_SUCCESS) {
238
240
qvi_scope_free (&isubscope);
@@ -241,23 +243,21 @@ qv_scope_split_at(
241
243
return rc;
242
244
}
243
245
244
- // TODO(skg) Add Fortran interface.
245
246
int
246
- qv_scope_create (
247
+ qv_scope_split_at (
247
248
qv_context_t *ctx,
248
249
qv_scope_t *scope,
249
250
qv_hw_obj_type_t type,
250
- int nobjs,
251
- qv_scope_create_hint_t hint,
251
+ int group_id,
252
252
qv_scope_t **subscope
253
253
) {
254
- if (!ctx || !scope || (nobjs < 0 ) || !subscope) {
254
+ if (!ctx || !scope || !subscope) {
255
255
return QV_ERR_INVLD_ARG;
256
256
}
257
257
258
258
qv_scope_t *isubscope = nullptr ;
259
- int rc = qvi_scope_create (
260
- scope, type, nobjs, hint , &isubscope
259
+ int rc = qvi_scope_split_at (
260
+ scope, type, group_id , &isubscope
261
261
);
262
262
if (rc != QV_SUCCESS) {
263
263
qvi_scope_free (&isubscope);
0 commit comments