Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Conflicts:
	Makefile.am
  • Loading branch information
jjwilke committed Feb 26, 2016
2 parents e201377 + ac50251 commit 7a421c4
Show file tree
Hide file tree
Showing 38 changed files with 558 additions and 104 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ endif
#

if REPO_BUILD
sstmac_repo.h: .git/refs/master
sstmac_repo.h: .git/refs/heads/master
cd $(abs_top_srcdir) && $(abs_top_srcdir)/bin/make_repo_header $(abs_top_srcdir) sstmac
endif

Expand Down
6 changes: 1 addition & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,7 @@ echo "Fortran compiler $FC"

echo "OS $os"

if test "X$ATOS" = "X" && test "X$ADDR_TO_LINE" = "X"; then
echo "Graphviz Trace No"
else
echo "Graphviz Trace Yes"
fi
echo "Graphviz Trace $enable_graphviz"

dnl --- threading ---
echo "Threading:"
Expand Down
3 changes: 1 addition & 2 deletions skeletons/boxml/boxml-run.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ namespace lblxml
comm_t* sendptr = static_cast<comm_t*>(g_events[v_sends.front()]);
comm_t& send = *sendptr;
if (send.n_dep() == 0) { // abundance of caution
//int count = send.size();
int count = 0;
int count = send.size();
int dest_box = send.to();
int dest = g_boxindex_to_rank[ dest_box ];
int index = send.index();
Expand Down
2 changes: 1 addition & 1 deletion sprockit
10 changes: 6 additions & 4 deletions sstmac/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ libsstmac_common_la_SOURCES = \
stats/stat_spyplot.cc \
stats/stat_histogram.cc \
stats/event_trace.cc \
stats/location_trace.cc
stats/location_trace.cc \
stats/stat_local_int.cc

if VTK_ENABLE
libsstmac_common_la_SOURCES += vis/vtk_engine.cc
Expand All @@ -58,7 +59,7 @@ if VTK_ENABLE
AM_LIBS = $(VTK_LIBS)
endif

nodist_library_include_HEADERS = sstmac_config.h
nodist_library_include_HEADERS = sstmac_config.h config.h

library_includedir=$(includedir)/sstmac/common

Expand All @@ -81,7 +82,6 @@ nobase_library_include_HEADERS = \
runtime.h \
timestamp.h \
timestamp_fwd.h \
config.h \
sst_event.h \
sst_event_fwd.h \
thread_info.h \
Expand Down Expand Up @@ -111,7 +111,9 @@ nobase_library_include_HEADERS = \
stats/stat_histogram.h \
stats/stat_histogram_fwd.h \
stats/event_trace.h \
stats/location_trace.h
stats/location_trace.h \
stats/stat_local_int.h \
stats/stat_local_int_fwd.h

if VTK_ENABLE
nobase_library_include_HEADERS += vis/vtk_engine.h
Expand Down
9 changes: 7 additions & 2 deletions sstmac/common/event_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,13 @@ event_manager::finish_stats()
}

if (!entry.main){
stat_collector* first = entry.collectors.front();
entry.main = first->clone();
if (entry.collectors.size() == 1){
entry.main = entry.collectors.front();
entry.collectors.clear();
} else {
stat_collector* first = entry.collectors.front();
entry.main = first->clone();
}
}

finish_stats(entry.main, name, now());
Expand Down
94 changes: 94 additions & 0 deletions sstmac/common/stats/stat_local_int.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#include <sstmac/backends/common/parallel_runtime.h>
#include <sstmac/common/stats/stat_local_int.h>
#include <sprockit/spkt_string.h>
#include <sprockit/sim_parameters.h>
#include <sprockit/output.h>
#include <sprockit/util.h>
#include <math.h>

