1
/*============================================================================
2
* Unit test for some FVM global numbering issues;
3
*============================================================================*/
6
This file is part of Code_Saturne, a general-purpose CFD tool.
8
Copyright (C) 1998-2011 EDF S.A.
10
This program is free software; you can redistribute it and/or modify it under
11
the terms of the GNU General Public License as published by the Free Software
12
Foundation; either version 2 of the License, or (at your option) any later
15
This program is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20
You should have received a copy of the GNU General Public License along with
21
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
22
Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
/*----------------------------------------------------------------------------*/
27
#if defined(HAVE_CONFIG_H)
28
#include "cs_config.h"
35
#include <bft_error.h>
36
#include <bft_printf.h>
38
#include "fvm_config_defs.h"
39
#include "fvm_parall.h"
40
#include "fvm_part_to_block.h"
42
/*---------------------------------------------------------------------------*/
44
/*---------------------------------------------------------------------------*/
47
main (int argc, char *argv[])
50
int rank_id[] = {0, 1024, 2048, 4095};
52
fvm_gnum_t n_g_ents[] = {500, 1100000000, 2200000000,5400000000};
54
fvm_part_to_block_info_t bi;
56
for (i = 0; i < 4; i++) {
61
bft_printf("\ntest for n_g_ents = %llu\n",
62
(unsigned long long)(n_g_ents[i]));
63
for (j = 0; j < 4; j++) {
64
bi = fvm_part_to_block_compute_sizes(rank_id[j],
69
bft_printf("%d/%d [%llu %llu] block step %d, block size %d\n",
70
rank_id[j], n_ranks, (unsigned long long)(bi.gnum_range[0]),
71
(unsigned long long)(bi.gnum_range[1]),
72
(int)(bi.rank_step), (int)(bi.block_size));
75
g_ent_id = n_g_ents[i] - 1;
76
l_rank_id = g_ent_id/bi.block_size * bi.rank_step;
77
bft_printf("\nrank id for ent_id = %llu: %d\n",
78
(unsigned long long)g_ent_id, l_rank_id);