• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/patterns/pattern_common.h

00001 /*
00002 ** Copyright 2009-2010 Sandia Corporation. Under the terms
00003 ** of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00004 ** Government retains certain rights in this software.
00005 **
00006 ** Copyright (c) 2009-2010, Sandia Corporation
00007 ** All rights reserved.
00008 **
00009 ** This file is part of the SST software package. For license
00010 ** information, see the LICENSE file in the top level directory of the
00011 ** distribution.
00012 */
00013 
00014 #ifndef _PATTERN_COMMON_H
00015 #define _PATTERN_COMMON_H
00016 
00017 #ifndef FALSE
00018 #define FALSE (0)
00019 #endif
00020 #ifndef TRUE
00021 #define TRUE (1)
00022 #endif
00023 
00024 #include <sst_config.h>
00025 #include <sst/core/sst_types.h>
00026 #include <sst/core/link.h>
00027 
00028 
00029 
00030 // Event types sent among pattern generators
00031 typedef enum {START,            // Enter first state of state machine
00032               COMPUTE_DONE,     // Finished a compute step
00033               RECEIVE,          // Received a message
00034               CHCKPT_DONE,      // A checkpoint has been written
00035               FAIL,             // A failure occured on this rank
00036               LOG_MSG_DONE,     // Done logging a message to stable (local) storage
00037               ENV_LOG_DONE,     // Envelope write to log is done
00038               ENTER_WAIT,       // Wait for four receives from neighbors
00039 
00040               // Make sure you set this at 200 so we can talk to the bit_bucket component
00041               BIT_BUCKET_WRITE_START= 200,
00042               BIT_BUCKET_WRITE_DONE,
00043               BIT_BUCKET_READ_START,
00044               BIT_BUCKET_READ_DONE
00045 } pattern_event_t;
00046 
00047 
00048 // The checkpoint methods we support
00049 typedef enum {CHCKPT_NONE, CHCKPT_COORD, CHCKPT_UNCOORD, CHCKPT_RAID} chckpt_t;
00050 
00051 class Patterns   {
00052     public:
00053         Patterns()   {
00054             // Nothing to do for now
00055             my_net_link= NULL;
00056             my_self_link= NULL;
00057             mesh_width= -1;
00058             mesh_height= -1;
00059             NoC_width= -1;
00060             NoC_height= -1;
00061             total_cores= 1;
00062             my_rank= -1;
00063             net_latency= 0;
00064             net_bandwidth= 0;
00065             msg_seq= 1;
00066         }
00067 
00068         int init(int x, int y, int NoC_x_dim, int NoC_y_dim, int rank, int cores,
00069                 SST::Link *net_link, SST::Link *self_link,
00070                 SST::Link *NoC_link, SST::Link *nvram_link, SST::Link *storage_link,
00071                 SST::SimTime_t net_lat, SST::SimTime_t net_bw, SST::SimTime_t node_lat,
00072                 SST::SimTime_t node_bw, chckpt_t method, int chckpt_size,
00073                 SST::SimTime_t chckpt_interval, int envelope_size);
00074 
00075         void send(int dest, int len);
00076         void event_send(int dest, pattern_event_t event, SST::SimTime_t delay= 0,
00077                 uint32_t msg_len= 0);
00078         void storage_write(int data_size, pattern_event_t return_event);
00079         void nvram_write(int data_size, pattern_event_t return_event);
00080 
00081 
00082     private:
00083         SST::Link *my_net_link;
00084         SST::Link *my_self_link;
00085         SST::Link *my_NoC_link;
00086         SST::Link *my_nvram_link;
00087         SST::Link *my_storage_link;
00088         int mesh_width;
00089         int mesh_height;
00090         int NoC_width;
00091         int NoC_height;
00092         int my_rank;
00093         int total_cores;
00094         int cores_per_router;
00095         int cores_per_node;
00096         SST::SimTime_t net_bandwidth;   // In bytes per second
00097         SST::SimTime_t node_bandwidth;  // In bytes per second
00098         SST::SimTime_t net_latency;     // in nano seconds FIXME: Variable not needed
00099         SST::SimTime_t node_latency;    // in nano seconds FIXME: Variable not needed
00100         uint64_t msg_seq;               // Each message event gets a unique number for debugging
00101 
00102 } ;  // end of class Patterns
00103 
00104 
00105 #endif  /* _PATTERN_COMMON_H */

Generated on Fri Oct 22 2010 11:02:25 for SST by  doxygen 1.7.1