PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "resources.h"
#include "database.h"
#include "ri.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "control.h"
#include "misc.h"
#include "syntax.h"
#include "c_syntax.h"
#include "properties.h"
#include "task_parallelization.h"
#include "prettyprint.h"
Go to the source code of this file.
Data Structures | |
struct | ctx_mpi |
return the type for MPI datatype (to make custom datatype for example): MPI_Datatype More... | |
struct | ctx_conv |
Typedefs | |
typedef struct ctx_mpi | ctx_mpi_t |
return the type for MPI datatype (to make custom datatype for example): MPI_Datatype More... | |
typedef struct ctx_conv | ctx_conv_t |
Enumerations | |
enum | mpi_communication_mode { mpi_communication_default_mode , mpi_communication_synchronous_mode , mpi_communication_ready_mode , mpi_communication_buffered_mode } |
Functions | |
static string | mpi_conversion_declaration_commenter (__attribute__((unused)) entity e) |
Pass: MPI_CONVERSION Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used: More... | |
static statement | mpic_make_mpi_comm_size (entity communicator, entity size, entity result) |
Functions to generate standard MPI function statement Can maybe also make function to return MPI function like instruction instead of statement to be more flexible? Only C version are made, for Fortran version, have to add an error manager variable (instead return result in C than represent possible error, add it in call function, cf MPI doc) All these functions can be general and move into a MPI manager? In that case only unstatic function that return statement or type. More... | |
static statement | mpic_make_mpi_comm_rank (entity communicator, entity rank, entity result) |
generate statement: MPI_Comm_rank(communicator, &rank); or result = MPI_Comm_rank(communicator, &rank); More... | |
static statement | mpic_make_mpi_init (entity result, entity argc, entity argv) |
argc and argv must be defined generate statement: MPI_Init(&argc, &argv); or result = MPI_Init(&argc, &argv); More... | |
static statement | mpic_make_mpi_finalize (entity result) |
generate statement: MPI_Finalize(); or result = MPI_Finalize(); More... | |
static list | mpic_make_args_mpi_send_or_receiv (expression buffer, int size, entity mpitype, int ds, int tag, entity communicator, entity status, entity request) |
tatic statement mpifortran_make_mpi_finalize(entity result) { list args = CONS(EXPRESSION, make_entity_expression(result, NIL), NIL); args = gen_nreverse(args); statement mpi_st = make_call_statement(MPI_FINALIZE_FUNCTION_NAME, args, entity_undefined, string_undefined); return mpi_st; } More... | |
static call | mpic_make_generic_mpi_send_call (expression buffer, int size, entity mpitype, int dest, int tag, entity communicator, entity request, enum mpi_communication_mode mode) |
static call | mpic_make_generic_mpi_receive_call (expression buffer, int size, entity mpitype, int dest, int tag, entity communicator, entity status, entity request) |
static statement | mpic_make_mpi_send (expression buffer, int size, entity mpitype, int dest, int tag, entity communicator, entity result) |
generate statement: {result =} MPI_Send(&buffer, size, mpitype, dest, tag, communicator); More... | |
static statement | mpic_make_mpi_isend (expression buffer, int size, entity mpitype, int dest, int tag, entity communicator, entity request, entity result) |
generate statement: {result =} MPI_Isend(&buffer, size, mpitype, dest, tag, communicator, &request); More... | |
static statement | mpic_make_mpi_recv (expression buffer, int size, entity mpitype, int source, int tag, entity communicator, entity status, entity result) |
TODO do the same for MPI_Rsend/Irsend/Bsend/Ibsend/Ssend/Issend. More... | |
static statement | mpic_make_mpi_irecv (expression buffer, int size, entity mpitype, int source, int tag, entity communicator, entity request, entity result) |
generate statement: {result =} MPI_Irecv(&buffer, size, mpitype, source, tag, communicator, &request); More... | |
static type | mpi_type_mpi_comm () |
return the type for MPI communicator: MPI_Comm More... | |
static type | mpi_type_mpi_status () |
return the type for MPI status: MPI_Status More... | |
static type | mpi_type_mpi_request () |
return the type for MPI request: MPI_Request More... | |
static ctx_mpi_t | mpi_make_ctx (entity module) |
static void | mpi_free_ctx (__attribute__((__unused__)) ctx_mpi_t *ctx) |
static statement | mpi_comm_size_ctx (const ctx_mpi_t ctx) |
static statement | mpi_comm_rank_ctx (const ctx_mpi_t ctx) |
static statement | mpi_init_ctx (const ctx_mpi_t ctx) |
static statement | mpi_finalize_ctx (const ctx_mpi_t ctx) |
static statement | mpi_send_ctx (const ctx_mpi_t ctx, expression buffer, int size, int dest, int tag, bool blocking) |
static statement | mpi_recv_ctx (const ctx_mpi_t ctx, expression buffer, int size, int source, int tag, bool blocking) |
TODO do the same for Ssend, Rsend, Bsend. More... | |
static ctx_conv_t | conv_make_ctx (entity module, int nbr_cluster) |
static void | conv_free_ctx (ctx_conv_t *ctx) |
static void | ctx_init (ctx_conv_t *ctx) |
static void | ctx_set_return_statement (ctx_conv_t *ctx, statement rs) |
static statement | ctx_get_return_statement (const ctx_conv_t ctx) |
static void | ctx_set_statement_work_on (ctx_conv_t *ctx, statement st) |
static statement | ctx_get_statement_work_on (const ctx_conv_t ctx) |
static void | ctx_set_send_statement (ctx_conv_t *ctx, statement send) |
static statement | ctx_get_send_statement (ctx_conv_t *ctx) |
static void | ctx_set_receive_statement (ctx_conv_t *ctx, statement receive, int for_cluster) |
static statement | ctx_get_receive_statement (const ctx_conv_t ctx, int for_cluster) |
static bool | ctx_is_blocking (const ctx_conv_t ctx) |
static int | ctx_get_tag (const ctx_conv_t ctx, int sender, int receiver) |
static void | ctx_inc_tag (ctx_conv_t *ctx, int sender, int receiver) |
static statement | ctx_generate_new_statement_cluster_dependant (const ctx_conv_t ctx) |
static void | initilization (statement module_statement, const ctx_conv_t ctx) |
put initialize MPI functions at the beginning of the module_stateent (function): // Generated by Pass MPI_CONVERSION MPI_Status status0; // Generated by Pass MPI_CONVERSION MPI_Request request0; // Generated by Pass MPI_CONVERSION int size0, rank0; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size0); MPI_Comm_rank(MPI_COMM_WORLD, &rank0); More... | |
static void | finalization (statement module_statement, const ctx_conv_t ctx) |
put finalize MPI functions at the end of the module_stateent (function), before the return: MPI_Finalize(); More... | |
static bool | is_distributed_comments (string comments) |
static bool | is_distributed_send_comments (string comments) |
static bool | is_distributed_receive_comments (string comments) |
static int | find_sender_cluster (ctx_conv_t *ctx, __attribute__((__unused__)) statement stat) |
static int | find_receiver_cluster (__attribute__((__unused__)) ctx_conv_t *ctx, statement stat) |
static statement | generate_send_from_statement (ctx_conv_t *ctx, statement stat) |
static statement | generate_receive_from_statement (ctx_conv_t *ctx, statement stat) |
static void | replace_sender_entity_by_receiver_entity_in_reference (reference ref, int *receiv_cluster) |
static bool | sequence_working_false (sequence seq, ctx_conv_t *ctx) |
This function update the receive statements for a sequential statement NB : This function can be put in search_copy_communication; in this case search_copy_communication can return true and false And have to treat the declaration here instead of in make_send_receive_conversion. More... | |
static bool | test_working_false (test t, ctx_conv_t *ctx) |
This function update the receive statements for a test statement NB : This function can be put in search_copy_communication; in this case search_copy_communication can return true and false. More... | |
static bool | search_copy_communication (statement stat, ctx_conv_t *ctx) |
use as filter for gen_context_recurse check if the statement stat will be communication if so, generate the MPI_Send and MPI_Receive corresponding. More... | |
static void | make_send_receive_conversion (statement stat, ctx_conv_t *ctx) |
Update statement that we work on by replace communication assignment by real MPI_send function and compute the corresponding MPI_receiv that must be done. More... | |
static statement | make_mpi_conversion (entity module, statement module_statement) |
bool | mpi_conversion (const char *module_name) |
PIPS pass. More... | |
typedef struct ctx_conv ctx_conv_t |
return the type for MPI datatype (to make custom datatype for example): MPI_Datatype
tatic type mpi_type_MPI_Datatype() { entity req = FindOrCreateEntity(TOP_LEVEL_MODULE_NAME, MPI_DATATYPE); if(storage_undefined_p(entity_storage(req))) { entity_storage(req) = make_storage_rom(); put_new_typedef(MPI_DATATYPE); } type req_t =MakeTypeVariable(make_basic_typedef(req), NIL); if(type_undefined_p(entity_type(req))) { entity_type(req) = ImplicitType(req); } return req_t; } Wrapper to call generic MPI function maker
Enumerator | |
---|---|
mpi_communication_default_mode | |
mpi_communication_synchronous_mode | |
mpi_communication_ready_mode | |
mpi_communication_buffered_mode |
Definition at line 70 of file mpi_conversion.c.
|
static |
Definition at line 679 of file mpi_conversion.c.
References ctx_conv::ctx_mpi, free(), mpi_free_ctx(), ctx_conv::nbr_cluster, ctx_conv::statement_send_receive, and ctx_conv::tag.
Referenced by make_mpi_conversion().
|
static |
Definition at line 646 of file mpi_conversion.c.
References ctx_conv::ctx_mpi, ctx_conv::current_cluster, ctx_conv::current_task, malloc(), module, mpi_make_ctx(), ctx_conv::nbr_cluster, pips_assert, ctx_conv::return_statement, ctx_conv::statement_send_receive, statement_undefined, ctx_conv::statement_work_on, ctx_conv::tag, and task_undefined.
Referenced by make_mpi_conversion().
|
static |
Definition at line 874 of file mpi_conversion.c.
References ctx_conv::ctx_mpi, current, ctx_conv::current_cluster, entity_intrinsic(), entity_to_expression(), EQUAL_OPERATOR_NAME, insert_statement(), int_to_expression(), make_empty_block_statement(), make_test_statement(), MakeBinaryCall(), ctx_conv::nbr_cluster, ctx_mpi::rank, ctx_conv::statement_send_receive, statement_undefined, statement_undefined_p, and ctx_conv::statement_work_on.
Referenced by make_mpi_conversion().
|
static |
Definition at line 820 of file mpi_conversion.c.
References ctx_conv::current_cluster, pips_assert, and ctx_conv::statement_send_receive.
Referenced by make_send_receive_conversion(), sequence_working_false(), and test_working_false().
|
static |
Definition at line 738 of file mpi_conversion.c.
References ctx_conv::return_statement.
Referenced by finalization().
|
static |
Definition at line 809 of file mpi_conversion.c.
References ctx_conv::current_cluster, pips_assert, print_statement(), ctx_conv::statement_send_receive, statement_undefined, and statement_undefined_p.
Referenced by make_send_receive_conversion().
|
static |
Definition at line 766 of file mpi_conversion.c.
References ctx_conv::statement_work_on.
Referenced by make_mpi_conversion(), and make_send_receive_conversion().
|
static |
Definition at line 847 of file mpi_conversion.c.
References ctx_conv::nbr_cluster, pips_assert, and ctx_conv::tag.
Referenced by generate_receive_from_statement(), and generate_send_from_statement().
|
static |
Definition at line 852 of file mpi_conversion.c.
References pips_assert, and ctx_conv::tag.
Referenced by search_copy_communication().
|
static |
Definition at line 701 of file mpi_conversion.c.
References ctx_conv::nbr_cluster, ctx_conv::statement_send_receive, and statement_undefined.
Referenced by ctx_set_statement_work_on().
|
static |
Definition at line 842 of file mpi_conversion.c.
References ctx_conv::current_task, and task_synchronization.
Referenced by generate_receive_from_statement(), and generate_send_from_statement().
|
static |
Definition at line 816 of file mpi_conversion.c.
References ctx_conv::current_cluster, pips_assert, and ctx_conv::statement_send_receive.
Referenced by make_send_receive_conversion(), search_copy_communication(), sequence_working_false(), and test_working_false().
|
static |
Definition at line 732 of file mpi_conversion.c.
References copy_statement(), pips_user_error, ctx_conv::return_statement, and statement_undefined_p.
Referenced by make_mpi_conversion().
|
static |
Definition at line 805 of file mpi_conversion.c.
References ctx_conv::current_cluster, pips_assert, ctx_conv::statement_send_receive, and statement_undefined_p.
Referenced by search_copy_communication().
|
static |
Definition at line 742 of file mpi_conversion.c.
References copy_statement(), ctx_init(), ctx_conv::current_cluster, ctx_conv::current_task, empty_extensions(), free_extensions(), load_parallel_task_mapping(), statement_extensions, ctx_conv::statement_work_on, and task_on_cluster.
Referenced by make_mpi_conversion().
|
static |
put finalize MPI functions at the end of the module_stateent (function), before the return: MPI_Finalize();
Definition at line 940 of file mpi_conversion.c.
References ctx_get_return_statement(), ctx_conv::ctx_mpi, insert_statement(), module_statement, mpi_finalize_ctx(), and statement_undefined_p.
Referenced by make_mpi_conversion().
|
static |
Definition at line 992 of file mpi_conversion.c.
References assignment_statement_p(), call_arguments, CAR, entity_name, EXPRESSION, expression_to_entity(), gen_nreverse(), is_distributed_receive_comments(), pips_assert, statement_call(), statement_comments, STRING, and strsplit().
Referenced by generate_receive_from_statement(), generate_send_from_statement(), and search_copy_communication().
|
static |
Definition at line 977 of file mpi_conversion.c.
References ctx_conv::current_cluster.
Referenced by generate_receive_from_statement(), generate_send_from_statement(), and search_copy_communication().
|
static |
Definition at line 1030 of file mpi_conversion.c.
References assignment_statement_p(), buffer, call_arguments, CAR, copy_expression(), ctx_get_tag(), ctx_is_blocking(), ctx_conv::ctx_mpi, EXPRESSION, expression_undefined, find_receiver_cluster(), find_sender_cluster(), is_distributed_receive_comments(), mpi_recv_ctx(), pips_assert, statement_call(), statement_comments, and statement_undefined.
Referenced by search_copy_communication().
|
static |
Definition at line 1006 of file mpi_conversion.c.
References assignment_statement_p(), buffer, call_arguments, CAR, CDR, copy_expression(), ctx_get_tag(), ctx_is_blocking(), ctx_conv::ctx_mpi, EXPRESSION, expression_undefined, find_receiver_cluster(), find_sender_cluster(), is_distributed_send_comments(), mpi_send_ctx(), pips_assert, statement_call(), statement_comments, and statement_undefined.
Referenced by search_copy_communication().
|
static |
put initialize MPI functions at the beginning of the module_stateent (function): // Generated by Pass MPI_CONVERSION MPI_Status status0; // Generated by Pass MPI_CONVERSION MPI_Request request0; // Generated by Pass MPI_CONVERSION int size0, rank0; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size0); MPI_Comm_rank(MPI_COMM_WORLD, &rank0);
Definition at line 923 of file mpi_conversion.c.
References add_declaration_statement_at_beginning(), ctx_conv::ctx_mpi, insert_statement(), module_statement, mpi_comm_rank_ctx(), mpi_comm_size_ctx(), mpi_conversion_declaration_commenter(), mpi_init_ctx(), ctx_mpi::mpi_request, ctx_mpi::mpi_status, pop_generated_variable_commenter(), push_generated_variable_commenter(), ctx_mpi::rank, and ctx_mpi::size.
Referenced by make_mpi_conversion().
Definition at line 948 of file mpi_conversion.c.
References empty_comments_p().
Referenced by make_send_receive_conversion(), and search_copy_communication().
Definition at line 967 of file mpi_conversion.c.
References empty_comments_p().
Referenced by find_receiver_cluster(), and generate_receive_from_statement().
Definition at line 957 of file mpi_conversion.c.
References empty_comments_p().
Referenced by generate_send_from_statement().
en_null
en_null
Definition at line 1901 of file mpi_conversion.c.
References conv_free_ctx(), conv_make_ctx(), copy_statement(), ctx_generate_new_statement_cluster_dependant(), ctx_get_statement_work_on(), ctx_set_return_statement(), ctx_set_statement_work_on(), declaration_statement_p(), finalization(), FOREACH, free_statement(), gen_context_multi_recurse(), gen_core(), get_int_property(), ifdebug, initilization(), insert_statement(), insert_statement_no_matter_what(), make_empty_block_statement(), make_send_receive_conversion(), module, module_statement, MPI_GENERATION_NBR_CLUSTER, pips_debug, pips_internal_error, print_statement(), return_statement_p(), search_copy_communication(), sequence_domain, sequence_statements, sequence_working_false(), STATEMENT, statement_domain, statement_sequence(), statement_sequence_p(), test_domain, and test_working_false().
Referenced by mpi_conversion().
|
static |
Update statement that we work on by replace communication assignment by real MPI_send function and compute the corresponding MPI_receiv that must be done.
if the statement is a sequence add the declaration for all the receive cluster (that have a receive statement)
if the statement stat is copy statement for communication replace the copy statement by the send communication statement
look the parent statement of the AST to duplicate it for the receiver's clusters the duplication of the AST is only done if there is a receive statement (if (!statement_undefined_p(ctx_get_receive_statement(*ctx, i)))) TODO and potentially modify the AST in case of dynamic flow by adding variable and send/receive of this dynamic value \ (This case can only happen if copy_value_of_write is used, but this compilation process is unsure in many point)
Definition at line 1374 of file mpi_conversion.c.
References add_declaration_statement(), assignment_statement_p(), call_arguments, call_function, call_to_expression(), call_to_statement, CAR, CDR, CONS, copy_expression(), CreateIntrinsic(), ctx_get_receive_statement(), ctx_get_send_statement(), ctx_get_statement_work_on(), ctx_set_receive_statement(), ctx_conv::current_cluster, ENTITY, entity_intrinsic(), entity_to_expression(), entity_undefined, entity_undefined_p, evaluation_before_p, EXPRESSION, expression_call(), expression_consistent_p(), expression_constant_p(), expression_domain, expression_integer_value(), expression_reference(), expression_syntax, expression_to_entity(), expression_to_int(), expression_undefined, expressions_to_operation(), FOREACH, forloop_condition, forloop_increment, forloop_initialization, free_expression(), free_statement(), gen_context_recurse, gen_full_copy_list(), gen_get_ancestor_type, gen_make_list(), gen_nreverse(), gen_true2(), ifdebug, indices, init, instruction_call, instruction_tag, int_to_expression(), integer_constant_expression_p(), intptr_t, is_distributed_comments(), is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_multitest, is_instruction_sequence, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_index, loop_range, make_address_of_expression(), make_assign_statement(), make_block_with_stmt_if_not_already(), make_call(), make_entity_expression(), make_forloop_statement(), make_loop_statement(), make_whileloop_statement(), MINUS_OPERATOR_NAME, mpi_conversion_declaration_commenter(), MPI_SEND_FUNCTION_NAME, ctx_conv::nbr_cluster, NIL, pips_debug, pips_internal_error, PLUS_OPERATOR_NAME, pop_generated_variable_commenter(), print_entity_variable(), print_expression(), print_reference(), print_statement(), print_syntax(), push_generated_variable_commenter(), range_increment, range_lower, range_upper, reference_domain, reference_indices, replace_sender_entity_by_receiver_entity_in_reference(), same_entity_p(), statement_call(), statement_comments, statement_consistent_p(), statement_declarations, statement_domain, statement_forloop(), statement_instruction, statement_loop(), STATEMENT_NUMBER_UNDEFINED, statement_replace_in_root_statement(), statement_sequence_p(), statement_undefined, statement_undefined_p, statement_whileloop(), whileloop_condition, whileloop_evaluation, and zero_expression_p().
Referenced by make_mpi_conversion(), sequence_working_false(), and test_working_false().
Definition at line 554 of file mpi_conversion.c.
References ctx_mpi::error, ctx_mpi::mpi_communicator, mpic_make_mpi_comm_rank(), and ctx_mpi::rank.
Referenced by initilization().
Definition at line 550 of file mpi_conversion.c.
References ctx_mpi::error, ctx_mpi::mpi_communicator, mpic_make_mpi_comm_size(), and ctx_mpi::size.
Referenced by initilization().
bool mpi_conversion | ( | const char * | module_name | ) |
PIPS pass.
Reorder the module, because some statements have been added. Well, the order on the remaining statements should be the same, but by reordering the statements, the number are consecutive. Just for pretty print... :-)
module_name | odule_name |
Definition at line 1989 of file mpi_conversion.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, get_current_module_entity(), get_current_module_statement(), make_mpi_conversion(), module, module_name(), module_name_to_entity(), module_reorder(), module_statement, pips_assert, pips_debug, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_parallel_task_mapping(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_parallel_task_mapping(), statement_consistent_p(), strdup(), and unspaghettify_statement().
|
static |
Pass: MPI_CONVERSION Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used:
Definition at line 63 of file mpi_conversion.c.
References COMMENT_MPI_CONVERSION, and strdup().
Referenced by initilization(), and make_send_receive_conversion().
Definition at line 564 of file mpi_conversion.c.
References ctx_mpi::error, and mpic_make_mpi_finalize().
Referenced by finalization().
|
static |
Definition at line 545 of file mpi_conversion.c.
Referenced by conv_free_ctx().
Definition at line 558 of file mpi_conversion.c.
References entity_domain, ctx_mpi::error, gen_find_tabulated(), and mpic_make_mpi_init().
Referenced by initilization().
urrentOffsetOfArea(area, ctx.mpi_communicator)
Definition at line 517 of file mpi_conversion.c.
References entity_storage, entity_type, entity_undefined, ctx_mpi::error, FindEntity(), FindOrCreateEntity(), is_basic_int, make_new_scalar_variable_with_prefix(), make_ram(), make_storage_ram(), MakeBasic(), module, module_local_name(), module_name(), MPI_COMM_WORLD_STRING, ctx_mpi::mpi_communicator, ctx_mpi::mpi_request, ctx_mpi::mpi_status, mpi_type_mpi_comm(), mpi_type_mpi_request(), mpi_type_mpi_status(), NIL, ctx_mpi::rank, ctx_mpi::size, STACK_AREA_LOCAL_NAME, storage_undefined_p, TOP_LEVEL_MODULE_NAME, and type_undefined_p.
Referenced by conv_make_ctx().
|
static |
TODO do the same for Ssend, Rsend, Bsend.
Definition at line 595 of file mpi_conversion.c.
References basic_tag, basic_to_string(), buffer, entity_type, entity_undefined, ctx_mpi::error, expression_to_entity(), is_basic_float, is_basic_int, is_basic_string, make_constant_entity(), ctx_mpi::mpi_communicator, ctx_mpi::mpi_request, ctx_mpi::mpi_status, mpic_make_mpi_irecv(), mpic_make_mpi_recv(), pips_user_warning, type_variable, and variable_basic.
Referenced by generate_receive_from_statement().
|
static |
Definition at line 568 of file mpi_conversion.c.
References basic_tag, basic_to_string(), buffer, entity_type, entity_undefined, ctx_mpi::error, expression_to_entity(), is_basic_float, is_basic_int, is_basic_string, make_constant_entity(), ctx_mpi::mpi_communicator, ctx_mpi::mpi_request, mpic_make_mpi_isend(), mpic_make_mpi_send(), pips_user_warning, type_variable, and variable_basic.
Referenced by generate_send_from_statement().
|
static |
return the type for MPI communicator: MPI_Comm
Definition at line 429 of file mpi_conversion.c.
References entity_storage, entity_type, FindOrCreateEntity(), ImplicitType(), make_basic_typedef(), make_storage_rom(), MakeTypeVariable(), MPI_COMM, NIL, put_new_typedef(), storage_undefined_p, TOP_LEVEL_MODULE_NAME, and type_undefined_p.
Referenced by mpi_make_ctx().
|
static |
return the type for MPI request: MPI_Request
Definition at line 463 of file mpi_conversion.c.
References entity_storage, entity_type, FindOrCreateEntity(), ImplicitType(), make_basic_typedef(), make_storage_rom(), MakeTypeVariable(), MPI_REQUEST, NIL, put_new_typedef(), storage_undefined_p, TOP_LEVEL_MODULE_NAME, and type_undefined_p.
Referenced by mpi_make_ctx().
|
static |
return the type for MPI status: MPI_Status
Definition at line 446 of file mpi_conversion.c.
References entity_storage, entity_type, FindOrCreateEntity(), ImplicitType(), make_basic_typedef(), make_storage_rom(), MakeTypeVariable(), MPI_STATUS, NIL, put_new_typedef(), storage_undefined_p, TOP_LEVEL_MODULE_NAME, and type_undefined_p.
Referenced by mpi_make_ctx().
|
static |
tatic statement mpifortran_make_mpi_finalize(entity result) { list args = CONS(EXPRESSION, make_entity_expression(result, NIL), NIL); args = gen_nreverse(args); statement mpi_st = make_call_statement(MPI_FINALIZE_FUNCTION_NAME, args, entity_undefined, string_undefined); return mpi_st; }
make a list of expression that will be use as argument for MPI send/receive functions ds is the destination or the source depend of a send or receive function (&buffer, size, mpitype, ds, tag, communicator{, status/request})
Definition at line 192 of file mpi_conversion.c.
References buffer, CONS, entity_undefined_p, EXPRESSION, gen_nreverse(), int_to_expression(), make_address_of_expression(), make_entity_expression(), NIL, pips_assert, and pips_internal_error.
Referenced by mpic_make_generic_mpi_receive_call(), and mpic_make_generic_mpi_send_call().
|
static |
Definition at line 292 of file mpi_conversion.c.
References buffer, entity_intrinsic(), entity_undefined, entity_undefined_p, make_call(), MPI_IRECV_FUNCTION_NAME, MPI_RECV_FUNCTION_NAME, mpic_make_args_mpi_send_or_receiv(), and pips_internal_error.
Referenced by mpic_make_mpi_irecv(), and mpic_make_mpi_recv().
|
static |
Definition at line 246 of file mpi_conversion.c.
References buffer, entity_intrinsic(), entity_undefined, entity_undefined_p, make_call(), MPI_BSEND_FUNCTION_NAME, mpi_communication_buffered_mode, mpi_communication_default_mode, mpi_communication_ready_mode, mpi_communication_synchronous_mode, MPI_IBSEND_FUNCTION_NAME, MPI_IRSEND_FUNCTION_NAME, MPI_ISEND_FUNCTION_NAME, MPI_ISSEND_FUNCTION_NAME, MPI_RSEND_FUNCTION_NAME, MPI_SEND_FUNCTION_NAME, MPI_SSEND_FUNCTION_NAME, and mpic_make_args_mpi_send_or_receiv().
Referenced by mpic_make_mpi_isend(), and mpic_make_mpi_send().
generate statement: MPI_Comm_rank(communicator, &rank); or result = MPI_Comm_rank(communicator, &rank);
Definition at line 114 of file mpi_conversion.c.
References call_to_expression(), call_to_statement, CONS, entity_intrinsic(), entity_to_expression(), entity_undefined_p, EXPRESSION, gen_nreverse(), make_address_of_expression(), make_assign_statement(), make_call(), make_entity_expression(), MPI_COMM_RANK_FUNCTION_NAME, NIL, rank, and statement_undefined.
Referenced by mpi_comm_rank_ctx().
Functions to generate standard MPI function statement Can maybe also make function to return MPI function like instruction instead of statement to be more flexible? Only C version are made, for Fortran version, have to add an error manager variable (instead return result in C than represent possible error, add it in call function, cf MPI doc) All these functions can be general and move into a MPI manager? In that case only unstatic function that return statement or type.
generate statement: MPI_Comm_size(communicator, &size); or result = MPI_Comm_size(communicator, &size);
Definition at line 91 of file mpi_conversion.c.
References call_to_expression(), call_to_statement, CONS, entity_intrinsic(), entity_to_expression(), entity_undefined_p, EXPRESSION, gen_nreverse(), make_address_of_expression(), make_assign_statement(), make_call(), make_entity_expression(), MPI_COMM_SIZE_FUNCTION_NAME, NIL, and statement_undefined.
Referenced by mpi_comm_size_ctx().
generate statement: MPI_Finalize(); or result = MPI_Finalize();
Definition at line 165 of file mpi_conversion.c.
References call_to_expression(), call_to_statement, entity_intrinsic(), entity_to_expression(), entity_undefined_p, gen_nreverse(), make_assign_statement(), make_call(), MPI_FINALIZE_FUNCTION_NAME, NIL, and statement_undefined.
Referenced by mpi_finalize_ctx().
argc and argv must be defined generate statement: MPI_Init(&argc, &argv); or result = MPI_Init(&argc, &argv);
Definition at line 138 of file mpi_conversion.c.
References call_to_expression(), call_to_statement, CONS, entity_intrinsic(), entity_to_expression(), entity_undefined_p, EXPRESSION, gen_nreverse(), make_address_of_expression(), make_assign_statement(), make_call(), make_entity_expression(), MPI_INIT_FUNCTION_NAME, NIL, pips_user_error, and statement_undefined.
Referenced by mpi_init_ctx().
|
static |
generate statement: {result =} MPI_Irecv(&buffer, size, mpitype, source, tag, communicator, &request);
Definition at line 404 of file mpi_conversion.c.
References buffer, call_to_expression(), call_to_statement, entity_to_expression(), entity_undefined, entity_undefined_p, make_assign_statement(), mpic_make_generic_mpi_receive_call(), and statement_undefined.
Referenced by mpi_recv_ctx().
|
static |
generate statement: {result =} MPI_Isend(&buffer, size, mpitype, dest, tag, communicator, &request);
Definition at line 352 of file mpi_conversion.c.
References buffer, call_to_expression(), call_to_statement, entity_to_expression(), entity_undefined_p, make_assign_statement(), mpi_communication_default_mode, mpic_make_generic_mpi_send_call(), and statement_undefined.
Referenced by mpi_send_ctx().
|
static |
TODO do the same for MPI_Rsend/Irsend/Bsend/Ibsend/Ssend/Issend.
generate statement: {result =} MPI_Recv(&buffer, size, mpitype, source, tag, communicator, &status);
Definition at line 380 of file mpi_conversion.c.
References buffer, call_to_expression(), call_to_statement, entity_to_expression(), entity_undefined, entity_undefined_p, make_assign_statement(), mpic_make_generic_mpi_receive_call(), and statement_undefined.
Referenced by mpi_recv_ctx().
|
static |
generate statement: {result =} MPI_Send(&buffer, size, mpitype, dest, tag, communicator);
Definition at line 329 of file mpi_conversion.c.
References buffer, call_to_expression(), call_to_statement, entity_to_expression(), entity_undefined, entity_undefined_p, make_assign_statement(), mpi_communication_default_mode, mpic_make_generic_mpi_send_call(), and statement_undefined.
Referenced by mpi_send_ctx().
|
static |
Definition at line 1055 of file mpi_conversion.c.
References concatenate(), entity_name, entity_user_name(), free(), get_string_property(), MPI_GENERATION_PREFIX, pips_debug, pips_user_warning, prefix, ref, reference_variable, same_stringn_p, and strdup().
Referenced by make_send_receive_conversion(), and test_working_false().
|
static |
use as filter for gen_context_recurse check if the statement stat will be communication if so, generate the MPI_Send and MPI_Receive corresponding.
by this fact, when we leave the statement, we know if we encounter a communication in the explored AST
stat | statement analyzed |
ctx | context |
Definition at line 1349 of file mpi_conversion.c.
References assignment_statement_p(), ctx_inc_tag(), ctx_set_receive_statement(), ctx_set_send_statement(), find_receiver_cluster(), find_sender_cluster(), generate_receive_from_statement(), generate_send_from_statement(), is_distributed_comments(), pips_debug, and statement_comments.
Referenced by make_mpi_conversion(), sequence_working_false(), and test_working_false().
|
static |
This function update the receive statements for a sequential statement NB : This function can be put in search_copy_communication; in this case search_copy_communication can return true and false And have to treat the declaration here instead of in make_send_receive_conversion.
seq | sequence to treat |
ctx | context |
en_null
en_null
Definition at line 1114 of file mpi_conversion.c.
References ctx_get_receive_statement(), ctx_set_receive_statement(), ctx_conv::current_cluster, empty_statement_or_continue_p(), FOREACH, free(), gen_context_multi_recurse(), gen_core(), insert_statement(), make_empty_block_statement(), make_send_receive_conversion(), ctx_conv::nbr_cluster, pips_assert, pips_debug, search_copy_communication(), sequence_domain, sequence_statements, STATEMENT, statement_domain, statement_undefined, statement_undefined_p, test_domain, and test_working_false().
Referenced by make_mpi_conversion(), and test_working_false().
|
static |
This function update the receive statements for a test statement NB : This function can be put in search_copy_communication; in this case search_copy_communication can return true and false.
t | test to treat |
ctx | context |
en_null
en_null
en_null
en_null
Definition at line 1200 of file mpi_conversion.c.
References copy_expression(), ctx_get_receive_statement(), ctx_set_receive_statement(), ctx_conv::current_cluster, gen_context_multi_recurse(), gen_context_recurse, gen_core(), gen_true2(), integer_constant_expression_p(), make_empty_block_statement(), make_send_receive_conversion(), make_test_statement(), ctx_conv::nbr_cluster, not_expression, pips_assert, pips_debug, reference_domain, replace_sender_entity_by_receiver_entity_in_reference(), search_copy_communication(), sequence_domain, sequence_working_false(), statement_domain, statement_undefined, statement_undefined_p, test_condition, test_domain, test_false, and test_true.
Referenced by make_mpi_conversion(), and sequence_working_false().