include/ff/repara/rprkernels.hpp
/**
 *  Global initialization.
 *  @param program_name the program name
 *  @return the maximum amount of measures that each kernel or pipeline
 *  may store at a given time.
 */
Global initialization.
@param program_name the program name
@return the maximum amount of measures that each kernel or pipeline
may store at a given time.
Global initialization . @param program_name the program name @return the maximum amount of measures that each kernel or pipeline may store at a given time .
static int Setup(const std::string &program_name) {        
#if defined(ENERGY_MEASUREMENT)
#ifdef SCOPE
    static const char DEFAULT_SCOPESERVICE[]    = "http://scopemachine:8080/RPC2";
    char *scopeservice = getenv("SCOPESERVICE");
    if (scopeservice == nullptr) {
        std::cerr << "SCOPESERVICE env variable not set, using default value (" << DEFAULT_SCOPESERVICE << ")\n";    
        setenv("SCOPESERVICE",DEFAULT_SCOPESERVICE, 1);
    } 
#endif
    static char DEFAULT_RMEASURESERVICE[] = "http://localhost:8081/RPC2";
    char *rmeasureservice = getenv("RMEASURESERVICE");
    if (rmeasureservice == nullptr) {
        std::cerr << "RMEASURESERVICE  env variable not set, using default value (" << DEFAULT_RMEASURESERVICE << ")\n";    
        setenv("RMEASURESERVICE",DEFAULT_RMEASURESERVICE, 1);
    }
    char* fifoFile = getenv ("RMEASURE_FIFO");
    if (fifoFile == nullptr) {
        std::cerr << "RMEASURE_FIFO  env variable not set, using default value (" << DEFAULT_FIFO_FILE << ")\n";    
        FIFO_FILE = DEFAULT_FIFO_FILE;
    } else FIFO_FILE = fifoFile;
#endif
    int r = 0;
    DPE(r = rpr::setup(program_name));
    return r;
}
static int Setup ( const std :: string & program_name ) { #if defined ( ENERGY_MEASUREMENT ) #ifdef SCOPE static const char DEFAULT_SCOPESERVICE [ ] = " " ; char * scopeservice = getenv ( " " ) ; if ( scopeservice == nullptr ) { std :: cerr << " " << DEFAULT_SCOPESERVICE << " \n " ; setenv ( " " , DEFAULT_SCOPESERVICE , 1 ) ; } #endif static char DEFAULT_RMEASURESERVICE [ ] = " " ; char * rmeasureservice = getenv ( " " ) ; if ( rmeasureservice == nullptr ) { std :: cerr << " " << DEFAULT_RMEASURESERVICE << " \n " ; setenv ( " " , DEFAULT_RMEASURESERVICE , 1 ) ; } char * fifoFile = getenv ( " " ) ; if ( fifoFile == nullptr ) { std :: cerr << " " << DEFAULT_FIFO_FILE << " \n " ; FIFO_FILE = DEFAULT_FIFO_FILE ; } else FIFO_FILE = fifoFile ; #endif int r = 0 ; DPE ( r = rpr :: setup ( program_name ) ) ; return r ; }
Global initialization.
Global initialization .