all_to_one_swm_user_code.h 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * =====================================================================================
 *
 *       Filename:  all_to_one_swm_user_code.h
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  12/3/2013 01:05:02 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Nate Andrysco, nathan.r.andrysco@intel.com
 *        Company:  Intel
 *
 * =====================================================================================
 */

#ifndef _ALL_TO_ONE_TEMPLATE_USER_CODE_
#define _ALL_TO_ONE_TEMPLATE_USER_CODE_

Neil McGlohon's avatar
Neil McGlohon committed
22 23
#define SWM_APP_TAG_BASE 0

24 25 26 27 28 29 30 31 32 33 34 35
#include <boost/property_tree/ptree.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/foreach.hpp>

#include <string>
#include <iostream>
#include <random>
#include <algorithm>
#include <vector>
#include <regex>

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#include "swm-include.h"
using namespace std;

class AllToOneSWMUserCode 
{

public:

    AllToOneSWMUserCode(
//        SWMUserIF* user_if,
        boost::property_tree::ptree cfg,
        void**& generic_ptrs
    );

    void call();

protected:
    std::string req_vcs_string;
    std::string rsp_vcs_string;
    uint32_t msg_req_bytes;
    uint32_t msg_rsp_bytes;
    uint32_t pkt_rsp_bytes;
    uint32_t dst_rank_id;

60
    uint32_t process_id;
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
    uint32_t process_cnt;
    uint32_t iteration_cnt;
    uint32_t noop_cnt;
    uint32_t compute_delay;

    std::vector<uint32_t> req_vcs;
    std::vector<uint32_t> rsp_vcs;

    uint32_t min_source_id;
    uint32_t max_source_id;

    // are we staggering the start time of the srcs
    bool scattered_start;

    // if using staggered start delay, this is the max used in the RNG when computing delay
    uint32_t start_delay_max;

    // use isend/irecv instead of synthetic                                                                                                                                   
    bool synchronous;

    // use __ANY__ at the receive side for synchronous                                                                                                                
    bool use_any_src;

    // use blocking (Send/Recv)                                                                                                                              
    bool blocking_comm;

    // for debugging
    bool debug;

};

#endif