示例#1
0
int main() {
  sic_init();
  int i; char *tmp;
  char **hashes = sic_malloc(SIZE*sizeof(char*));
  for (i = 0; i < SIZE; i++) {
    tmp = sic_malloc(34);
    memset(tmp, 0, 34);
    hashes[i] = tmp;
  }
  char **seeds = malloc(SIZE*sizeof(char*));
  generate(seeds, SIZE);

  int length = SIZE / sic_num_clients();
  int begin = length * sic_id();
  int end = length * (sic_id()+1);

  sic_barrier(0);
  int times_through = 2;
  for (i = begin; i < end ; i++) {
      fprintf(stderr, "%p WOOT MOTAFUCKA\n", &hashes[i]);
      complex_computation(hashes[i], seeds[i]);
      times_through++;
  /*    if(times_through >= 20) {
        sic_barrier(times_through);
        times_through = 2;
      }*/
  }
  sic_barrier(1);
  for (i = 0; i < SIZE; i++) {
    printf("%d @ PA[0x%p]: %s -> %s \n", i, &hashes[i], seeds[i], hashes[i]);
  }

  sic_exit();
  return 0;
}
示例#2
0
int main() {
  sic_init();
  char *foo = sic_malloc(50000);
  int i;
  if (sic_id() == 0) {
    for (i = 0; i < 128; i++) {
      if (i % 8 == 0) {
        foo[i] = 'a';
      }
    }
  }

  sic_barrier(0);
  for (i = 0; i < 128; i++) {
    if (i % 8 == 0) {
      if (foo[i] != 'a') { 
        printf("Bad data at index %d (should be a, is %c)\n", i, foo[i]);
      }
    } else if (foo[i] != 0) {
      printf("Bad data at index %d (should be 0, is %d)\n", i, foo[i]);
    }
  }

  sic_exit();
  return 0;
}
示例#3
0
文件: ad.c 项目: vabc3/KarCv
int main(int argc,char **argv)
{
	debugon();
	if(sic_init())
		return -1;

	sic_autoadd("pic");
	sic_end();
	return 0;
}