FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_partitioner.c
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright (c) 2019 FrontISTR Commons
3 * This software is released under the MIT License, see LICENSE.txt
4 *****************************************************************************/
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <string.h>
9#include <assert.h>
10#include <errno.h>
11
12#include "hecmw_util.h"
13#include "hecmw_io.h"
15#include "hecmw_partition.h"
16
17int main(int argc, char **argv) {
18 struct hecmwST_local_mesh *global_mesh = NULL;
19 struct hecmwST_local_mesh *local_mesh = NULL;
20 int rtc;
21
22 rtc = HECMW_init(&argc, &argv);
23 if (rtc != 0) goto error;
24
25 rtc = HECMW_init_for_partition(argc, argv);
26 if (rtc != 0) goto error;
27
28 HECMW_log(HECMW_LOG_INFO, "Reading mesh file...");
29 global_mesh = HECMW_get_mesh("part_in");
30 if (global_mesh == NULL) goto error;
31
32 local_mesh = HECMW_partition(global_mesh);
33 if (local_mesh == NULL) goto error;
34
35 HECMW_dist_free(global_mesh);
36
38
39 return 0;
40
41error:
42 HECMW_dist_free(global_mesh);
45
46 return -1;
47}
HECMW_Comm HECMW_comm_get_comm(void)
Definition: hecmw_comm.c:699
void HECMW_dist_free(struct hecmwST_local_mesh *mesh)
int HECMW_finalize(void)
Definition: hecmw_finalize.c:9
int HECMW_init(int *argc, char ***argv)
Definition: hecmw_init.c:24
int HECMW_init_for_partition(int argc, char **argv)
struct hecmwST_local_mesh * HECMW_get_mesh(char *name_ID)
#define NULL
int HECMW_log(int loglv, const char *fmt,...)
Definition: hecmw_log.c:260
#define HECMW_LOG_INFO
Definition: hecmw_log.h:19
struct hecmwST_local_mesh * HECMW_partition(struct hecmwST_local_mesh *global_mesh)
void HECMW_abort(HECMW_Comm comm)
Definition: hecmw_util.c:88
int main()
Definition: varray_test.c:10