예제 #1
0
파일: reacnet.c 프로젝트: j-browne/reacnet
int main (int argc, char* argv[]) {
	// Initialize options
	int i;
	get_ops(NULL);
	for (i=1; i<argc; ++i) {
		get_ops(argv[i]);
	}

	// Seed RNG
	if (ops.seedFlag) {
		srand(ops.seed);
	} else {
		srand(time(NULL));
	}

	// Read in nuclei
	if (get_nuclei(ops.nuclei_filename)==false) {
		exit(EXIT_FAILURE);
	}

	// Read in reactions
	if (get_reactions(ops.reaclib_filename)==false) {
		exit(EXIT_FAILURE);
	}

	sim();

	free(nuclei);
	free(abun);
	free(reactions);
	return 0;
}
예제 #2
0
파일: gc.cpp 프로젝트: Spin0za/inkscape
void Core::init() {
    try {
        _ops = get_ops();
    } catch (InvalidGCModeError &e) {
        g_warning("%s; enabling normal collection", e.what());
        _ops = enabled_ops;
    }

    _ops.do_init();
}
예제 #3
0
파일: mad_desc.c 프로젝트: alTeska/MAD
static inline void
build_dispatch(D *d)
{
  int nb_threads = omp_get_num_procs();
  d->ocs = mad_malloc(nb_threads * sizeof *(d->ocs));
  assert(d->ocs);
  d->size += nb_threads * sizeof *(d->ocs);

  int sizes[nb_threads];
  for (int t = 0; t < nb_threads; ++t) {
    d->ocs[t] = mad_calloc(d->mo, sizeof *d->ocs[t]);
    d->size += d->mo * sizeof *d->ocs[t];
    sizes[t] = 0;
  }

  long long int ops[d->mo+1], dops[nb_threads];
  memset(dops, 0, nb_threads * sizeof *dops);
  get_ops(d,ops);

  if (nb_threads == 1 || d->mo < 12) {
    for (int o = d->mo; o >= 2; --o) {
      d->ocs[0][sizes[0]++] = o;
      dops[0] += ops[o];
    }
  }
  else {
    for (int o = d->mo + 1; o >= 2; --o) {
      int idx = get_min_dispatched_idx(nb_threads,dops);
      assert(idx >= 0 && idx < nb_threads);
      d->ocs[idx][sizes[idx]++] = o;
      dops[idx] += ops[o];
    }
  }

#ifdef DEBUG
  printf("\nTHREAD DISPATCH:\n");
  for (int t = 0; t < nb_threads; ++t) {
    printf("[%d]: ", t);
    for (int i = 0; d->ocs[t][i]; ++i)
      printf("%d ", d->ocs[t][i]);
    printf("[ops:%lld] \n", dops[t]);
  }
  printf("\n");
#endif
}
예제 #4
0
파일: main.c 프로젝트: ziahamza/fucache
int main(int argc, char *argv[]) {
  // currently using high level fuse apis for fs
  struct fuse_operations ops = get_ops();
  return init(argc, argv, &ops);
}