コード例 #1
0
def f1():

    myid = mpi_comm_rank(MPI_COMM_WORLD)
    program_state_stack(locals(), getframeinfo(currentframe()), "my_state.json")

    for local_var_i in range(2):
        for local_var_j in range(2):
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f1_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    local_var_i,
                    local_var_j,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f1_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    local_var_i,
                    local_var_j,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f1_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    local_var_i,
                    local_var_j,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
                a(local_var_i, local_var_j)
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f1_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    local_var_i,
                    local_var_j,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()

    program_state_stack(locals(), getframeinfo(currentframe()), last_call="LastCall")

    mpi_finalize()
コード例 #2
0
def f2(x, y):

    myid = mpi_comm_rank(MPI_COMM_WORLD)

    for local_var_h in range(2):
        for local_var_g in range(2):
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f2_%d_%d_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    x,
                    y,
                    local_var_h,
                    local_var_g,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f2_%d_%d_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    x,
                    y,
                    local_var_h,
                    local_var_g,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f2_%d_%d_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    x,
                    y,
                    local_var_h,
                    local_var_g,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()
            if program_state_stack(locals(), getframeinfo(currentframe())):
                my_s = "%s_f2_%d_%d_%d_%d_%03d_%03d.txt" % (
                    mydir,
                    x,
                    y,
                    local_var_h,
                    local_var_g,
                    myid,
                    getframeinfo(currentframe()).lineno,
                )
                f = open(my_s, "w")
                f.write(my_s[5:])
                f.flush()
                f.close()