123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #include "mpi_cholesky.h"
- #include "helper.h"
- int main(int argc, char **argv)
- {
-
- float ***bmat;
- int rank, nodes, ret;
- double timing, flops;
- #ifndef STARPU_SIMGRID
- int correctness;
- #endif
- ret = starpu_init(NULL);
- STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
- ret = starpu_mpi_init(&argc, &argv, 1);
- STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init");
- starpu_mpi_comm_rank(MPI_COMM_WORLD, &rank);
- starpu_mpi_comm_size(MPI_COMM_WORLD, &nodes);
- starpu_cublas_init();
- if (starpu_cpu_worker_get_count() + starpu_cuda_worker_get_count() == 0)
- {
- if (rank == 0)
- {
- FPRINTF(stderr, "We need at least 1 CPU or CUDA worker.\n");
- }
- starpu_mpi_shutdown();
- starpu_shutdown();
- return STARPU_TEST_SKIPPED;
- }
- parse_args(argc, argv, nodes);
- matrix_init(&bmat, rank, nodes, 1);
- matrix_display(bmat, rank);
- dw_cholesky(bmat, size/nblocks, rank, nodes, &timing, &flops);
- starpu_mpi_shutdown();
- #ifndef STARPU_SIMGRID
- matrix_display(bmat, rank);
- dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops);
- #endif
- matrix_free(&bmat, rank, nodes, 1);
- starpu_cublas_shutdown();
- starpu_shutdown();
- #ifndef STARPU_SIMGRID
- assert(correctness);
- #endif
- if (rank == 0)
- {
- FPRINTF(stdout, "Computation time (in ms): %2.2f\n", timing/1000);
- FPRINTF(stdout, "Synthetic GFlops : %2.2f\n", (flops/timing/1000.0f));
- }
- return 0;
- }
|