namespace sstmac {

SpktRegister("local_int", stat_collector, stat_local_int);

stat_local_int::stat_local_int() :
size_(0),
id_(-1),
value_(0)
{
}

void
stat_local_int::global_reduce(parallel_runtime *rt)
{
if (rt->nproc() == 1)
return;
spkt_throw(sprockit::unimplemented_error, "stat_local_int::global_reduce");
}

void
stat_local_int::reduce(stat_collector *coll)
{
stat_local_int* other = safe_cast(stat_local_int, coll);
if ((other->id_ + 1) > size_) {
size_ = other->id_ + 1;
values_.resize(size_);
}
values_[other->id_] = other->value_;
}

void
stat_local_int::dump(const std::string& froot)
{
std::string data_file = froot + ".dat";
std::fstream data_str;
check_open(data_str, data_file);
data_str << "Id Value\n";
for (int i=0; i < values_.size(); ++i)
data_str << sprockit::printf("%i %i\n", i, values_[i]);
data_str.close();
}

void
stat_local_int::dump_global_data()
{
dump(fileroot_);
}

void
stat_local_int::dump_local_data()
{
std::string fname = sprockit::printf("%s.%d", fileroot_.c_str(), id_);
dump(fname);
}

void
stat_local_int::clear()
{
}

void
stat_local_int::collect(int value)
{
value_ += value;
}

void
stat_local_int::clone_into(stat_local_int* vec) const {
stat_collector::clone_into(vec);
}

void
stat_local_int::init_factory_params(sprockit::sim_parameters *params)
{
stat_collector::init_factory_params(params);
}

void
stat_local_int::simulation_finished(timestamp end)
{
}




}
74 changes: 74 additions & 0 deletions sstmac/common/stats/stat_local_int.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#ifndef STAT_LOCAL_INT_H
#define STAT_LOCAL_INT_H

#include <sstmac/common/stats/stat_collector.h>
#include <vector>

namespace sstmac
{

class stat_local_int :
public stat_collector
{
public:
stat_local_int();

void
init(int id) {
id_ = id;
}

void
collect(int value);

void
simulation_finished(timestamp end);

void
dump_local_data();

void
dump_global_data();

void
global_reduce(parallel_runtime *rt);

void
clear();

void
reduce(stat_collector *coll);

void
init_factory_params(sprockit::sim_parameters *params);

stat_local_int*
clone_me(int id) const {
stat_local_int* cln = new stat_local_int;
clone_into(cln);
cln->set_id(id);
return cln;
}

stat_collector*
clone() const {
return clone_me(-1);
}

protected:
void
dump(const std::string& froot);

void
clone_into(stat_local_int* cln) const;

protected:
int size_;
int id_;
int value_;
std::vector<int> values_;
};

}

#endif // STAT_LOCAL_INT_H
10 changes: 10 additions & 0 deletions sstmac/common/stats/stat_local_int_fwd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef STAT_LOCAL_INT_FWD_H
#define STAT_LOCAL_INT_FWD_H

namespace sstmac {

class stat_local_int;

}

#endif // STAT_LOCAL_INT_FWD_H
15 changes: 14 additions & 1 deletion sstmac/hardware/nic/nic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <sstmac/software/process/operating_system.h>
#include <sstmac/common/stats/stat_spyplot.h>
#include <sstmac/common/stats/stat_histogram.h>
#include <sstmac/common/stats/stat_local_int.h>
#include <sstmac/common/event_manager.h>
#include <sprockit/statics.h>
#include <sprockit/sim_parameters.h>
Expand All @@ -40,7 +41,8 @@ static sprockit::need_delete_statics<nic> del_statics;
nic::nic() :
spy_num_messages_(0),
spy_bytes_(0),
hist_msg_size_(0)
hist_msg_size_(0),
local_bytes_sent_(0)
{
}

Expand Down Expand Up @@ -70,6 +72,12 @@ nic::init_factory_params(sprockit::sim_parameters *params)
spy_bytes_->add_suffix("bytes");
}

if (params->has_namespace("local_bytes_sent")) {
sprockit::sim_parameters* traffic_params = params->get_namespace("local_bytes_sent");
local_bytes_sent_ = test_cast(stat_local_int, stat_collector_factory::get_optional_param("type", "local_int", traffic_params));
local_bytes_sent_->init(my_addr_);
}

