25 #include "pips_config.h"
33 #include "resources.h"
49 { the_commons_object =
gen_once(c, the_commons_object);}
63 { the_pures_object =
gen_once(
f, the_pures_object);}
75 { the_ios_object =
gen_once(
f, the_ios_object);}
115 get_computed_remaps());
127 computed_remaps_object);
150 get_computed_remaps());
155 include_entities_object =
gen_once(e, include_entities_object),
178 init_computed_remaps();
189 get_computed_remaps(),
203 reset_computed_remaps();
248 static void close_hpfc_status()
260 close_computed_remaps();
340 init_include_entities();
378 close_include_entities();
464 list included_entities_to_add =
NIL;
468 included_entities_to_add =
CONS(
ENTITY,e,included_entities_to_add);
506 pips_debug(1,
"considering program %s\n", name);
557 #define HPFC_FILTERED_SUFFIX ".hpfc_filtered"
571 while (!feof(
f) && no_directive)
576 if (c==
'!' || c==
'C' || c==
'c' || c==
'*')
578 c = getc(
f);
if (c==
'\n')
continue;
579 c = getc(
f);
if (c==
'\n')
continue;
580 c = getc(
f);
if (c==
'\n')
continue;
581 c = getc(
f);
if (c==
'$') no_directive =
false;
589 pips_debug(1,
"directive for %s: %s\n", name, no_directive?
"NO":
"YES");
591 return !no_directive;
596 string file_name, dir_name, new_name, src_name;
604 pips_debug(1,
"considering module %s\n", name);
608 "PATH=${PATH}:${PIPS_ROOT}/Share ",
610 "cat" :
"hpfc_directives",
611 " < ", src_name,
" > ", dir_name,
"/", new_name, NULL));
637 pips_debug(1,
"considering module %s\n", name);
638 debug_on(
"HPFC_DIRECTIVES_DEBUG_LEVEL");
705 pips_debug(1,
"considering module %s\n", name);
730 pips_debug(2,
"skipping %s compilation\n", name);
772 pips_debug(1,
"considering common %s\n", name);
801 pips_debug(1,
"considering program %s\n", name);
842 pips_debug(1,
"considering program %s\n", name);
869 pips_debug(1,
"considering program %s\n", name);
872 "${HPFC_MAKE:-gmake} make &", NULL));
894 pips_debug(1,
"considering program %s\n", name);
897 "${HPFC_MAKE:-gmake} run &", NULL));
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
static void node(FILE *out, string name)
Build for module name a node and link to its successors.
renaming copy_renaming(renaming p)
RENAMING.
hpfc_status make_hpfc_status(overlapsmap a1, data_status a2, numbers_status a3, entity_status a4, list a5, dynamic_status a6, list a7, list a8, list a9, statement_entities a10)
remapping make_remapping(renaming a1, list a2)
language make_language_fortran(void)
void hpfc_close_dummy_to_prime()
void free_hpfc_current_mappings()
void make_hpfc_current_mappings()
??? used with a temporary hack to differentiate array and templates
void hpfc_init_dummy_to_prime()
struct _newgen_struct_statement_ * statement
void hpf_compiler(statement stat, statement *hoststatp, statement *nodestatp)
what: compile a statement into a host and SPMD node code.
entity host_module
HPFC - Fabien Coelho, May 1993 and later...
void close_dynamic_status()
void set_dynamic_status(dynamic_status d)
void set_similar_mappings_for_updates(void)
void init_dynamic_status()
DYNAMIC STATUS management.
void reset_dynamic_status()
dynamic_status get_dynamic_status()
void set_rw_effects(statement_effects)
void reset_cumulated_references(void)
void reset_out_effects(void)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_out_effects(statement_effects)
void set_cumulated_references(statement_effects)
void set_in_effects(statement_effects)
void reset_in_effects(void)
void reset_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_chunk_undefined_p(c)
#define gen_recurse(start, domain_number, flt, rwt)
statement make_block_statement(list)
Make a block statement from a list of statement.
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define NIL
The empty list (nil in Lisp)
void gen_map(gen_iter_func_t fp, const list l)
list gen_once(const void *vo, list l)
Prepend an item to a list only if it is not already in the list.
list gen_copy_seq(list l)
Copy a list structure.
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
void gen_free_list(list l)
free the spine of the list
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
void * gen_find_eq(const void *item, const list seq)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
#define DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
void store_new_node_variable(entity new, entity old)
void update_object_for_module(void *obj, entity module)
entity_status get_entity_status()
void store_new_host_variable(entity new, entity old)
void set_entity_status(entity_status s)
void close_entity_status()
void init_entity_status()
void reset_entity_status()
#define hpfc_status_reductions(x)
#define remapping_undefined_p(x)
struct _newgen_struct_hpfc_status_ * hpfc_status
#define hpfc_status_pures(x)
#define hpfc_status_ios(x)
#define REMAPPING(x)
REMAPPING.
#define hpfc_status_computed(x)
#define remapping_undefined
#define hpfc_status_numbers_status(x)
#define remapping_referenced(x)
#define hpfc_status_dynamic_status(x)
#define hpfc_status_entity_status(x)
#define hpfc_status_commons(x)
#define hpfc_status_overlapsmap(x)
#define hpfc_status_data_status(x)
#define remapping_renaming(x)
#define HPFC_PACKAGE
local definitions
void kill_statement_number_and_ordering(statement s)
void hpfc_util_error_handler()
removes IF (.TRUE.) THEN and DO X=n, n
void statement_structural_cleaning(statement s)
void make_host_and_node_modules(entity module)
compile.c
#define src(name, suf)
HPFC by Fabien Coelho, May 1993 and later...
void NormalizeCodeForHpfc(statement s)
void NormalizeCommonVariables(entity module, statement stat)
void put_generated_resources_for_common(entity common)
void init_host_and_node_entities()
both host and node modules are initialized with the same declarations than the compiled module,...
void put_generated_resources_for_program(_UNUSED_ string program_name)
void hpfc_compile_error_handler()
void compile_a_special_io_function(entity module)
just copied for the host
void put_generated_resources_for_module(_UNUSED_ statement stat, statement host_stat, statement node_stat)
void compile_a_pure_function(entity module)
simply copied for both host and node...
void reset_hpf_number_status()
void set_hpf_number_status(numbers_status s)
void close_hpf_number_status()
numbers_status get_hpf_number_status()
void NormalizeHpfDeclarations()
void init_hpf_number_status()
STANDARS STATIC MANAGEMENT.
void declaration_with_overlaps_for_module(entity module)
data_status get_data_status()
void set_data_status(data_status s)
#define HOST_TIMEON
special FCD calls.
#define NO_FILE
fake resources...
void hpfc_directives_error_handler()
the local stack is used to retrieve the current statement while scanning the AST with gen_recurse.
void handle_hpf_directives(statement s, bool dyn)
void handle_hpf_directives(s) statement s;
bool hpfc_run(const string name)
bool hpfc_run(string name)
static bool directive_in_file_p(string name)
void add_an_io_function(entity f)
bool hpfc_close(const string name)
bool hpfc_close(string name)
static void save_hpfc_status()
GET them.
static void compile_common(entity c)
static hpfc_status chs
??? some memory leaks in the hpfc_status management...
static bool hpfc_directives_handler(string name, bool dyn)
what: deals with directives.
void add_remapping_as_computed(renaming r, list vars)
variables to be declared
static void automatic_translation(entity old, entity host, entity node)
bool hpfc_make(const string name)
bool hpfc_make(string name)
static void clean_the_code(statement s)
bool hpfc_special_fake(entity f)
static void reset_hpfc_status()
void add_remapping_as_used(renaming x)
static list the_fakes_object
??? to be added to HPFC_STATUS
bool hpfc_dynamic_directives(const string name)
static void compile_module(entity module)
void add_a_common(entity c)
HPFC module by Fabien COELHO.
static void loop_rwt(loop l)
removes DOALL ???
static list added_ahead_of_node_code
??? some quick hack to move bound computations ahead if possible
bool hpfc_compile(const string name)
bool hpfc_compile(string name)
bool hpfc_install(const string name)
bool hpfc_install(string name)
static void hpfc_error_handler(void)
bool hpfc_common(const string name)
bool hpfc_common(string name)
bool hpfc_init(const string name)
bool hpfc_init(string name)
bool hpf_pure_p(entity f)
??? some intrinsics should also be considered as pure.
bool hpfc_filter(const string name)
static void load_hpfc_status()
SET them.
void add_a_pure(entity f)
static void set_resources_for_module(entity module)
bool hpfc_special_io(entity f)
static void init_hpfc_status()
current hpfc status
void add_a_fake_function(entity f)
#define HPFC_FILTERED_SUFFIX
bool hpfc_filter(string name)
void hpfc_add_ahead_of_node_code(statement s)
bool remapping_already_computed_p(renaming x)
list of already computed remappings...
static void reset_resources_for_module()
bool hpfc_static_directives(const string name)
bool fortran_library_entity_p(entity)
entity hpfc_name_to_entity(const char *)
void init_overlap_status(void)
void reset_overlap_status(void)
void init_hpf_reductions(void)
void hpfc_special_cases_error_handler(void)
void close_overlap_status(void)
void set_overlap_status(overlapsmap)
void reset_hpf_reductions(void)
void close_hpf_reductions(void)
void hpfc_init_run_time_entities(void)
to be seen from outside of this file
void free_update_common_map(void)
statement_entities get_hpf_reductions(void)
void set_hpf_reductions(statement_entities)
void free_only_io_map(void)
overlapsmap get_overlap_status(void)
void add_pvm_init_and_end(statement *, statement *)
this is for the main.
void make_update_common_map(void)
void hpfc_io_util_error_handler(void)
??? neglect expression side effects...
void only_io_mapping_initialize(statement)
bool hpfc_entity_reduction_p(entity)
special_cases.c
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
void safe_system(string)
system.c
void reset_hooks_unregister(reset_func_t)
remove registered cleanup hook.
void reset_hooks_register(reset_func_t)
reset_hooks.c
#define MAKE_STATEMENT_MAPPING()
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define GENERIC_GLOBAL_FUNCTION(name, type)
#define GENERIC_STATIC_STATUS(PREFIX, name, type, init, cloze)
void(* gen_iter_func_t)(void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
#define db_get_file_resource
#define WORKSPACE_SRC_SPACE
string db_get_current_workspace_directory(void)
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...
statement_mapping compute_postcondition(statement stat, statement_mapping post_map, statement_mapping pre_map)
statement_mapping compute_postcondition(stat, post_map, pre_map) statement stat; statement_mapping po...
void set_bool_property(const char *, bool)
void set_string_property(const char *, const char *)
#define HPF_PREFIX
moved here because needed by syntax:-(
#define HOSTSECTION_SUFFIX
#define entity_declarations(e)
MISC: newgen shorthands.
#define CONTINUE_FUNCTION_NAME
#define TELL_SUFFIX
suffixes for my own (FCD:-) directives.
#define STOP_FUNCTION_NAME
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
entity make_empty_program(const char *name, language l)
code entity_code(entity e)
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
bool entity_main_module_p(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool hpf_directive_string_p(const char *s)
recognize an hpf directive special entity.
bool hpf_directive_entity_p(entity e)
void reset_unique_variable_numbers(void)
#define loop_execution(x)
#define loop_domain
newgen_language_domain_defined
@ is_execution_sequential
#define STATEMENT(x)
STATEMENT.
void free_postcondition_map(void)
void reset_precondition_map(void)
void set_postcondition_map(statement_mapping)
void set_precondition_map(statement_mapping)
statement_mapping get_precondition_map(void)
The structure used to build lists in NewGen.