Skip to content

Commit c638cfc

Browse files
author
Adriel Poo-Armas
committed
Initial part comm test
1 parent 5940bf3 commit c638cfc

18 files changed

+125
-206
lines changed

part-comm/.test_negPartError.c.swp

12 KB
Binary file not shown.

part-comm/test.c

Lines changed: 0 additions & 74 deletions
This file was deleted.

part-comm/test_commOrder0.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ double message [PARTITIONS * COUNT];
1919

2020
//MPI variable declarations
2121
int src = 0, dest = 1, tag = 100, flag = 0;
22-
int myrank, provided, len, i, j;
23-
char hostname[MPI_MAX_PROCESSOR_NAME];
22+
int myrank, provided, i, j;
2423
MPI_Count partitions = PARTITIONS;
2524
MPI_Request request;
2625

@@ -29,7 +28,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
2928
if (provided < MPI_THREAD_SERIALIZED)
3029
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3130
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
32-
MPI_Get_processor_name(hostname, &len);
3331

3432
if (myrank == 0)
3533
{

part-comm/test_commOrder1.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ int main (int argc, char *argv[])
1818
double message [PARTITIONS * COUNT];
1919

2020
//MPI variable declaration
21-
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0;
22-
int myrank, provided, len, i, j;
23-
char hostname[MPI_MAX_PROCESSOR_NAME];
21+
int src = 0, dest = 1, tag = 100, flag = 0;
22+
int myrank, provided, i, j;
2423
MPI_Count partitions = PARTITIONS;
2524
MPI_Request request;
2625

@@ -29,7 +28,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
2928
if (provided < MPI_THREAD_SERIALIZED)
3029
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3130
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
32-
MPI_Get_processor_name(hostname, &len);
3331

3432
if (myrank == 0)
3533
{

part-comm/test_commOrder2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ double message [PARTITIONS * COUNT];
1919

2020
//MPI variables declaration
2121
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0;
22-
int myrank, provided, len, i, j;
23-
char hostname[MPI_MAX_PROCESSOR_NAME];
22+
int myrank, provided, i, j;
2423
MPI_Count partitions = PARTITIONS;
2524
MPI_Request request;
2625

@@ -29,7 +28,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
2928
if (provided < MPI_THREAD_SERIALIZED)
3029
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3130
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
32-
MPI_Get_processor_name(hostname, &len);
3331

3432
if (myrank == 0)
3533
{

part-comm/test_commOrder3.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ double message [PARTITIONS * COUNT];
2222

2323
//MPI variables declarations
2424
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0;
25-
int myrank, provided, len, timer, trigger, i, j;
26-
char hostname[MPI_MAX_PROCESSOR_NAME];
25+
int myrank, provided, timer, trigger, i, j;
2726
MPI_Count partitions = PARTITIONS;
2827
MPI_Request request;
2928

@@ -32,7 +31,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
3231
if (provided < MPI_THREAD_SERIALIZED)
3332
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3433
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
35-
MPI_Get_processor_name(hostname, &len);
3634

3735
if (myrank == 0)
3836
{

part-comm/test_negPartError.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ MPI_Count partitions = 0 - PARTITIONS;
2222

2323
//MPI variables declarations
2424
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0;
25-
int myrank, provided, len, i, j;
26-
char hostname[MPI_MAX_PROCESSOR_NAME];
25+
int myrank, provided, i, j;
2726
MPI_Request request;
2827

2928
//Initializing threaded MPI
3029
MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
3130
if (provided < MPI_THREAD_SERIALIZED)
3231
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3332
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
34-
MPI_Get_processor_name(hostname, &len);
3533

3634
if (myrank == 0)
3735
{
@@ -69,7 +67,7 @@ else if (myrank == 1)
6967
//Test the buffer to check that the message was recieved correctly
7068
for (i = 0; i < (PARTITIONS * COUNT); i++)
7169
{
72-
assert(message[i] = (i+1));
70+
assert(message[i] == (i+1));
7371
}
7472
printf("Test Passed Succesfully\n");
7573
MPI_Request_free(&request);

part-comm/test_nullBuff.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ double message [PARTITIONS * COUNT];
1919

2020
//MPI variables declarations
2121
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0;
22-
int myrank, provided, len, i, j;
23-
char hostname[MPI_MAX_PROCESSOR_NAME];
22+
int myrank, provided, i, j;
2423
MPI_Count partitions = PARTITIONS;
2524
MPI_Request request;
2625

@@ -29,7 +28,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
2928
if (provided < MPI_THREAD_SERIALIZED)
3029
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3130
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
32-
MPI_Get_processor_name(hostname, &len);
3331

3432
if (myrank == 0)
3533
{

part-comm/test_parrived.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ double message [PARTITIONS * COUNT];
2424

2525
//MPI variables declarations
2626
int src = 0, dest = 1, tag = 100, flag = 0, flag2 = 0, counter = 0 ;
27-
int myrank, provided, len, timer, trigger, i, j;
28-
char hostname[MPI_MAX_PROCESSOR_NAME];
27+
int myrank, provided, timer, trigger, i, j;
2928
MPI_Count partitions = PARTITIONS;
3029
MPI_Request request;
3130

@@ -34,7 +33,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
3433
if (provided < MPI_THREAD_SERIALIZED)
3534
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3635
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
37-
MPI_Get_processor_name(hostname, &len);
3836

3937
if (myrank == 0)
4038
{

part-comm/test_partComm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ double message [PARTITIONS * COUNT];
1818

1919
//MPI variables declarations
2020
int src = 0, dest = 1, tag = 100, flag = 0;
21-
int myrank, provided, len, i, j;
22-
char hostname[MPI_MAX_PROCESSOR_NAME];
21+
int myrank, provided, i, j;
2322
MPI_Count partitions = PARTITIONS;
2423
MPI_Request request;
2524

@@ -28,7 +27,6 @@ MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
2827
if (provided < MPI_THREAD_SERIALIZED)
2928
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
3029
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
31-
MPI_Get_processor_name(hostname, &len);
3230

3331
if (myrank == 0)
3432
{

0 commit comments

Comments
 (0)