Skip to content

Commit bc767cc

Browse files
author
alielabridi
committed
Revert "vectorization so far before moving to arrays"
This reverts commit 8d6dd44.
1 parent 02317cf commit bc767cc

File tree

5 files changed

+206
-341
lines changed

5 files changed

+206
-341
lines changed

AddSubMat.h

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,35 @@
44

55
class addition :public CBase_addition{
66
public:
7-
addition(CkMigrateMessage *m) {}
8-
addition(CkFuture f,AddSubMsg* Msg, int size){
9-
thisProxy.run(f,Msg,size);
7+
addition(CkMigrateMessage *m) {};
8+
addition(CkFuture f,std::vector<std::vector<int>> A, std::vector<std::vector<int>> B, int size){
9+
thisProxy.run(f,A,B,size);
1010
}
11-
void run(CkFuture f,AddSubMsg* Msg, int size){
11+
void run(CkFuture f,std::vector<std::vector<int>> A, std::vector<std::vector<int>> B, int size){
12+
//if(VERBOSE)CkPrintf("addition run 1:\n");
1213
/*wrap the resulting addition in a message of size and send it back to future*/
1314

1415
//if(VERBOSE)CkPrintf("Work done by processor %d\n",CkMyPe());
1516

17+
1618
ValueMsg *m = new ValueMsg(size);
1719

20+
21+
22+
//if(VERBOSE)CkPrintf("addition run 1-1:\n");
23+
1824
for (int i = 0; i < size; ++i)
1925
{
2026
for (int j = 0; j < size; ++j)
2127
{
22-
m->v[i][j] = Msg->A[i][j] + Msg->A[i][j];
28+
m->v[i][j] = A[i][j] + B[i][j];
2329
}
2430
}
31+
//if(VERBOSE)CkPrintf("addition run 2:\n");
32+
33+
34+
35+
//if(VERBOSE)CkPrintf("addition run 4:\n");
2536

2637
CkSendToFuture(f, m);
2738
}
@@ -31,11 +42,11 @@ class addition :public CBase_addition{
3142

3243
class substraction :public CBase_substraction{
3344
public:
34-
substraction(CkMigrateMessage *m) {}
35-
substraction(CkFuture f,AddSubMsg* Msg, int size){
36-
thisProxy.run(f,Msg,size);
45+
substraction(CkMigrateMessage *m) {};
46+
substraction(CkFuture f,std::vector<std::vector<int>> A, std::vector<std::vector<int>> B, int size){
47+
thisProxy.run(f,A,B,size);
3748
}
38-
void run(CkFuture f,AddSubMsg* Msg, int size){
49+
void run(CkFuture f,std::vector<std::vector<int>> A, std::vector<std::vector<int>> B, int size){
3950
//std::vector<std::vector<int>> C;
4051

4152
//if(VERBOSE)CkPrintf("Work done by processor %d\n",CkMyPe());
@@ -47,7 +58,7 @@ class substraction :public CBase_substraction{
4758
{
4859
for (int j = 0; j < size; ++j)
4960
{
50-
m->v[i][j] = Msg->A[i][j] - Msg->A[i][j];
61+
m->v[i][j] = A[i][j] - B[i][j];
5162
}
5263
}
5364
/*wrap the resulting substraction in a message of size and send it back to future*/

0 commit comments

Comments
 (0)