コード例 #1
0
ファイル: aed_csv.c プロジェクト: GLEON/GLM-source
/******************************************************************************
 *                                                                            *
 *                                                                            *
 ******************************************************************************/
void find_day(int csv, int time_idx, int jday)
{
    int y,m,d;
    AED_REAL tr;

    if ( !check_it(csv, time_idx) ) {
        fprintf(stderr, "Fatal error in find_day: file %d index %d\n", csv, time_idx);
#if DEBUG
        CRASH("find_day");
#else
        exit(1);
#endif
    }

    while( (tr = get_csv_val_r(csv, time_idx)) < jday) {
        if ( !load_csv_line(csv) ) {
            calendar_date(jday, &y, &m, &d);
            fprintf(stderr,"Day %d (%d-%02d-%02d) not found\n", jday, y, m, d);
#if DEBUG
            CRASH("find_day");
#else
            exit(1);
#endif
        }
    }
}
コード例 #2
0
int
main(void)
{
#ifdef STARPU_USE_CPU
	int ret;

	ret = starpu_init(NULL);
	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

	ncpu = starpu_cpu_worker_get_count();
#ifdef STARPU_USE_CUDA
	ncuda = starpu_cuda_worker_get_count();
#endif
#ifdef STARPU_USE_OPENCL
	nopencl = starpu_opencl_worker_get_count();
#endif

	if (ncpu == 0 || !gpus_available())
	{
		starpu_shutdown();
		return 77;
	}

#ifdef STARPU_USE_OPENCL
	ret = starpu_opencl_load_opencl_from_file("examples/basic_examples/multiformat_opencl_kernel.cl",
						  &opencl_program, NULL);
	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
	ret = starpu_opencl_load_opencl_from_file("examples/basic_examples/multiformat_conversion_codelets_opencl_kernel.cl", 
						  &opencl_conversion_program, NULL);
	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
#endif
	init_problem_data();

	print_it();

	register_data();

	create_and_submit_tasks();

	unregister_data();

	print_it();

#ifdef STARPU_USE_OPENCL
        ret = starpu_opencl_unload_opencl(&opencl_program);
        STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_unload_opencl");
        starpu_opencl_unload_opencl(&opencl_conversion_program);
#endif
	starpu_shutdown();


	return check_it();
#else
	/* Without the CPU, there is no point in using the multiformat
	 * interface, so this test is pointless. */
	return 77;
#endif
}
コード例 #3
0
void Execution_Tracer::print() {
  lprintf( "printing history\n");
  The_Squeak_Interpreter()->print_all_stack_traces(dittoing_stdout_printer);
  lprintf( "\n\n\nprinting last bytecodes\n");
  Oop entries = get();
  check_it(entries);

  print_entries(entries, debug_printer);
}
コード例 #4
0
ファイル: signals.c プロジェクト: cmehay/our_minitalk
static t_bool	check_input(t_bit *bits, t_stock *stock)
{
	t_bit	*tmp;
	int		idx;
	int		cnt0;
	int		cnt1;

	tmp = bits;
	cnt0 = 0;
	cnt1 = 0;
	check_it(tmp, &cnt0, &cnt1, &idx);
	if (cnt0 == 16 && cnt1 == 8 && !((idx + 1) % 8))
		return (checksum(bits, stock));
	if (cnt0 == 16 && cnt1 == 8 && ((idx + 1) % 8))
	{
		reset_str(bits);
		stock->bit = NULL;
	}
	return (FALSE);
}
コード例 #5
0
ファイル: take.c プロジェクト: elivet/Lem_in
t_data		information(t_data the)
{
	the = first_take(the);
	if (the.nbr == 0)
		error();
	while (get_next_line(0, &the.line))
	{
		if (the.line[0] == '\0')
			error();
		the.j++;
		the.aff[the.j] = ft_strdup(the.line);
		if (check_tube(the.line) == 1)
		{
			the.tube[the.i] = ft_strdup(the.line);
			the.i++;
		}
		the = take_start(the);
		if (check_room(the) == 1)
			check_it(the);
		the = take_end(the);
	}
	the = finish(the, the.i, the.j);
	return (the);
}
コード例 #6
0
Oop Execution_Tracer::get() {
  Oop r = Abstract_Tracer::get();
  check_it(r);
  return r;
}
コード例 #7
0
int
main (int argc, char *argv[])
{
    long local_dest;
    int *shm_dest;
    int me, npes, i;
    int pe_acc_success = 0;
    int fail_count = 0;

    shmem_init ();
    me = shmem_my_pe ();
    npes = shmem_n_pes ();

    shm_dest = (int *) shmem_malloc (sizeof (int));

    shmem_barrier_all ();

    if (me == 0) {

        if (!check_it (&global_dest)) {   /* long global: yes */
            printf ("Test Global Address Accessible: Failed\n");
            fail_count++;
        }
        else {
            printf ("Test Global Address Accessible: Passed\n");
        }
        if (!check_it (&static_dest)) {   /* static int global: yes */
            printf ("Test Static Global Address Accessible: Failed\n");
            fail_count++;
        }
        else {
            printf ("Test Static Global Address Accessible: Passed\n");
        }
        if (check_it (&local_dest)) { /* main() stack: no */
            printf ("Test Stack Address Accessible: Failed\n");
            fail_count++;
        }
        else {
            printf ("Test Stack Address Accessible: Passed\n");
        }
        if (!check_it (shm_dest)) {   /* shmem_malloc: yes */
            printf ("Test Shmalloc-ed Address Accessible: Failed\n");
            fail_count++;
        }
        else {
            printf ("Test Shmalloc-ed Address Accessible: Passed\n");
        }


        for (i = 1; i < npes; i++) {

            if (shmem_pe_accessible (i) != 1) {
                pe_acc_success = 1;
            }

        }
        if (pe_acc_success == 1) {
            printf ("Test shmem_pe_accessible: Failed\n");
            fail_count++;
        }
        else {
            printf ("Test shmem_pe_accessible: Passed\n");
        }

        if (fail_count == 0)
	    printf("All Tests Passed\n");
        else
	    printf("%d Tests Failed\n", fail_count);
    }

    shmem_free (shm_dest);

    shmem_finalize ();

    return 0;
}
コード例 #8
0
ファイル: aed_csv.c プロジェクト: GLEON/GLM-source
/******************************************************************************
 *                                                                            *
 *                                                                            *
 ******************************************************************************/
int get_csv_val_s(int csv, int idx, char *s)
{
    if ( check_it(csv,idx) ) return csv_if[csv].curLine[idx];
    return 0;
}
コード例 #9
0
ファイル: aed_csv.c プロジェクト: GLEON/GLM-source
/******************************************************************************
 *                                                                            *
 *                                                                            *
 ******************************************************************************/
AED_REAL get_csv_val_r(int csv, int idx)
{
    if ( check_it(csv,idx) ) return csv_if[csv].curLine[idx];
    return 0.;
}
コード例 #10
0
ファイル: aed_csv.c プロジェクト: GLEON/GLM-source
/******************************************************************************
 *                                                                            *
 *                                                                            *
 ******************************************************************************/
int get_csv_type(int csv, int idx)
{
    if ( check_it(csv,idx) ) return csv_if[csv].curLine[idx];
    return 0;
}