* This function initializes the MPI communication packages, and sets
* cpu-time counters to 0. Then begrun() is called, which sets up
* the simulation either from IC's or from restart files. Finally,
* run() is started, the main simulation loop, which iterates over
* the timesteps.
*/
int main(int argc, char **argv)
{
double t0, t1;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &ThisTask);
MPI_Comm_size(MPI_COMM_WORLD, &NTask);
if(NTask <= 1)
{
if(ThisTask == 0)
printf
("Note: This is a massively parallel code, but you are running with 1 processor only.\nCompared to an equivalent serial code, there is some unnecessary overhead.\n");
}
for(PTask = 0; NTask > (1 << PTask); PTask++);
if(argc < 2)
{
if(ThisTask == 0)
{
printf("Parameters are missing.\n");
printf("Call with <ParameterFile> [<RestartFlag>]\n");