if (params->has_namespace("message_sizes")){
sprockit::sim_parameters* size_params = params->get_namespace("message_sizes");
hist_msg_size_ = test_cast(stat_histogram, stat_collector_factory::get_optional_param("type", "histogram", size_params));
Expand Down Expand Up @@ -250,6 +258,10 @@ nic::record_message(const network_message::ptr& netmsg)
if (hist_msg_size_) {
hist_msg_size_->collect(netmsg->byte_length());
}

if (local_bytes_sent_) {
local_bytes_sent_->collect(netmsg->byte_length());
}
}

void
Expand Down Expand Up @@ -304,6 +316,7 @@ nic::set_event_parent(event_scheduler* m)
if (spy_num_messages_) m->register_stat(spy_num_messages_);
if (spy_bytes_) m->register_stat(spy_bytes_);
if (hist_msg_size_) m->register_stat(hist_msg_size_);
if (local_bytes_sent_) m->register_stat(local_bytes_sent_);
#endif

}
Expand Down
2 changes: 2 additions & 0 deletions sstmac/hardware/nic/nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <sstmac/common/stats/stat_spyplot_fwd.h>
#include <sstmac/common/stats/stat_histogram_fwd.h>
#include <sstmac/common/stats/stat_local_int_fwd.h>
#include <sstmac/hardware/interconnect/interconnect_fwd.h>

#include <sstmac/hardware/nic/network_endpoint.h>
Expand Down Expand Up @@ -167,6 +168,7 @@ class nic :
stat_spyplot* spy_num_messages_;
stat_spyplot* spy_bytes_;
stat_histogram* hist_msg_size_;
stat_local_int* local_bytes_sent_;

private:
/**
Expand Down
4 changes: 2 additions & 2 deletions sstmac/libraries/mpi/mpi_protocol/eager0_mmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ eager0_mmap::send_header(mpi_queue* queue,
const mpi_message::ptr& msg)
{
//skip backtrace if service thread
SSTMACBacktrace("MPI Eager 0 Protocol: Intranode Send Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Intranode Send Header");
msg->content_type(mpi_message::eager_payload);
queue->buffered_send(msg);
}
Expand All @@ -24,7 +24,7 @@ void
eager0_mmap::incoming_payload(mpi_queue* queue,
const mpi_message::ptr& msg)
{
SSTMACBacktrace("MPI Eager 0 Protocol: Intranode Handle Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Intranode Handle Header");
mpi_queue_recv_request* req = queue->find_pending_request(msg);
if (req) {
queue->buffered_recv(msg, req);
Expand Down
4 changes: 2 additions & 2 deletions sstmac/libraries/mpi/mpi_protocol/eager0_rdma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void
eager0_rdma::send_header(mpi_queue* queue,
const mpi_message::ptr& msg)
{
SSTMACBacktrace("MPI Eager 0 Protocol: Send Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Send Header");
msg->content_type(mpi_message::eager_payload);
queue->post_header(msg);
}
Expand All @@ -23,7 +23,7 @@ void
eager0_rdma::incoming_payload(mpi_queue* queue,
const mpi_message::ptr& msg)
{
SSTMACBacktrace("MPI Eager 0 Protocol: Handle Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Handle Header");
mpi_queue_recv_request* req = queue->find_pending_request(msg);
if (req) {
req->handle(msg);
Expand Down
4 changes: 2 additions & 2 deletions sstmac/libraries/mpi/mpi_protocol/eager0_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void
eager0_socket::send_header(mpi_queue* queue,
const mpi_message::ptr& msg)
{
SSTMACBacktrace("MPI Eager 0 Protocol: Send Socket Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Send Socket Header");
msg->content_type(mpi_message::eager_payload);
queue->post_header(msg);
}
Expand All @@ -23,7 +23,7 @@ void
eager0_socket::incoming_payload(mpi_queue* queue,
const mpi_message::ptr& msg)
{
SSTMACBacktrace("MPI Eager 0 Protocol: Handle Socket Header", queue->is_service_thread());
SSTMACBacktrace("MPI Eager 0 Protocol: Handle Socket Header");
mpi_queue_recv_request* req = queue->find_pending_request(msg);
if (req) {
req->handle(msg);
Expand Down
Loading

0 comments on commit 7a421c4

Please sign in to comment.