remove unnecessary

This commit is contained in:
kai
2025-06-01 14:39:52 +02:00
parent 637b87a472
commit 18d577f504
2 changed files with 17 additions and 17 deletions

View File

@@ -156,25 +156,25 @@ int main(int argc, char *argv[]) {
// Result is saved to file.
// Use this to graphically verify the correctness of the parallel
// implementation.
runSerial(n, eps, maxNumIter);
// runSerial(n, eps, maxNumIter);
runParallel(n, eps, maxNumIter);
// runParallel(n, eps, maxNumIter);
// Run the benchmark
// double serialTime = 0;
// double parallelTime = 0;
double serialTime = 0;
double parallelTime = 0;
// serialTime = serialBenchmark(n, eps, maxNumIter);
// parallelTime = parallelBenchmark(n, eps, maxNumIter);
//
// if (rank == 0) {
// //std::cout << "Serial time: " << serialTime << "ms" << std::endl;
// std::cout << "Serial time: ms" << std::endl;
// std::cout << "Parallel time: " << parallelTime << "ms" << std::endl;
// //std::cout << "Speedup: " << serialTime / parallelTime << std::endl;
// std::ofstream fout("benchmark.txt", std::ios::app);
// fout << numProc << "\t" << parallelTime << "\n";
// }
serialTime = serialBenchmark(n, eps, maxNumIter);
parallelTime = parallelBenchmark(n, eps, maxNumIter);
if (rank == 0) {
// std::cout << "Serial time: " << serialTime << "ms" << std::endl;
std::cout << "Serial time: ms" << std::endl;
std::cout << "Parallel time: " << parallelTime << "ms" << std::endl;
// std::cout << "Speedup: " << serialTime / parallelTime << std::endl;
std::ofstream fout("benchmark.txt", std::ios::app);
fout << numProc << "\t" << parallelTime << "\n";
}
MPI_Finalize();
}

View File

@@ -20,7 +20,7 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon,
int rank, numProc;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &numProc);
std::cout << "rank: " << rank << std::endl;
// std::cout << "rank: " << rank << std::endl;
// std::cout << "numProc: " << numProc << std::endl;
std::vector<Matrix> phi(2, init);
@@ -31,7 +31,7 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon,
const int neighborUpper = rank - 1;
const int neighborLower = rank + 1;
std::cout << neighborUpper << ":" << neighborLower << std::endl;
// std::cout << neighborUpper << ":" << neighborLower << std::endl;
const int indexRowGlobalStart = (rank * numRows);
const int indexRowGlobalEnd = (rank * numRows) + (numRows - 1);