FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_util.h
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 #ifndef HECMW_UTIL_INCLUDED
7 #define HECMW_UTIL_INCLUDED
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <assert.h>
12 #include <stdarg.h>
13 #include "hecmw_config.h"
14 #include "hecmw_init.h"
15 #include "hecmw_finalize.h"
16 #include "hecmw_malloc.h"
17 #include "hecmw_log.h"
18 #include "hecmw_msg.h"
19 #include "hecmw_lib_fc.h"
20 #include "hecmw_comm.h"
21 #include "hecmw_control.h"
22 #include "hecmw_error.h"
23 #include "hecmw_time.h"
24 
25 #ifndef HECMW_SERIAL
26 #include "mpi.h"
27 #endif
28 
29 #ifdef DEBUG
30 #define HECMW_DEBUG(args) \
31  (HECMW_printerr("DEBUG: "), HECMW_printerr args, HECMW_printerr("\n"))
32 #ifdef HECMW_SERIAL
33 #define HECMW_assert(cond) assert(cond)
34 #else
35 #define HECMW_assert(cond) \
36  HECMW_assert_((cond) ? 1 : 0, #cond, __FILE__, __LINE__)
37 #endif
38 #else
39 #define HECMW_DEBUG(args) ((void)0)
40 #define HECMW_assert(cond) ((void)0)
41 #endif
42 
43 #define HECMW_check_condition(cond, isabort) \
44  HECMW_check_condition_((cond) ? 1 : 0, #cond, isabort, __FILE__, __LINE__);
45 
46 extern void HECMW_fprintf(FILE *fp, char *fmt, ...);
47 
48 extern void HECMW_printerr(char *fmt, ...);
49 
50 extern char *HECMW_get_date(void);
51 
52 extern char *HECMW_get_date_r(char *buf, int len);
53 
54 extern void HECMW_assert_(int cond, char *cond_str, char *file, int line);
55 
56 extern int HECMW_check_condition_(int cond, char *cond_str, int isabort,
57  char *file, int line);
58 
59 extern void HECMW_abort(HECMW_Comm comm);
60 
61 extern char *HECMW_toupper(char *s);
62 
63 extern char *HECMW_tolower(char *s);
64 
65 extern void HECMW_print_error(void);
66 
67 extern void HECMW_print_msg(int loglv, int msgno, const char *fmt, ...);
68 
69 extern void HECMW_print_vmsg(int loglv, int msgno, const char *fmt, va_list ap);
70 
71 extern int HECMW_snprintf(char *msg, size_t size, const char *format, ...);
72 
73 extern int HECMW_vsnprintf(char *msg, size_t size, const char *format,
74  va_list ap);
75 #endif
hecmw_malloc.h
HECMW_assert_
void HECMW_assert_(int cond, char *cond_str, char *file, int line)
Definition: hecmw_util.c:62
hecmw_init.h
HECMW_print_msg
void HECMW_print_msg(int loglv, int msgno, const char *fmt,...)
Definition: hecmw_util.c:138
HECMW_toupper
char * HECMW_toupper(char *s)
Definition: hecmw_util.c:102
hecmw_comm.h
HECMW_print_vmsg
void HECMW_print_vmsg(int loglv, int msgno, const char *fmt, va_list ap)
Definition: hecmw_util.c:126
hecmw_error.h
HECMW_snprintf
int HECMW_snprintf(char *msg, size_t size, const char *format,...)
Definition: hecmw_util.c:153
HECMW_fprintf
void HECMW_fprintf(FILE *fp, char *fmt,...)
Definition: hecmw_util.c:15
HECMW_check_condition_
int HECMW_check_condition_(int cond, char *cond_str, int isabort, char *file, int line)
Definition: hecmw_util.c:73
hecmw_log.h
HECMW_vsnprintf
int HECMW_vsnprintf(char *msg, size_t size, const char *format, va_list ap)
Definition: hecmw_util.c:145
hecmw_config.h
HECMW_get_date_r
char * HECMW_get_date_r(char *buf, int len)
Definition: hecmw_util.c:41
hecmw_msg.h
hecmw_lib_fc.h
HECMW_tolower
char * HECMW_tolower(char *s)
Definition: hecmw_util.c:113
hecmw_time.h
hecmw_finalize.h
HECMW_print_error
void HECMW_print_error(void)
Definition: hecmw_util.c:124
HECMW_abort
void HECMW_abort(HECMW_Comm comm)
Definition: hecmw_util.c:88
HECMW_Comm
MPI_Comm HECMW_Comm
Definition: hecmw_config.h:30
HECMW_printerr
void HECMW_printerr(char *fmt,...)
Definition: hecmw_util.c:22
hecmw_control.h
HECMW_get_date
char * HECMW_get_date(void)
Definition: hecmw_util.c:29