Skip to content

Commit

Permalink
Merge pull request openucx#12 from zheng871026/huawei
Browse files Browse the repository at this point in the history
fix cleancode
  • Loading branch information
nsosnsos authored Dec 3, 2020
2 parents 95e68fe + a78ecf4 commit 6b6feb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion builtin/ops/builtin_cb.inl
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ ucg_builtin_init_state(ucg_builtin_op_step_t *step, int is_pack,

step->bcopy.unpack_state.dt.generic.state = state_gen;
}
// TODO: re-use ucp_request_send_state_init()+ucp_request_send_state_reset()
}

static UCS_F_ALWAYS_INLINE void
Expand Down
4 changes: 4 additions & 0 deletions builtin/ops/builtin_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ ucg_builtin_step_get_gen_dt_length(ucg_builtin_op_step_t *step,
int count)
{
/* need to generate a one-time state to figure out the packed size */
if (count == 0) {
return 0;
}
ucp_dt_generic_t *dt_gen = ucp_dt_generic(datatype);
ucg_builtin_init_state(step, 1, dt_gen, params);
size_t len = dt_gen->ops.packed_size(step->bcopy.pack_state.dt.generic.state) / count;
Expand All @@ -976,6 +979,7 @@ ucs_status_t ucg_builtin_step_create(ucg_builtin_plan_phase_t *phase,
ucs_status_t status;
/* Set the parameters determining the send-flags later on */
int is_send_contig = UCP_DT_IS_CONTIG(send_dtype);
int is_recv_contig = UCP_DT_IS_CONTIG(recv_dtype);
size_t dt_len = is_send_contig ? params->send.dt_len :
ucg_builtin_step_get_gen_dt_length(step, send_dtype, params, params->send.count);
step->buffer_length = dt_len * params->send.count;
Expand Down

0 comments on commit 6b6feb2

Please sign in to comment.