Skip to content
Snippets Groups Projects
Commit 1d77e82d authored by Stephan Schulz's avatar Stephan Schulz
Browse files

add setMethodData for Histogram method to Fortran interface (#18)

parent 80d1886b
Branches
Tags
1 merge request!8Refactor
Pipeline #52688 failed
...@@ -162,6 +162,8 @@ void all_setup_c(ALL::ALL<double, double> *all_obj) { ...@@ -162,6 +162,8 @@ void all_setup_c(ALL::ALL<double, double> *all_obj) {
ALL_catch ALL_catch
} }
void all_set_method_data_histogram_c(ALL::ALL<double, double> *all_obj, int *nbins) { all_obj->setMethodData(nbins); }
// wrapper to call balance routine // wrapper to call balance routine
void all_balance_c(ALL::ALL<double, double> *all_obj) { void all_balance_c(ALL::ALL<double, double> *all_obj) {
ALL_try ALL_try
......
...@@ -125,6 +125,11 @@ module ALL_module ...@@ -125,6 +125,11 @@ module ALL_module
integer(c_int), value :: dim integer(c_int), value :: dim
real(c_double), dimension(dim) :: size real(c_double), dimension(dim) :: size
end subroutine end subroutine
subroutine all_set_method_data_histogram_c(obj, nbins) bind(C)
use iso_c_binding
type(c_ptr), value :: obj
integer(c_int), dimension(3) :: nbins
end subroutine
subroutine ALL_setup_c(obj) bind(C) subroutine ALL_setup_c(obj) bind(C)
use iso_c_binding use iso_c_binding
type(c_ptr), value :: obj type(c_ptr), value :: obj
...@@ -205,6 +210,7 @@ module ALL_module ...@@ -205,6 +210,7 @@ module ALL_module
procedure :: set_communicator => ALL_set_communicator_int procedure :: set_communicator => ALL_set_communicator_int
#endif #endif
procedure :: set_sys_size => ALL_set_sys_size procedure :: set_sys_size => ALL_set_sys_size
procedure :: set_method_data_histgram => ALL_set_method_data_histgram
procedure :: setup => ALL_setup procedure :: setup => ALL_setup
procedure :: balance => ALL_balance procedure :: balance => ALL_balance
procedure :: get_gamma => ALL_get_gamma procedure :: get_gamma => ALL_get_gamma
...@@ -231,6 +237,7 @@ module ALL_module ...@@ -231,6 +237,7 @@ module ALL_module
public :: ALL_set_vertices public :: ALL_set_vertices
public :: ALL_set_communicator public :: ALL_set_communicator
public :: ALL_set_sys_size public :: ALL_set_sys_size
public :: ALL_set_method_data_histgram
public :: ALL_setup public :: ALL_setup
public :: ALL_balance public :: ALL_balance
public :: ALL_get_gamma public :: ALL_get_gamma
...@@ -352,6 +359,12 @@ contains ...@@ -352,6 +359,12 @@ contains
#endif #endif
call all_set_sys_size_c(this%object, syssize, size(syssize)) call all_set_sys_size_c(this%object, syssize, size(syssize))
end subroutine end subroutine
!> Set number of bins for histogram method
subroutine ALL_set_method_data_histgram(this, nbins)
class(ALL_t), intent(in) :: this
integer(c_int), dimension(3), intent(in) :: nbins !< Number of bins per dimension
call all_set_method_data_histogram_c(this%object, nbins)
end subroutine
!> Set up the loadbalancer !> Set up the loadbalancer
subroutine ALL_setup(this) subroutine ALL_setup(this)
class(ALL_t), intent(in) :: this class(ALL_t), intent(in) :: this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment