|
@@ -98,7 +98,7 @@ size_t size;
|
|
|
|
|
|
|
|
static inline void stat_init()
|
|
static inline void stat_init()
|
|
|
{
|
|
{
|
|
|
- starpu_pthread_mutex_init(&_ft_stats_mutex, NULL);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_INIT(&_ft_stats_mutex, NULL);
|
|
|
size_sample_list_init(&cp_data_in_memory_list);
|
|
size_sample_list_init(&cp_data_in_memory_list);
|
|
|
cp_data_msgs_sent_count = 0;
|
|
cp_data_msgs_sent_count = 0;
|
|
|
cp_data_msgs_sent_total_size = 0;
|
|
cp_data_msgs_sent_total_size = 0;
|
|
@@ -122,73 +122,73 @@ static inline void stat_init()
|
|
|
static inline void _starpu_ft_stats_send_data(size_t size)
|
|
static inline void _starpu_ft_stats_send_data(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_sent_count++;
|
|
cp_data_msgs_sent_count++;
|
|
|
cp_data_msgs_sent_total_size+=size;
|
|
cp_data_msgs_sent_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_cancel_send_data(size_t size)
|
|
static inline void _starpu_ft_stats_cancel_send_data(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_sent_count--;
|
|
cp_data_msgs_sent_count--;
|
|
|
cp_data_msgs_sent_total_size-=size;
|
|
cp_data_msgs_sent_total_size-=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_send_data_cached(size_t size)
|
|
static inline void _starpu_ft_stats_send_data_cached(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_sent_cached_count++;
|
|
cp_data_msgs_sent_cached_count++;
|
|
|
cp_data_msgs_sent_cached_total_size+=size;
|
|
cp_data_msgs_sent_cached_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_recv_data(size_t size)
|
|
static inline void _starpu_ft_stats_recv_data(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_received_count++;
|
|
cp_data_msgs_received_count++;
|
|
|
cp_data_msgs_received_total_size+=size;
|
|
cp_data_msgs_received_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_cancel_recv_data(size_t size)
|
|
static inline void _starpu_ft_stats_cancel_recv_data(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_received_count--;
|
|
cp_data_msgs_received_count--;
|
|
|
cp_data_msgs_received_total_size-=size;
|
|
cp_data_msgs_received_total_size-=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_recv_data_cached(size_t size)
|
|
static inline void _starpu_ft_stats_recv_data_cached(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_msgs_received_cached_count++;
|
|
cp_data_msgs_received_cached_count++;
|
|
|
cp_data_msgs_received_cached_total_size+=size;
|
|
cp_data_msgs_received_cached_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_service_msg_send(size_t size)
|
|
static inline void _starpu_ft_stats_service_msg_send(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
ft_service_msgs_sent_count++;
|
|
ft_service_msgs_sent_count++;
|
|
|
ft_service_msgs_sent_total_size+=size;
|
|
ft_service_msgs_sent_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_service_msg_recv(size_t size)
|
|
static inline void _starpu_ft_stats_service_msg_recv(size_t size)
|
|
|
{
|
|
{
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
ft_service_msgs_received_count++;
|
|
ft_service_msgs_received_count++;
|
|
|
ft_service_msgs_received_total_size+=size;
|
|
ft_service_msgs_received_total_size+=size;
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_add_cp_data_in_memory(size_t size)
|
|
static inline void _starpu_ft_stats_add_cp_data_in_memory(size_t size)
|
|
@@ -196,7 +196,7 @@ static inline void _starpu_ft_stats_add_cp_data_in_memory(size_t size)
|
|
|
size_t tmp;
|
|
size_t tmp;
|
|
|
struct size_sample *tmp_sample, *sample = malloc(sizeof(struct size_sample));
|
|
struct size_sample *tmp_sample, *sample = malloc(sizeof(struct size_sample));
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
cp_data_in_memory_size_total+=size;
|
|
cp_data_in_memory_size_total+=size;
|
|
|
tmp_sample = size_sample_list_back(&cp_data_in_memory_list);
|
|
tmp_sample = size_sample_list_back(&cp_data_in_memory_list);
|
|
|
tmp = (NULL==tmp_sample?0:tmp_sample->size);
|
|
tmp = (NULL==tmp_sample?0:tmp_sample->size);
|
|
@@ -207,7 +207,7 @@ static inline void _starpu_ft_stats_add_cp_data_in_memory(size_t size)
|
|
|
}
|
|
}
|
|
|
sample->size = tmp;
|
|
sample->size = tmp;
|
|
|
size_sample_list_push_back(&cp_data_in_memory_list, sample);
|
|
size_sample_list_push_back(&cp_data_in_memory_list, sample);
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _starpu_ft_stats_free_cp_data_in_memory(size_t size)
|
|
static inline void _starpu_ft_stats_free_cp_data_in_memory(size_t size)
|
|
@@ -215,12 +215,12 @@ static inline void _starpu_ft_stats_free_cp_data_in_memory(size_t size)
|
|
|
size_t tmp;
|
|
size_t tmp;
|
|
|
struct size_sample* sample = malloc(sizeof(struct size_sample));
|
|
struct size_sample* sample = malloc(sizeof(struct size_sample));
|
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
STARPU_ASSERT_MSG(size != -1, "Cannot count a data of size -1. An error has occured.\n");
|
|
|
- starpu_pthread_mutex_lock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_LOCK(&_ft_stats_mutex);
|
|
|
tmp = size_sample_list_back(&cp_data_in_memory_list)->size;
|
|
tmp = size_sample_list_back(&cp_data_in_memory_list)->size;
|
|
|
tmp-=size;
|
|
tmp-=size;
|
|
|
sample->size = tmp;
|
|
sample->size = tmp;
|
|
|
size_sample_list_push_back(&cp_data_in_memory_list, sample);
|
|
size_sample_list_push_back(&cp_data_in_memory_list, sample);
|
|
|
- starpu_pthread_mutex_unlock(&_ft_stats_mutex);
|
|
|
|
|
|
|
+ STARPU_PTHREAD_MUTEX_UNLOCK(&_ft_stats_mutex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void _ft_stats_free_cp_data_in_memory_list()
|
|
static inline void _ft_stats_free_cp_data_in_memory_list()
|