GADGET-4
logs Class Reference

#include <logs.h>

Inherits setcomm.

Classes

struct  timer_d
 struct containing the information of a CPU timer More...
 

Public Types

enum  timers { CPU_NONE = -2 , CPU_ROOT = -1 }
 

Public Member Functions

 logs ()
 
void init_cpu_log (simparticles *Sp_ptr)
 
void open_logfiles (void)
 Open files for logging. More...
 
void write_cpu_log (void)
 Write the FdBalance and FdCPU files. More...
 
void output_log_messages (void)
 Write the FdInfo and FdTimeBin files. More...
 
void compute_statistics (void)
 Computes new global statistics if needed (done by energy_statistics()) More...
 
void print_particle_info_from_ID (MyIDType ID)
 
void print_particle_info (int i)
 
void log_debug_md5 (const char *msg)
 
void calc_memory_checksum (const char *msg, void *base, size_t bytes)
 
void block_checksum (void *base, size_t bytes, int res[4])
 
int flush_everything (void)
 
void compute_total_momentum (void)
 
double measure_time (void)
 
double timediff (double t0, double t1)
 
double second (void)
 
void timer_stop (enum timers counter)
 
void timer_start (enum timers counter)
 
- Public Member Functions inherited from setcomm
 setcomm (MPI_Comm Comm)
 
 setcomm (const char *str)
 
void initcomm (MPI_Comm Comm)
 
void mpi_printf (const char *fmt,...)
 
void determine_compute_nodes (void)
 

Public Attributes

simparticlesSp
 
double CPUThisRun
 
FILE * FdInfo
 
FILE * FdEnergy
 
FILE * FdTimings
 
FILE * FdDensity
 
FILE * FdHydro
 
FILE * FdBalance
 
FILE * FdTimebin
 
FILE * FdDomain
 
FILE * FdCPU
 
FILE * FdCPUCSV
 
timer_d Timer_data [CPU_LAST+1]
 
double CPU_Step [CPU_LAST]
 
double CPU_Step_Stored [CPU_LAST]
 
double CPU_Sum [CPU_LAST]
 
enum timers TimerStack [TIMER_STACK_DEPTH]
 
int TimerStackPos = 0
 
- Public Attributes inherited from setcomm
MPI_Comm Communicator
 
int NTask
 
int ThisTask
 
int PTask
 
int ThisNode
 
int NumNodes = 0
 
int TasksInThisNode
 
int RankInThisNode
 
int MinTasksPerNode
 
int MaxTasksPerNode
 
long long MemoryOnNode
 
long long SharedMemoryOnNode
 

Detailed Description

Definition at line 27 of file logs.h.

Member Enumeration Documentation

◆ timers

enum timers
Enumerator
CPU_NONE 

used for counters without a parent

CPU_ROOT 

root node of the tree

Definition at line 90 of file logs.h.

Constructor & Destructor Documentation

◆ logs()

logs ( )
inline

Definition at line 30 of file logs.h.

Member Function Documentation

◆ block_checksum()

void block_checksum ( void *  base,
size_t  bytes,
int  res[4] 
)

◆ calc_memory_checksum()

void calc_memory_checksum ( const char *  msg,
void *  base,
size_t  bytes 
)

◆ compute_statistics()

void compute_statistics ( void  )

Computes new global statistics if needed (done by energy_statistics())

Definition at line 501 of file logs.cc.

◆ compute_total_momentum()

void compute_total_momentum ( void  )

◆ flush_everything()

int flush_everything ( void  )

Definition at line 129 of file logs.cc.

◆ init_cpu_log()

void init_cpu_log ( simparticles Sp_ptr)

Definition at line 296 of file logs.cc.

◆ log_debug_md5()

void log_debug_md5 ( const char *  msg)

◆ measure_time()

double measure_time ( void  )

Definition at line 458 of file logs.cc.

◆ open_logfiles()

void open_logfiles ( void  )

Open files for logging.

This function opens various log-files that report on the status and performance of the simulation. Upon restart, the code will append to these files.

Definition at line 35 of file logs.cc.

◆ output_log_messages()

void output_log_messages ( void  )

Write the FdInfo and FdTimeBin files.

At each time step this function writes on to two log-files. In FdInfo, it just lists the timesteps that have been done, while in FdTimeBin it outputs information about the active and occupied time-bins.

Definition at line 175 of file logs.cc.

◆ print_particle_info()

void print_particle_info ( int  i)

◆ print_particle_info_from_ID()

void print_particle_info_from_ID ( MyIDType  ID)

◆ second()

double second ( void  )

Definition at line 471 of file logs.cc.

◆ timediff()

double timediff ( double  t0,
double  t1 
)

Definition at line 488 of file logs.cc.

◆ timer_start()

void timer_start ( enum timers  counter)
inline

Definition at line 152 of file logs.h.

◆ timer_stop()

void timer_stop ( enum timers  counter)
inline

Definition at line 141 of file logs.h.

◆ write_cpu_log()

void write_cpu_log ( void  )

Write the FdBalance and FdCPU files.

At each time step this function writes on to two log-files. In FdBalance, it outputs in a graphical way the amount of time spent in the various parts of the code, while in FdCPU it writes information about the cpu-time consumption of the various modules.

Definition at line 330 of file logs.cc.

Member Data Documentation

◆ CPU_Step

double CPU_Step[CPU_LAST]

Definition at line 115 of file logs.h.

◆ CPU_Step_Stored

double CPU_Step_Stored[CPU_LAST]

Definition at line 116 of file logs.h.

◆ CPU_Sum

double CPU_Sum[CPU_LAST]

sums wallclock time/CPU consumption in whole run

Definition at line 117 of file logs.h.

◆ CPUThisRun

double CPUThisRun

Sums CPU time of current process

Definition at line 43 of file logs.h.

◆ FdBalance

FILE * FdBalance

file handle for balance.txt log-file.

Definition at line 50 of file logs.h.

◆ FdCPU

FILE * FdCPU

file handle for cpu.txt log-file.

Definition at line 53 of file logs.h.

◆ FdCPUCSV

FILE* FdCPUCSV

file handle for cpu.csv log-file. Used if the cpu log is printed in csv format as well.

Definition at line 55 of file logs.h.

◆ FdDensity

FILE * FdDensity

file handle for timings.txt log-file.

Definition at line 48 of file logs.h.

◆ FdDomain

FILE * FdDomain

file handle for domain.txt log-file.

Definition at line 52 of file logs.h.

◆ FdEnergy

FILE * FdEnergy

file handle for energy.txt log-file.

Definition at line 46 of file logs.h.

◆ FdHydro

FILE * FdHydro

file handle for timings.txt log-file.

Definition at line 49 of file logs.h.

◆ FdInfo

FILE* FdInfo

file handle for info.txt log-file.

Definition at line 45 of file logs.h.

◆ FdTimebin

FILE * FdTimebin

file handle for timebins.txt log-file.

Definition at line 51 of file logs.h.

◆ FdTimings

FILE * FdTimings

file handle for timings.txt log-file.

Definition at line 47 of file logs.h.

◆ Sp

Definition at line 41 of file logs.h.

◆ Timer_data

timer_d Timer_data[CPU_LAST+1]

Definition at line 113 of file logs.h.

◆ TimerStack

enum timers TimerStack[TIMER_STACK_DEPTH]

Definition at line 119 of file logs.h.

◆ TimerStackPos

int TimerStackPos = 0

Definition at line 120 of file logs.h.


The documentation for this class was generated from the following files: