Commit 6023ffab authored by Edgar Solomonik's avatar Edgar Solomonik
Browse files

Deleted internal_interface which was stale and never used.

Fixed bug with DPROFILE appearing in a header as pointed out by Evgeny and Khaled, also removed all other ifdefs from header files included externally
parent 25c715ab
......@@ -14,7 +14,6 @@
#include <iostream>
#include <limits.h>
#include "../shared/fompi_wrapper.h"
#include "mpi.h"
/**
......@@ -73,25 +72,6 @@ namespace CTF_int {
type const * cidx_C,
int ** iidx_C);
//latency time per message
#define COST_LATENCY (1.e-6)
//memory bandwidth: time per per byte
#define COST_MEMBW (1.e-9)
//network bandwidth: time per byte
#define COST_NETWBW (5.e-10)
//flop cost: time per flop
#define COST_FLOP (2.e-11)
//flop cost: time per flop
#define COST_OFFLOADBW (5.e-10)
//max total virtualization factor for mappings
#define MAX_NVIRT 256
//min total virtualization factor for mappings
// (would be useful if explicit blockwise threading was enabled, which is not currently)
#ifndef MIN_NVIRT
#define MIN_NVIRT 1
#endif
void flops_add(int64_t n);
int64_t get_flops();
......@@ -176,25 +156,6 @@ namespace CTF_int {
};
#ifndef ENABLE_ASSERT
#ifdef DEBUG
#define ENABLE_ASSERT 1
#else
#define ENABLE_ASSERT 0
#endif
#endif
void handler();
#ifndef ASSERT
#if ENABLE_ASSERT
#define ASSERT(...) \
do { if (!(__VA_ARGS__)) CTF_int::handler(); assert(__VA_ARGS__); } while (0)
#else
#define ASSERT(...) do {} while(0 && (__VA_ARGS__))
#endif
#endif
int alloc_ptr(int64_t len, void ** const ptr);
int mst_alloc_ptr(int64_t len, void ** const ptr);
void * alloc(int64_t len);
......
/*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
#ifndef __INTERNAL_INTERFACE_HPP__
#define __INTERNAL_INTERFACE_HPP__
#include "../world/world.h"
#include "../tensor/untyped_tensor.h"
#include "../ctr_seq/untyped_semiring.h"
#include "../ctr_seq/functions.h"
#include "../ctr_comm/ctr_comm.h"
#include "../ctr_comm/sum_tsr.h"
#include "../ctr_comm/scale_tsr.h"
#include "../ctr_comm/strp_tsr.h"
#endif// __INTERNAL_INTERFACE_HPP__
......@@ -156,7 +156,7 @@ namespace CTF {
int incX,
char * Y,
int incY) const {
ASSERT(alpha == NULL);
//assert(alpha == NULL);
for (int64_t i=0; i<n; i++){
add(X+sizeof(dtype)*i*incX,Y+sizeof(dtype)*i*incY,Y+sizeof(dtype)*i*incY);
}
......
......@@ -91,13 +91,13 @@ namespace CTF {
double cast_to_double(char const * c) const {
printf("CTF ERROR: double cast not possible for this algebraic structure\n");
ASSERT(0);
assert(0);
return 0.0;
}
int64_t cast_to_int(char const * c) const {
printf("CTF ERROR: int cast not possible for this algebraic structure\n");
ASSERT(0);
assert(0);
return 0;
}
......
......@@ -55,19 +55,7 @@ namespace CTF {
char const * name,
int const profile,
CTF_int::algstrct const & sr_)
: CTF_int::tensor(&sr_, order, len, sym, &world, 0, name, profile) {
CTF_int::tensor::set_distribution(idx, prl, blk);
this->data = (char*)CTF_int::alloc(this->size*this->sr->el_size);
this->sr->set(this->data, this->sr->addid(), this->size);
#ifdef HOME_CONTRACT
this->home_size = this->size;
this->is_home = 1;
this->has_home = 1;
this->home_buffer = this->data;
#else
this->has_home = 0;
#endif
}
: CTF_int::tensor(&sr_, order, len, sym, &world, name, profile) { }
template<typename dtype, bool is_ord>
Tensor<dtype, is_ord>::Tensor(tensor const & A,
......
......@@ -441,7 +441,7 @@ namespace CTF_int {
delete pop_B;
}
{
ASSERT(tmp_ops.size() == 2);
assert(tmp_ops.size() == 2);
Term * pop_A = tmp_ops.back();
tmp_ops.pop_back();
Term * pop_B = tmp_ops.back();
......@@ -545,7 +545,7 @@ namespace CTF_int {
delete pop_B;
}
{
ASSERT(tmp_ops.size() == 2);
assert(tmp_ops.size() == 2);
Term * pop_A = tmp_ops.back();
tmp_ops.pop_back();
Term * pop_B = tmp_ops.back();
......
......@@ -29,7 +29,7 @@ namespace CTF_int {
} else if (A == NULL || B == NULL) {
return false;
}
ASSERT(0);//FIXME
assert(0);//FIXME
//return A->tid < B->tid;
return -1;
}
......
......@@ -68,12 +68,10 @@ namespace CTF {
*/
class Timer_epoch{
private:
#ifdef PROFILE
Timer * tmr_inner;
Timer * tmr_outer;
double save_excl_time;
double save_complete_time;
#endif
std::vector<Function_timer> saved_function_timers;
public:
char const * name;
......
......@@ -21,10 +21,49 @@ volatile static int64_t int64_t_max = INT64_MAX;
*/
#include "int_timer.h"
#include "pmpi.h"
#include "fompi_wrapper.h"
namespace CTF_int {
//latency time per message
#define COST_LATENCY (1.e-6)
//memory bandwidth: time per per byte
#define COST_MEMBW (1.e-9)
//network bandwidth: time per byte
#define COST_NETWBW (5.e-10)
//flop cost: time per flop
#define COST_FLOP (2.e-11)
//flop cost: time per flop
#define COST_OFFLOADBW (5.e-10)
//max total virtualization factor for mappings
#define MAX_NVIRT 256
//min total virtualization factor for mappings
// (would be useful if explicit blockwise threading was enabled, which is not currently)
#ifndef MIN_NVIRT
#define MIN_NVIRT 1
#endif
#ifndef ENABLE_ASSERT
#ifdef DEBUG
#define ENABLE_ASSERT 1
#else
#define ENABLE_ASSERT 0
#endif
#endif
void handler();
#ifndef ASSERT
#if ENABLE_ASSERT
#define ASSERT(...) \
do { if (!(__VA_ARGS__)) CTF_int::handler(); assert(__VA_ARGS__); } while (0)
#else
#define ASSERT(...) do {} while(0 && (__VA_ARGS__))
#endif
#endif
/* Force redistributions always by setting to 1 */
#define REDIST 0
//#define VERIFY 0
......
......@@ -72,6 +72,31 @@ namespace CTF_int {
this->init(sr_, order,edge_len,sym,wrld,alloc_data,name,profile);
}
tensor::tensor(algstrct const * sr,
int order,
int const * edge_len,
int const * sym,
CTF::World * wrld,
char const * idx,
CTF::Idx_Partition const & prl,
CTF::Idx_Partition const & blk,
char const * name,
bool profile){
this->init(sr, order,edge_len,sym,wrld,0,name,profile);
set_distribution(idx, prl, blk);
this->data = (char*)CTF_int::alloc(this->size*this->sr->el_size);
this->sr->set(this->data, this->sr->addid(), this->size);
#ifdef HOME_CONTRACT
this->home_size = this->size;
this->has_home = 1;
this->is_home = 1;
this->home_buffer = this->data;
#else
this->has_home = 0;
#endif
}
tensor::tensor(tensor const * other, bool copy, bool alloc_data){
char * nname = (char*)alloc(strlen(other->name) + 2);
char d[] = "\'";
......
......@@ -135,6 +135,7 @@ namespace CTF_int {
/** \brief destructor */
void free_self();
/**
* \brief defines a tensor object with some mapping (if alloc_data)
* \param[in] sr defines the tensor arithmetic for this tensor
......@@ -142,6 +143,7 @@ namespace CTF_int {
* \param[in] edge_len edge lengths of tensor
* \param[in] sym symmetries of tensor (e.g. symmetric matrix -> sym={SY, NS})
* \param[in] wrld a distributed context for the tensor to live in
* \param[in] alloc_data whether to allocate and set data to zero immediately
* \param[in] name_ an optionary name for the tensor
* \param[in] profile set to 1 to profile contractions involving this tensor
*/
......@@ -154,6 +156,30 @@ namespace CTF_int {
char const * name=NULL,
bool profile=1);
/**
* \brief defines a tensor object with some mapping (if alloc_data)
* \param[in] sr defines the tensor arithmetic for this tensor
* \param[in] order number of dimensions of tensor
* \param[in] edge_len edge lengths of tensor
* \param[in] sym symmetries of tensor (e.g. symmetric matrix -> sym={SY, NS})
* \param[in] wrld a distributed context for the tensor to live in
* \param[in] idx assignment of characters to each dim
* \param[in] prl mesh processor topology with character labels
* \param[in] blk local blocking with processor labels
* \param[in] name_ an optionary name for the tensor
* \param[in] profile set to 1 to profile contractions involving this tensor
*/
tensor(algstrct const * sr,
int order,
int const * edge_len,
int const * sym,
CTF::World * wrld,
char const * idx,
CTF::Idx_Partition const & prl,
CTF::Idx_Partition const & blk,
char const * name=NULL,
bool profile=1);
/**
* \brief creates tensor copy, unfolds other if other is folded
* \param[in] other tensor to copy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment