44 lines
882 B
C
Raw Normal View History

2023-02-05 07:34:23 +01:00
/*
* Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
* All rights reserved.
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file.
*/
#include <float.h>
2023-11-21 05:27:11 +01:00
#include <limits.h>
2023-02-05 07:34:23 +01:00
#include <mpi.h>
2023-11-21 05:27:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
2023-02-05 07:34:23 +01:00
#include "parameter.h"
#include "solver.h"
2023-11-21 05:27:11 +01:00
int main(int argc, char** argv)
2023-02-05 07:34:23 +01:00
{
int rank;
Parameter params;
Solver solver;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
initParameter(&params);
2023-11-21 05:27:11 +01:00
if (argc != 2) {
printf("Usage: %s <configFile>\n", argv[0]);
2023-02-05 07:34:23 +01:00
exit(EXIT_SUCCESS);
}
readParameter(&params, argv[1]);
2023-11-21 05:27:11 +01:00
if (rank == 0) {
2023-02-05 07:34:23 +01:00
printParameter(&params);
}
initSolver(&solver, &params, 2);
solve(&solver);
getResult(&solver);
MPI_Finalize();
return EXIT_SUCCESS;
}