initialize "me" before using it.
This commit is contained in:
@ -208,11 +208,11 @@ TEST_F(FileOperationsTest, read_lines_from_file)
|
|||||||
MPI_Comm world = MPI_COMM_WORLD;
|
MPI_Comm world = MPI_COMM_WORLD;
|
||||||
int me, rv;
|
int me, rv;
|
||||||
memset(buf, 0, MAX_BUF_SIZE);
|
memset(buf, 0, MAX_BUF_SIZE);
|
||||||
|
MPI_Comm_rank(world, &me);
|
||||||
|
|
||||||
rv = utils::read_lines_from_file(nullptr, 1, MAX_BUF_SIZE, buf, me, world);
|
rv = utils::read_lines_from_file(nullptr, 1, MAX_BUF_SIZE, buf, me, world);
|
||||||
ASSERT_EQ(rv, 1);
|
ASSERT_EQ(rv, 1);
|
||||||
|
|
||||||
MPI_Comm_rank(world, &me);
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
fp = fopen("safe_file_read_test.txt", "r");
|
fp = fopen("safe_file_read_test.txt", "r");
|
||||||
ASSERT_NE(fp, nullptr);
|
ASSERT_NE(fp, nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user