From a87301f5e2236b9b1d11a11b29dddf1edd50bef2 Mon Sep 17 00:00:00 2001 From: Rafael Sachetto Date: Thu, 16 Nov 2023 09:58:10 -0300 Subject: [PATCH] Code simplification. --- src/domains_library/domain.c | 2 -- src/linear_system_solver_library/gpu_solvers_cublas_11.c | 1 - src/linear_system_solver_library/gpu_solvers_cublas_12.c | 1 - src/main_expand_scar.c | 1 - 4 files changed, 5 deletions(-) diff --git a/src/domains_library/domain.c b/src/domains_library/domain.c index 50912689..e9fc51a6 100644 --- a/src/domains_library/domain.c +++ b/src/domains_library/domain.c @@ -328,7 +328,6 @@ SET_CUSTOM_DATA_FOR_MESH(generic_custom_data) { memcpy(cell->mesh_extra_info, custom_data, size); } - SET_SPATIAL_DOMAIN(initialize_grid_with_custom_mesh) { char *mesh_file = NULL; @@ -355,7 +354,6 @@ SET_SPATIAL_DOMAIN(initialize_grid_with_custom_mesh) { ret = (int) set_custom_mesh_from_file(the_grid, mesh_file, total_number_mesh_points, start_h, 0, NULL); } else { ret = (int) set_custom_mesh_from_file(the_grid, mesh_file, total_number_mesh_points, start_h, num_extra_fields, generic_custom_data); - } free(mesh_file); diff --git a/src/linear_system_solver_library/gpu_solvers_cublas_11.c b/src/linear_system_solver_library/gpu_solvers_cublas_11.c index 652df3a0..a1f72969 100644 --- a/src/linear_system_solver_library/gpu_solvers_cublas_11.c +++ b/src/linear_system_solver_library/gpu_solvers_cublas_11.c @@ -330,7 +330,6 @@ SOLVE_LINEAR_SYSTEM(gpu_conjugate_gradient) { check_cuda_error(cusparseSpMV(persistent_data->cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE, &alpha, persistent_data->matA, persistent_data->vecp, &beta, persistent_data->vecAx, CUDA_R_32F, CUSPARSE_MV_ALG_DEFAULT, persistent_data->buffer)); cublasSdot(persistent_data->cublasHandle, N, persistent_data->d_p, 1, persistent_data->d_Ax, 1, &dot); - cublasSdot(persistent_data->cublasHandle, N, persistent_data->d_p, 1, persistent_data->d_Ax, 1, &dot); a = r1 / dot; cublasSaxpy(persistent_data->cublasHandle, N, &a, persistent_data->d_p, 1, persistent_data->d_x, 1); diff --git a/src/linear_system_solver_library/gpu_solvers_cublas_12.c b/src/linear_system_solver_library/gpu_solvers_cublas_12.c index 381c020a..8bc2c5c0 100644 --- a/src/linear_system_solver_library/gpu_solvers_cublas_12.c +++ b/src/linear_system_solver_library/gpu_solvers_cublas_12.c @@ -204,7 +204,6 @@ SOLVE_LINEAR_SYSTEM(gpu_conjugate_gradient) { cublasSdot(persistent_data->cublasHandle, N, persistent_data->d_p, 1, persistent_data->d_Ax, 1, &dot); - cublasSdot(persistent_data->cublasHandle, N, persistent_data->d_p, 1, persistent_data->d_Ax, 1, &dot); a = r1 / dot; cublasSaxpy(persistent_data->cublasHandle, N, &a, persistent_data->d_p, 1, persistent_data->d_x, 1); diff --git a/src/main_expand_scar.c b/src/main_expand_scar.c index c686a887..63145cc2 100644 --- a/src/main_expand_scar.c +++ b/src/main_expand_scar.c @@ -114,7 +114,6 @@ static void expand_scar(const char *input, const char *output, int n_rows, char* for (int i = 0; i < n_rows; i++) { - FOR_EACH_CELL(grid) { cell->visited = false; }