Example #1
0
void
prepare(void)
{
    struct rt_i *rtip = APP.a_rt_i;

    RT_CK_RTI(rtip);

    if (debug)  fprintf(stderr, "prepare()\n");

    /*
     * initialize application -- it will allocate 1 line and
     * set buf_mode=1, as well as do mlib_init().
     */
    (void)view_init(&APP, title_file, title_obj, 0, 0);

    do_prep(rtip);

    if (rtip->nsolids <= 0)
	bu_exit(3, "ph_matrix: No solids remain after prep.\n");

    grid_setup();

    /* initialize lighting */
    view_2init(&APP, NULL);

    rtip->nshots = 0;
    rtip->nmiss_model = 0;
    rtip->nmiss_tree = 0;
    rtip->nmiss_solid = 0;
    rtip->nmiss = 0;
    rtip->nhits = 0;
    rtip->rti_nrays = 0;

}
Example #2
0
File: fox.c Project: The-coders/fox
int main(int argc, char *argv[]) {
    struct grid_info grid;

    MPI_Init(&argc, &argv);

    grid_setup(&grid);
    grid_info_print(&grid);

    /* lado de una submatriz */
    int n = 4;
    int local_n = n / grid.ppside;

    char A_filename[50], B_filename[50];
    sprintf(A_filename, "data_localn2_side2/A_localn2_row%d_col%d", grid.my_row, grid.my_col);
    sprintf(B_filename, "data_localn2_side2/B_localn2_row%d_col%d", grid.my_row, grid.my_col);

    matrix_type **local_A, **local_B, **local_C;
    local_A = matrix_new_from_file(local_n, local_n, A_filename);
    local_B = matrix_new_from_file(local_n, local_n, B_filename);
    local_C = matrix_new(local_n, local_n);

    Fox(&grid, local_n, local_A, local_B, local_C);

    printf("A%d%d =\n", grid.my_row, grid.my_col);
    matrix_print(stdout, local_A, local_n, local_n);
    printf("B%d%d =\n", grid.my_row, grid.my_col);
    matrix_print(stdout, local_B, local_n, local_n);
    printf("C%d%d =\n", grid.my_row, grid.my_col);
    matrix_print(stdout, local_C, local_n, local_n);

    MPI_Finalize();
    return 0;
}