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

sst/elements/portals4_sm/trig_cpu/portals.h

00001 // Copyright 2009-2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2009-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 
00013 #ifndef COMPONENTS_TRIG_CPU_PORTALS_H
00014 #define COMPONENTS_TRIG_CPU_PORTALS_H
00015 
00016 #include <vector>
00017 #include <list>
00018 #include <map>
00019 #include <queue>
00020 
00021 #include "portals_types.h"
00022 #include <sst/core/sst_types.h>
00023 
00024 #include "sst/elements/portals4_sm/trig_nic/trig_nic_event.h"
00025 
00026 class trig_cpu;
00027 
00028 class portals {
00029 
00030 public:
00031     void PtlCTAlloc(ptl_ct_type_t ct_type, ptl_handle_ct_t& ct_handle); 
00032     void PtlCTFree(ptl_handle_ct_t ct_handle);
00033     void PtlCTSet(ptl_handle_ct_t ct_handle, ptl_ct_event_t new_ct);
00034     bool PtlCTWait(ptl_handle_ct_t ct_handle, ptl_size_t test);
00035     // Not in spec, need for internal
00036     bool PtlCTCheckThresh(ptl_handle_ct_t ct_handle, ptl_size_t test);
00037     // Implemented different than spec
00038     void PtlCTInc(ptl_handle_ct_t ct_handle, /*ptl_ct_event_t*/ ptl_size_t increment);
00039     void PtlCTGet(ptl_handle_ct_t ct_handle, ptl_ct_event_t* event);
00040   
00041     void PtlMDBind(ptl_md_t md, ptl_handle_md_t *md_handle);
00042     void PtlMDRelease(ptl_handle_md_t md_handle);
00043   
00044     void PtlMEAppend(ptl_pt_index_t pt_index, ptl_me_t me, ptl_list_t ptl_list, 
00045                      void *user_ptr, ptl_handle_me_t& me_handle);
00046     void PtlMEUnlink(ptl_handle_me_t me_handle); 
00047 
00048     void PtlPut(ptl_handle_md_t md_handle, ptl_size_t local_offset, 
00049                 ptl_size_t length, ptl_ack_req_t ack_req, 
00050                 ptl_process_id_t target_id, ptl_pt_index_t pt_index,
00051                 ptl_match_bits_t match_bits, ptl_size_t remote_offset, 
00052                 void *user_ptr, ptl_hdr_data_t hdr_data); 
00053 
00054     void PtlAtomic(ptl_handle_md_t md_handle, ptl_size_t local_offset,
00055                    ptl_size_t length, ptl_ack_req_t ack_req,
00056                    ptl_process_id_t target_id, ptl_pt_index_t pt_index,
00057                    ptl_match_bits_t match_bits, ptl_size_t remote_offset,
00058                    void *user_ptr, ptl_hdr_data_t hdr_data,
00059                    ptl_op_t operation, ptl_datatype_t datatype);
00060 
00061     void PtlTriggeredPut(ptl_handle_md_t md_handle, ptl_size_t local_offset, 
00062                          ptl_size_t length, ptl_ack_req_t ack_req, 
00063                          ptl_process_id_t target_id, ptl_pt_index_t pt_index,
00064                          ptl_match_bits_t match_bits, ptl_size_t remote_offset, 
00065                          void *user_ptr, ptl_hdr_data_t hdr_data,
00066                          ptl_handle_ct_t trig_ct_handle, ptl_size_t threshold);
00067 
00068     // This version not used.  Use Start and End TriggeredPutV with a
00069     // for loop that calls TriggeredPut's
00070     void PtlTriggeredPutV(ptl_handle_md_t md_handle, ptl_size_t local_offset, 
00071                           ptl_size_t length, ptl_ack_req_t ack_req, 
00072                           ptl_process_id_t* target_ids, ptl_size_t id_length, ptl_pt_index_t pt_index,
00073                           ptl_match_bits_t match_bits, ptl_size_t remote_offset, 
00074                           void *user_ptr, ptl_hdr_data_t hdr_data,
00075                           ptl_handle_ct_t trig_ct_handle, ptl_size_t threshold);
00076     
00077     void PtlStartTriggeredPutV(ptl_size_t id_length);
00078     void PtlEndTriggeredPutV();
00079     
00080     void PtlTriggeredAtomic(ptl_handle_md_t md_handle, ptl_size_t local_offset,
00081                             ptl_size_t length, ptl_ack_req_t ack_req,
00082                             ptl_process_id_t target_id, ptl_pt_index_t pt_index,
00083                             ptl_match_bits_t match_bits, ptl_size_t remote_offset,
00084                             void *user_ptr, ptl_hdr_data_t hdr_data,
00085                             ptl_op_t operation, ptl_datatype_t datatype,
00086                             ptl_handle_ct_t trig_ct_handle, ptl_size_t threshold);
00087 
00088     void PtlTriggeredCTInc(ptl_handle_ct_t ct_handle, ptl_size_t increment,
00089                            ptl_handle_ct_t trig_ct_handle, ptl_size_t threshold);
00090   
00091     void PtlGet ( ptl_handle_md_t md_handlde, ptl_size_t local_offset, 
00092                   ptl_size_t length, ptl_process_id_t target_id, 
00093                   ptl_pt_index_t pt_index, ptl_match_bits_t match_bits, 
00094                   void *user_ptr, ptl_size_t remote_offset ); 
00095 
00096     void PtlTriggeredGet ( ptl_handle_md_t md_handle, ptl_size_t local_offset, 
00097                            ptl_size_t length, ptl_process_id_t target_id, 
00098                            ptl_pt_index_t pt_index, ptl_match_bits_t match_bits, 
00099                            void *user_ptr, ptl_size_t remote_offset,
00100                            ptl_handle_ct_t ct_handle, ptl_size_t threshold);
00101 
00102 
00103     void PtlEnableCoalesce(void);
00104     void PtlDisableCoalesce(void);
00105 
00106     portals(trig_cpu* my_cpu);
00107 
00108     void scheduleUpdateHostCT(ptl_handle_ct_t ct_handle);
00109 //     bool processMessage(int src, uint32_t* ptl_data);
00110     bool processMessage(SST::trig_nic_event* ev);
00111 //     bool processNICOp(ptl_int_nic_op_t* op);
00112 
00113     bool progressPIO();
00114   
00115 private:
00116 #define MAX_PORTAL_TABLE_ENTRY 32
00117     ptl_entry_t* ptl_table[MAX_PORTAL_TABLE_ENTRY];
00118 
00119 #define MAX_CT_EVENTS 32
00120 //     ptl_int_ct_t ptl_ct_events[MAX_CT_EVENTS];
00121     ptl_int_ct_t ptl_ct_cpu_events[MAX_CT_EVENTS];
00122   
00123     trig_cpu* cpu;
00124 
00125     // Need a queue to store triggered operations that have already
00126     // triggered.  We can then process them once every 8ns
00127     std::queue<ptl_int_trig_op_t*> already_triggered_q;
00128   
00129     /*   bool ptlEventHandler(SST::Event *ev); */
00130     /*   std::vector<ptl_ct_event_t*> ct_events; */
00131   
00132     /*   std::map<ptl_handle_me_t,ptl_int_me_t*> me_map; */
00133     ptl_handle_me_t next_handle_me;
00134 
00135     // Data to support multi-packet PIOs
00136     void* pio_start;
00137     int pio_current_offset;
00138     int pio_length_rem;
00139     int pio_dest;
00140     ptl_handle_ct_t pio_ct_handle;
00141 
00142     bool currently_coalescing;
00143 
00144     // Pointer to a trig_nic_event used for TriggeredPutV
00145     bool putv_active;
00146     SST::trig_nic_event* putv_event;
00147     int putv_curr;
00148     
00149 };
00150 
00151 #endif // COMPONENTS_TRIG_CPU_PORTALS_H

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