552216f9ba
Passed the below set of symbols into a script that added ompi_ to them all. Note that if processing a symbol named "foo" the script turns foo into ompi_foo but doesn't turn foobar into ompi_foobar But beyond that the script is blind to C syntax, so it hits strings and comments etc as well as vars/functions. coll_base_comm_get_reqs comm_allgather_pml comm_allreduce_pml comm_bcast_pml fcoll_base_coll_allgather_array fcoll_base_coll_allgatherv_array fcoll_base_coll_bcast_array fcoll_base_coll_gather_array fcoll_base_coll_gatherv_array fcoll_base_coll_scatterv_array fcoll_base_sort_iovec mpit_big_lock mpit_init_count mpit_lock mpit_unlock netpatterns_base_err netpatterns_base_verbose netpatterns_cleanup_narray_knomial_tree netpatterns_cleanup_recursive_doubling_tree_node netpatterns_cleanup_recursive_knomial_allgather_tree_node netpatterns_cleanup_recursive_knomial_tree_node netpatterns_init netpatterns_register_mca_params netpatterns_setup_multinomial_tree netpatterns_setup_narray_knomial_tree netpatterns_setup_narray_tree netpatterns_setup_narray_tree_contigous_ranks netpatterns_setup_recursive_doubling_n_tree_node netpatterns_setup_recursive_doubling_tree_node netpatterns_setup_recursive_knomial_allgather_tree_node netpatterns_setup_recursive_knomial_tree_node pml_v_output_close pml_v_output_open intercept_extra_state_t odls_base_default_wait_local_proc _event_debug_mode_on _evthread_cond_fns _evthread_id_fn _evthread_lock_debugging_enabled _evthread_lock_fns cmd_line_option_t cmd_line_param_t crs_base_self_checkpoint_fn crs_base_self_continue_fn crs_base_self_restart_fn event_enable_debug_output event_global_current_base_ event_module_include eventops sync_wait_mt trigger_user_inc_callback var_type_names var_type_sizes Signed-off-by: Mark Allen <markalle@us.ibm.com>
103 строки
2.9 KiB
C
103 строки
2.9 KiB
C
/*
|
|
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
|
|
* All rights reserved.
|
|
* Copyright (c) 2017 IBM Corporation. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#ifndef PML_V_OUTPUT_H_HAS_BEEN_INCLUDED
|
|
#define PML_V_OUTPUT_H_HAS_BEEN_INCLUDED
|
|
|
|
#include "opal/util/output.h"
|
|
#include "opal_stdint.h"
|
|
#include <stdio.h>
|
|
#include "pml_v.h"
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
int ompi_pml_v_output_open(char *output, int verbosity);
|
|
void ompi_pml_v_output_close(void);
|
|
|
|
static inline void V_OUTPUT_ERR(const char *fmt, ... ) __opal_attribute_format__(__printf__, 1, 2);
|
|
static inline void V_OUTPUT_ERR(const char *fmt, ... )
|
|
{
|
|
va_list list;
|
|
char *str;
|
|
int ret;
|
|
va_start(list, fmt);
|
|
ret = vasprintf(&str, fmt, list);
|
|
assert(-1 != ret);
|
|
(void)ret; // silence compiler warning
|
|
opal_output(0, "%s", str);
|
|
free(str);
|
|
va_end(list);
|
|
}
|
|
|
|
/* Tricky stuff to define V_OUTPUT and V_OUTPUT_VERBOSE with variadic arguments
|
|
*/
|
|
#if defined(ACCEPT_C99)
|
|
# define V_OUTPUT(ARGS...) \
|
|
OPAL_OUTPUT((pml_v_output, __VA_ARGS__))
|
|
# define V_OUTPUT_VERBOSE(V, ARGS...) \
|
|
OPAL_OUTPUT_VERBOSE((V, mca_pml_v.output, __VA_ARGS__))
|
|
|
|
#elif defined(__GNUC__) && !defined(__STDC__)
|
|
# define V_OUTPUT(ARGS...) \
|
|
OPAL_OUTPUT((pml_v_output, ARGS))
|
|
# define V_OUTPUT_VERBOSE(V, ARGS...) \
|
|
OPAL_OUTPUT_VERBOSE((V, mca_pml_v.output, ARGS))
|
|
|
|
#elif OPAL_ENABLE_DEBUG
|
|
/* No variadic macros available... So sad */
|
|
static inline void V_OUTPUT(const char* fmt, ... ) __opal_attribute_format__(__printf__, 1, 2);
|
|
static inline void V_OUTPUT(const char* fmt, ... )
|
|
{
|
|
va_list list;
|
|
char *str;
|
|
int ret;
|
|
va_start(list, fmt);
|
|
ret = vasprintf(&str, fmt, list);
|
|
assert(-1 != ret);
|
|
opal_output(mca_pml_v.output, "%s", str);
|
|
free(str);
|
|
va_end(list);
|
|
}
|
|
static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) __opal_attribute_format__(__printf__, 2, 3);
|
|
static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) {
|
|
va_list list;
|
|
char *str;
|
|
int ret;
|
|
va_start(list, fmt);
|
|
ret = vasprintf(&str, fmt, list);
|
|
assert(-1 != ret);
|
|
opal_output_verbose(V, mca_pml_v.output, "%s", str);
|
|
free(str);
|
|
va_end(list);
|
|
}
|
|
|
|
#else /* !DEBUG */
|
|
/* Some compilers complain if we have ... and no corresponding va_start() */
|
|
static inline void V_OUTPUT(const char* fmt, ... ) {
|
|
#if defined(__PGI)
|
|
va_list list;
|
|
va_start(list, fmt);
|
|
va_end(list);
|
|
#endif
|
|
}
|
|
static inline void V_OUTPUT_VERBOSE(int V, const char* fmt, ... ) {
|
|
#if defined(__PGI)
|
|
va_list list;
|
|
va_start(list, fmt);
|
|
va_end(list);
|
|
#endif
|
|
}
|
|
#endif /* DEBUG */
|
|
|
|
END_C_DECLS
|
|
|
|
#endif /* PML_V_OUTPUT_H_HAS_BEEN_INCLUDED */
|