#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <signal.h>
#include <gsl/gsl_rng.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
Go to the source code of this file.
Functions | |
double | get_random_number (int id) |
void | set_random_numbers (void) |
double | second (void) |
double | timediff (double t0, double t1) |
double | dmax (double x, double y) |
double | dmin (double x, double y) |
int | imax (int x, int y) |
int | imin (int x, int y) |
Definition in file system.c.
|
returns the maximum of two double Definition at line 95 of file system.c. Referenced by density(), domain_findSplit(), domain_shiftSplit(), fill_write_buffer(), and read_ic(). |
|
returns the minimum of two double Definition at line 105 of file system.c. Referenced by hydro_evaluate(). |
|
This routine returns a random number taken from a table of random numbers, which is refilled every timestep. This method is used to allow random number application to particles independent of the number of processors used, and independent of the particular order the particles have. In order to work properly, the particle IDs should be set properly to unique integer values. < gives the length of a table with random numbers, refreshed at every timestep. This is used to allow application of random numbers to a specific particle in a way that is independent of the number of processors used. Definition at line 29 of file system.c. References RndTable. Referenced by advance_and_find_timesteps(), force_treebuild_single(), and gravity_forcetest(). |
|
returns the maximum of two integers Definition at line 115 of file system.c. Referenced by hydro_evaluate(), and pm_init_periodic_allocate(). |
|
returns the minimum of two integers Definition at line 125 of file system.c. Referenced by domain_findExchangeNumbers(). |
|
returns the number of cpu-ticks in seconds that have elapsed, or the wall-clock time obtained with MPI_Wtime(). Definition at line 53 of file system.c. Referenced by advance_and_find_timesteps(), compute_accelerations(), compute_potential(), density(), domain_Decomposition(), gravity_forcetest(), gravity_tree(), hydro_force(), main(), move_particles(), run(), and savepositions(). |
|
This routine fills the random number table. < gives the length of a table with random numbers, refreshed at every timestep. This is used to allow application of random numbers to a specific particle in a way that is independent of the number of processors used. Definition at line 39 of file system.c. References RndTable. Referenced by begrun(). |
|
returns the time difference between two measurements obtained with second(). The routine takes care of the possible overflow of the tick counter on 32bit systems, but depending on the system, this may not always work properly. Similarly, in some MPI implementations, the MPI_Wtime() function may also overflow, in which case a negative time difference would be returned. The routine returns instead a time difference equal to 0. Definition at line 74 of file system.c. References pow(). Referenced by advance_and_find_timesteps(), compute_accelerations(), compute_potential(), density(), domain_Decomposition(), gravity_forcetest(), gravity_tree(), hydro_force(), main(), move_particles(), run(), and savepositions(). |