code: def get_grid_dimensions(current_problem_size, params, grid_div, block_size_names):
      
      def get_dimension_divisor(divisor_list, default, params):
          if divisor_list is None:
              if default in params:
                  divisor_list = [default]
              else:
                  return 1
          return numpy.prod([int(eval(replace_param_occurrences(s, params))) for s in divisor_list])
      divisors = [get_dimension_divisor(d, block_size_names[i], params) for i, d in enumerate(grid_div)]
      return tuple(int(numpy.ceil(float(current_problem_size[i]) / float(d))) for i, d in enumerate(divisors))
docs: compute grid dims based on problem sizes and listed grid divisors