MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdarg.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 "system.h"
#include "mymalloc.h"
#include "endrun.h"
Go to the source code of this file.
Macros | |
#define | __UTILS_SYSTEM_C |
#define | RNDTABLE 8192 |
Functions | |
double | get_random_number (uint64_t id) |
void | set_random_numbers (int seed) |
double | second (void) |
double | timediff (double t0, double t1) |
static int | putline (const char *prefix, const char *line) |
void | MPIU_Tracev (MPI_Comm comm, int where, int error, const char *fmt, va_list va) |
void | MPIU_Trace (MPI_Comm comm, int where, const char *fmt,...) |
void | sumup_large_ints (int n, int *src, int64_t *res) |
void | sumup_longs (int n, int64_t *src, int64_t *res) |
int64_t | MPIU_cumsum (int64_t countLocal, MPI_Comm comm) |
int64_t | count_sum (int64_t countLocal) |
size_t | sizemax (size_t a, size_t b) |
int | MPI_Alltoallv_smart (void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) |
int | MPI_Alltoallv_sparse (void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) |
int | cluster_get_num_hosts (void) |
double | get_physmem_bytes (void) |
int | _MPIU_Barrier (const char *fn, const int line, MPI_Comm comm) |
int | MPIU_Any (int condition, MPI_Comm comm) |
void | MPIU_write_pids (char *filename) |
size_t | gadget_compact_thread_arrays (int *dest, int *srcs[], size_t sizes[], int narrays) |
void | gadget_setup_thread_arrays (int *dest, int *srcs[], size_t sizes[], size_t total_size, int narrays) |
Variables | |
static double | RndTable [RNDTABLE] |
static double | _timestart = -1 |
int _MPIU_Barrier | ( | const char * | fn, |
const int | line, | ||
MPI_Comm | comm | ||
) |
A fancy MPI barrier (use MPIU_Barrier macro)
Definition at line 500 of file system.c.
References MPIU_Trace(), NTask, ta_free, ta_malloc, and ThisTask.
int cluster_get_num_hosts | ( | void | ) |
int64_t count_sum | ( | int64_t | countLocal | ) |
Definition at line 264 of file system.c.
References MPI_INT64.
Referenced by get_long_range_timestep_dloga(), and petaio_save_block().
size_t gadget_compact_thread_arrays | ( | int * | dest, |
int * | srcs[], | ||
size_t | sizes[], | ||
int | narrays | ||
) |
Definition at line 587 of file system.c.
Referenced by cooling_and_starformation(), domain_build_exchange_list(), rebuild_activelist(), treewalk_build_queue(), and treewalk_do_hsml_loop().
void gadget_setup_thread_arrays | ( | int * | dest, |
int * | srcs[], | ||
size_t | sizes[], | ||
size_t | total_size, | ||
int | narrays | ||
) |
Definition at line 600 of file system.c.
Referenced by cooling_and_starformation(), domain_build_exchange_list(), rebuild_activelist(), treewalk_build_queue(), and treewalk_do_hsml_loop().
double get_physmem_bytes | ( | void | ) |
Definition at line 467 of file system.c.
Referenced by read_parameter_file(), and read_parameterfile().
double get_random_number | ( | uint64_t | id | ) |
Definition at line 60 of file system.c.
References RNDTABLE, and RndTable.
Referenced by bh_powerlaw_seed_mass(), blackhole_accretion_ngbiter(), choose_QSO_halo(), gaussian_rng(), get_random_dir(), get_sfr_eeqos(), get_wind_dir(), lightcone_cross(), quicklyastarformation(), sfr_wind_feedback_ngbiter(), and update_random_offset().
int MPI_Alltoallv_smart | ( | void * | sendbuf, |
int * | sendcnts, | ||
int * | sdispls, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int * | recvcnts, | ||
int * | rdispls, | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) |
Definition at line 278 of file system.c.
References MPI_Alltoallv_sparse(), NTask, ta_free, ta_malloc, and ThisTask.
Referenced by fof_reduce_groups(), fof_seed(), and mpsort_mpi_histogram_sort().
int MPI_Alltoallv_sparse | ( | void * | sendbuf, |
int * | sendcnts, | ||
int * | sdispls, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int * | recvcnts, | ||
int * | rdispls, | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) |
Definition at line 353 of file system.c.
References myfree, mymalloc, NTask, and ThisTask.
Referenced by domain_exchange_once(), ev_communicate(), and MPI_Alltoallv_smart().
int MPIU_Any | ( | int | condition, |
MPI_Comm | comm | ||
) |
Definition at line 545 of file system.c.
Referenced by domain_decompose_full(), domain_determine_global_toptree(), domain_exchange(), domain_exchange_once(), domain_nonrecursively_combine_topTree(), force_tree_build(), mymalloc_init(), tamalloc_init(), winds_and_feedback(), and winds_subgrid().
int64_t MPIU_cumsum | ( | int64_t | countLocal, |
MPI_Comm | comm | ||
) |
void MPIU_Trace | ( | MPI_Comm | comm, |
int | where, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 182 of file system.c.
References MPIU_Tracev().
Referenced by _MPIU_Barrier().
void MPIU_Tracev | ( | MPI_Comm | comm, |
int | where, | ||
int | error, | ||
const char * | fmt, | ||
va_list | va | ||
) |
Definition at line 149 of file system.c.
References _timestart, prefix, putline(), and ThisTask.
Referenced by endrun(), message(), and MPIU_Trace().
void MPIU_write_pids | ( | char * | filename | ) |
|
static |
Definition at line 107 of file system.c.
References prefix.
Referenced by MPIU_Tracev().
double second | ( | void | ) |
Definition at line 83 of file system.c.
Referenced by ev_ndone(), ev_primary(), ev_reduce_result(), ev_secondary(), fof_label_primary(), and treewalk_run().
void set_random_numbers | ( | int | seed | ) |
size_t sizemax | ( | size_t | a, |
size_t | b | ||
) |
void sumup_large_ints | ( | int | n, |
int * | src, | ||
int64_t * | res | ||
) |
Definition at line 192 of file system.c.
References myfree, mymalloc, NTask, and ThisTask.
Referenced by check_omega(), collect_BH_info(), cooling_and_starformation(), fof_compile_catalogue(), fof_label_secondary(), gas_ionization_fraction(), get_long_range_timestep_dloga(), petaio_save_snapshot(), print_timebin_statistics(), turn_on_quasars(), winds_and_feedback(), and winds_find_weights().
double timediff | ( | double | t0, |
double | t1 | ||
) |
Definition at line 92 of file system.c.
Referenced by ev_ndone(), ev_primary(), ev_reduce_result(), ev_secondary(), and treewalk_run().
|
static |
Definition at line 144 of file system.c.
Referenced by MPIU_Tracev().
|
static |
Definition at line 58 of file system.c.
Referenced by get_random_number(), and set_random_numbers().