Skip to content

Commit

Permalink
Use 1-based indices consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbuurlage committed May 24, 2021
1 parent 959be0c commit ec2783d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/cannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
// |_ _|
//
// Then we can write for the block C_ij :
// C_ij = Sum_(k = 1)^N A_ik B_kj
// C_ij = \sum_{k = 1}^N A_ik B_kj
//
// The idea of Cannon's algorithm is to let processor (s, t) compute block
// C_st. If that processor starts with blocks A_(s, (s + t) % N) and B_((s + t)
// % N,t), then initially each processor has a unique block assigned. After
// each iteration a processor sends its A-block to the processor 'to the right'
// (i.e. at ((s + 1) % N, t)) and the B-block down. After N iterations, each
// processor has computed C_ij, so that the result is available distributed
// over the processors.
// C_st. If that processor starts with blocks A_(1 + s, 1 + (s + t) % N) and
// B_(1 + (s + t) % N, t), then initially each processor has a unique block
// assigned. After each iteration a processor sends its A-block to the
// processor 'to the right' (i.e. at ((s + 1) % N, t)) and similarly sends its
// B-block down. After N iterations, each processor has computed C_ij, so that
// the result is available distributed over the processors.

#include <cassert>
#include <random>
Expand Down

0 comments on commit ec2783d

Please sign in to comment.