pmm  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions | Variables
pmm_view.c File Reference

Basic viewer program for models constructed by PMM. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <time.h>
#include <paths.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include <libgen.h>
#include <string.h>
#include "pmm_model.h"
#include "pmm_octave.h"
#include "pmm_interval.h"
#include "pmm_log.h"
#include "pmm_argparser.h"
#include "pmm_cfgparser.h"
#include "gnuplot_i.h"

Go to the source code of this file.

Functions

void plot_model (gnuplot_ctrl *plot_handle, struct pmm_model *model, struct pmm_view_options *options)
void plot_slice_model (gnuplot_ctrl *plot_handle, struct pmm_model *model, struct pmm_view_options *options)
void splot_model (gnuplot_ctrl *plot_handle, struct pmm_model *model, struct pmm_view_options *options)
void plot_slice_interp_model (gnuplot_ctrl *plot_handle, struct pmm_model *model, struct pmm_view_options *options)
int bench_in_slice (struct pmm_view_options *options, struct pmm_benchmark *b)
void splot_slice_model (gnuplot_ctrl *plot_handle, struct pmm_model *model, struct pmm_view_options *options)
void set_splot_labels_ranges (gnuplot_ctrl *plot_handle, struct pmm_model *model, char **plot_title_buf)
void set_plot_labels_ranges (gnuplot_ctrl *plot_handle, struct pmm_model *model, char **plot_title_buf)
int draw_plot_intervals (gnuplot_ctrl *plot_handle, struct pmm_model *model)
int draw_splot_intervals (gnuplot_ctrl *plot_handle, struct pmm_model *model)
void empty_model (struct pmm_model *m)
int test_model_files_modified (struct pmm_model **m_array, int n)
int test_model_file_modified (struct pmm_model *m)
int main (int argc, char **argv)

Variables

pthread_rwlock_t history_rwlock

Detailed Description

Basic viewer program for models constructed by PMM.

Author
Robert Higgins
Date
Sept 2009 Program overview:

Arguments: -r routine -c configuration file -m -h

Structure: Parse arguments, read configuration, find routine, plot history or model

Definition in file pmm_view.c.

Function Documentation

int bench_in_slice ( struct pmm_view_options options,
struct pmm_benchmark b 
)

check if a benchmark belongs to a slice defined in a pmm_view_options structure

Parameters
optionspointer to the options structure containing slice def.
bpointer to the benchmark
Returns
0 if benchmark does not belong, 1 if benchmark does belong

Definition at line 1628 of file pmm_view.c.

int draw_plot_intervals ( gnuplot_ctrl plot_handle,
struct pmm_model model 
)

draw construction intervals on 2-d plots

Parameters
plot_handlepointer to gnuplot_ctrl structure
modelpointer to model who's construction intervals are to be plotted
Returns
0 on success (never fails TODO)

Definition at line 1471 of file pmm_view.c.

int draw_splot_intervals ( gnuplot_ctrl plot_handle,
struct pmm_model model 
)

draw construction intervals on 3-d plots

Parameters
plot_handlepointer to gnuplot_ctrl structure
modelpointer to model who's construction intervals are to be plotted
Returns
0 on success (never fails TODO)

Definition at line 1549 of file pmm_view.c.

void empty_model ( struct pmm_model m)

free memeber structures and zero a model

Parameters
mpointer to model

Definition at line 587 of file pmm_view.c.

int main ( int  argc,
char **  argv 
)

Program first parses command line args and to determine the action to take which is either:

print list of models available for plotting (according to config file) plot a model print out the raw data of a model

Definition at line 119 of file pmm_view.c.

void plot_model ( gnuplot_ctrl plot_handle,
struct pmm_model model,
struct pmm_view_options options 
)

plot a model which is in terms of 1 parameter

Parameters
plot_handlepointer to gnuplot handle
modelpointer to model to plot
optionspointer to options for plot

Definition at line 614 of file pmm_view.c.

void plot_slice_interp_model ( gnuplot_ctrl plot_handle,
struct pmm_model model,
struct pmm_view_options options 
)

plot an interpolated one dimensional slice of a 2 parameter model

Parameters
plot_handlepointer to gnuplot handle
modelpointer to model
optionspointer to options

Definition at line 736 of file pmm_view.c.

void plot_slice_model ( gnuplot_ctrl plot_handle,
struct pmm_model model,
struct pmm_view_options options 
)

plot a 2-d projection of a higher-d model

Parameters
plot_handlepointer to gnuplot control structure
modelpointer to model to plot
optionspointer to options structure

Definition at line 896 of file pmm_view.c.

void set_plot_labels_ranges ( gnuplot_ctrl plot_handle,
struct pmm_model model,
char **  plot_title_buf 
)

set labels, ranges and title for a 2-d plot

Parameters
plot_handlepointer to gnuplot structure
modelpointer to model that is being plot
plot_title_bufpointer to character buffer that will contain title
Returns
TODO fails with error but no return

Definition at line 1379 of file pmm_view.c.

void set_splot_labels_ranges ( gnuplot_ctrl plot_handle,
struct pmm_model model,
char **  plot_title_buf 
)

set labels, ranges and title for a 3-d plot

Parameters
plot_handlepointer to gnuplot structure
modelpointer to model that is being plot
plot_title_bufpointer to character buffer that will contain title
Returns
TODO fails with error but no return

Definition at line 1422 of file pmm_view.c.

void splot_model ( gnuplot_ctrl plot_handle,
struct pmm_model model,
struct pmm_view_options options 
)

plot a 3-d model

Parameters
plot_handlepointer to gnuplot control structure
modelpointer to model to plot
optionspointer to options structure

Definition at line 1255 of file pmm_view.c.

void splot_slice_model ( gnuplot_ctrl plot_handle,
struct pmm_model model,
struct pmm_view_options options 
)

plot a 3-d projection of a higher-d model

Parameters
plot_handlepointer to gnuplot control structure
modelpointer to model to plot
optionspointer to options structure

Definition at line 1070 of file pmm_view.c.

int test_model_file_modified ( struct pmm_model m)

Tests if a model file has been modified since the stored mtime

Parameters
mpointer to the model
Returns
0 if not modified, 1 if modified and -1 on error

Definition at line 560 of file pmm_view.c.

int test_model_files_modified ( struct pmm_model **  m_array,
int  n 
)

Test an array of models to see if their model files have been modified. Note that we test all models and update the stored mtime for each.

Parameters
m_arraypointer to array of models
nnumber of models in array
Returns
0 if none of the files have been modified, 1 if any of the model files have been modified, -1 on error.

Definition at line 530 of file pmm_view.c.

Variable Documentation

pthread_rwlock_t history_rwlock

Definition at line 105 of file pmm_view.c.