Skip to main content
Sign in
Snippets Groups Projects
Select Git revision
  • 2d99fa5961fac6b37a34c49e51a189898332c914
  • stable default protected
  • MA_Pape_2018
  • MA_2018_Lopatin
  • feature/mesh_viewer
  • feature/#468_access_isosurface_scalar
  • feature/#459_default_primitives
  • master protected
  • feature/#470_Create_a_color_lookup_table
  • feature/#473_resize_companion_window
  • feature/#462_do_not_use_arb_extensions
  • feature/#495_Provide_data_for_larger_isosurfaces
  • feature/#323_default_image
  • feature/#480_Create_a_smaller_test_mesh_for_combustion_demo
  • feature/#236_Get_Integration_tests_running_on_CI
  • feature/#447_Copy_standard_assets_to_build_folder
  • 447-copy-standard-assets-to-build-folder-and-remove-resource-path
  • feature/#445_mesh_render_settings_component
  • feature/#251_Make_sure_tests_cpp_is_compiled_once
  • feature/#455_Remove_navigation_and_improve_interaction_for_combustion_demo
  • feature/446_strange_txt_files
  • v18.06.0
  • v18.05.0
  • #251_bad
  • #251_good
  • v18.03.0
  • v18.02.0
  • v18.01.0
  • v17.12.0
  • v17.11.0
  • v17.10.0
  • v17.09.0
  • v17.07.0
33 results

blit_render_task.cpp

Blame
  • MessageRace.py 3.79 KiB
    #! /usr/bin/python3
    
    from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
    from scripts.Infrastructure.InstructionBlock import InstructionBlock
    from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory
    from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv
    from scripts.Infrastructure.Template import TemplateManager
    from scripts.Infrastructure.TemplateFactory import get_send_recv_template
    
    from itertools import chain
    
    
    class MessageRaceErrorAnyTag(ErrorGenerator):
        # TODO do we need to generate it for all combinations of send and recv?
    
        def __init__(self):
            pass
    
        def get_feature(self):
            return ["P2P"]
    
        def generate(self, generate_full_set):
            tm = TemplateManager()
            tm.set_description("MsgRace-ANY_TAG", "order of messages is indeterministic, may lead to a deadlock")
    
            b = InstructionBlock("alloc")
            b.register_instruction(CorrectParameterFactory().get_buffer_alloc())
            tm.register_instruction_block(b)
    
            b = InstructionBlock("MPICALL")
            # send part
            b.register_instruction("for(int i =0; i < 10; ++i) {", kind=1)
            b.register_instruction("buf[0]=i;", kind=1)
            send_call = CorrectMPICallFactory().mpi_send()
            send_call.set_arg("tag", "i")
            b.register_instruction(send_call, kind=1)
            b.register_instruction("}", kind=1)
            # recv part
            b.register_instruction("for(int i =0; i < 10; ++i) {", kind=0)
            recv_call = CorrectMPICallFactory().mpi_recv()
            recv_call.set_arg("tag", "MPI_ANY_TAG")
            b.register_instruction(recv_call, kind=0)
            b.register_instruction("if(buf[0]!=i){", kind=0)
            additional_recv = CorrectMPICallFactory().mpi_recv()
            additional_recv.set_has_error()  # additional recv leads to deadlock
            b.register_instruction(additional_recv, kind=0)
            b.register_instruction(" }", kind=0)  # end if
            b.register_instruction("}", kind=0)  # end for
    
            tm.register_instruction_block(b)
    
            b = InstructionBlock("free")
            b.register_instruction(CorrectParameterFactory().get_buffer_free())
            tm.register_instruction_block(b)
    
            yield tm
    
    
    class MessageRaceErrorAnysource(ErrorGenerator):
        # TODO do we need to generate it for all combinations of send and recv?
    
        def __init__(self):
            pass
    
        def get_feature(self):
            return ["P2P"]
    
        def generate(self, generate_full_set):
            tm = TemplateManager(min_ranks=3)
            tm.set_description("MsgRace-ANY_SOURCE", "order of messages is indeterministic, may lead to a deadlock")
    
            b = InstructionBlock("alloc")
            b.register_instruction(CorrectParameterFactory().get_buffer_alloc())
            tm.register_instruction_block(b)
    
            b = InstructionBlock("MPICALL")
            # send part
            b.register_instruction("buf[0]=rank;", kind='not0')
            send_call = CorrectMPICallFactory().mpi_send()
            b.register_instruction(send_call, kind='not0')
    
            # recv part
            b.register_instruction("for(int i =1; i < nprocs; ++i) {", kind=0)
            recv_call = CorrectMPICallFactory().mpi_recv()
            recv_call.set_arg("source", "MPI_ANY_SOURCE")
            b.register_instruction(recv_call, kind=0)
            b.register_instruction("if(buf[0]!=i){", kind=0)
            additional_recv = CorrectMPICallFactory().mpi_recv()
            additional_recv.set_has_error()  # additional recv leads to deadlock
            b.register_instruction(additional_recv, kind=0)
            b.register_instruction(" }", kind=0)  # end if
            b.register_instruction("}", kind=0)  # end for
    
            tm.register_instruction_block(b)
    
            b = InstructionBlock("free")
            b.register_instruction(CorrectParameterFactory().get_buffer_free())
            tm.register_instruction_block(b)
    
            yield tm