Commit 927bf949 authored by Milan Jaros's avatar Milan Jaros

clean code

parent 69c03ef6
/*
* Copyright 2011-2019 IT4Innovations National Supercomputing Center, VSB-Technical University of Ostrava
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
#include "client_statistics.h"
#include <map>
#include <string>
#include <cstdio>
#include <iostream>
//struct cmp_str
//{
// bool operator()(char const *a, char const *b) const
// {
// return std::strcmp(a, b) < 0;
// }
//};
//
//map<char *, int, cmp_str> BlahBlah;
std::map<std::string, size_t> stat_map_string;
void client_statistics_fetch(const char *name) {
std::string skey(name);
#pragma omp critical
{
stat_map_string[skey]++;
}
}
std::map<int, size_t> stat_map_int;
void client_statistics_fetch(int id) {
#pragma omp critical
{
stat_map_int[id]++;
}
}
void client_statistics_print() {
// show content:
for (std::map<std::string, size_t>::iterator it=stat_map_string.begin(); it!=stat_map_string.end(); ++it)
std::cout << it->first << " => " << it->second << '\n';
for (std::map<int, size_t>::iterator it=stat_map_int.begin(); it!=stat_map_int.end(); ++it)
std::cout << it->first << " => " << it->second << '\n';
}
/*
* Copyright 2011-2019 IT4Innovations National Supercomputing Center, VSB-Technical University of Ostrava
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
#ifndef __CLIENT_STATISTICS_H__
#define __CLIENT_STATISTICS_H__
void client_statistics_fetch(const char *name);
void client_statistics_fetch(int id);
void client_statistics_print();
#endif /* __CLIENT_STATISTICS_H__ */
\ No newline at end of file
......@@ -19,17 +19,12 @@ set(INC
set(SRC
../../intern/cycles/util/util_guarded_allocator.cpp
../../intern/cycles/kernel/kernels/client/kernel_client.cpp
#../../intern/cycles/render/coverage.cpp
../api/client_statistics.cpp
kernel_omp.cpp
kernel_mic.cpp
kernel_acc.cpp
cycles_client.cpp
)
add_definitions(-DBLENDER_CLIENT)
add_definitions(-DBLENDER_CLIENT_STATISTICS)
if(WITH_CPU_SSE)
add_definitions(
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -19,10 +19,6 @@
#include "client_api.h"
#include "cycles_client.h"
#include <omp.h>
//#include <sys/sysinfo.h>
#ifdef BLENDER_CLIENT_STATISTICS
# include "client_statistics.h"
#endif
#if defined(WITH_CLIENT_MPI) || defined(WITH_CLIENT_MPI_SOCKET) || defined(WITH_CLIENT_MPI_FILE)
# include <mpi.h>
......@@ -35,8 +31,6 @@ int main(int argc, char **argv)
int world_size = 1;
#if defined(WITH_CLIENT_MPI) || defined(WITH_CLIENT_MPI_SOCKET) || defined(WITH_CLIENT_MPI_FILE)
// int provided;
// MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided);
MPI_Init(&argc, &argv);
// Get the number of processes
......@@ -59,8 +53,6 @@ int main(int argc, char **argv)
world_rank,
world_size);
fflush(0);
// mpi_print_memory(world_rank);
}
#endif
......@@ -81,11 +73,6 @@ int main(int argc, char **argv)
if (data.client_tag == CLIENT_TAG_CYCLES_path_trace && data.world_rank == 0) {
client_save_buffer(data);
#ifdef BLENDER_CLIENT_STATISTICS
client_statistics_print();
#endif
// fflush(0);
}
if (client_break_loop(data))
......
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