75 g_st_buffer[type]->
count = 0;
76 g_st_buffer[type]->
buffer = (
char*)
tw_calloc(
TW_LOC,
"statistics collection (buffer)", 1, g_st_buffer[type]->size);
85 MPI_File_open(
MPI_COMM_ROSS, filename, MPI_MODE_CREATE | MPI_MODE_EXCL | MPI_MODE_WRONLY, MPI_INFO_NULL, &
buffer_fh[type]);
107 printf(
"WARNING: Stats buffer overflow on rank %lu\n",
g_tw_mynode);
117 if ((size1 = g_st_buffer[type]->size - g_st_buffer[type]->write_pos) >= size)
125 size2 = size - size1;
127 memcpy(g_st_buffer[type]->buffer, data + size1, size2);
131 g_st_buffer[type]->
count += size;
141 int write_to_file = 0;
142 int my_write_size = 0;
147 my_write_size = g_st_buffer[type]->
count;
149 MPI_Allgather(&my_write_size, 1, MPI_INT, &write_sizes[0], 1, MPI_INT,
MPI_COMM_ROSS);
166 offset += write_sizes[i];
174 MPI_File_write_at_all(*fh, offset,
st_buffer_read_ptr(g_st_buffer[type]), my_write_size, MPI_BYTE, &status);
180 g_st_buffer[type]->
count = 0;
tw_synch g_tw_synchronization_protocol
char g_st_stats_path[4096]
static st_stats_buffer ** g_st_buffer
void st_buffer_push(int type, char *data, int size)
void st_buffer_write(int end_of_sim, int type)
int g_st_buffer_free_percent
tw_statistics stats
per PE counters
static MPI_Offset * prev_offsets
static tw_clock tw_clock_read(void)
unsigned int tw_nnodes(void)
void st_buffer_allocate()
void st_buffer_init(int type)
static int buffer_overflow_warned
#define st_buffer_free_space(buf)
#define st_buffer_write_ptr(buf)
int g_st_use_analysis_lps
static tw_stime tw_now(tw_lp const *lp)
#define st_buffer_read_ptr(buf)
static const char * file_suffix[NUM_COL_TYPES]
static MPI_File * buffer_fh
char g_st_stats_out[INST_MAX_LENGTH]
void * tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n)
void st_buffer_finalize(int type)
char stats_directory[INST_MAX_LENGTH]