(file) Return to seed_sums.c CVS log (file) (dir) Up to [Development] / JSOC

File: [Development] / JSOC / seed_sums.c (download)
Revision: 1.2, Tue Feb 3 21:46:44 2009 UTC (9 years, 7 months ago) by arta
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_DRMSLATEST, Ver_5-1, VER_DRMSLATEST, NetDRMS_Ver_LATEST, NetDRMS_Ver_9-9, NetDRMS_Ver_9-2, NetDRMS_Ver_9-1, NetDRMS_Ver_9-0, NetDRMS_Ver_8-8, NetDRMS_Ver_8-7, NetDRMS_Ver_8-6, NetDRMS_Ver_8-5, NetDRMS_Ver_8-4, NetDRMS_Ver_8-3, NetDRMS_Ver_8-2, NetDRMS_Ver_8-12, NetDRMS_Ver_8-11, NetDRMS_Ver_8-10, NetDRMS_Ver_8-1, NetDRMS_Ver_8-0, NetDRMS_Ver_7-1, NetDRMS_Ver_7-0, NetDRMS_Ver_6-4, NetDRMS_Ver_6-3, NetDRMS_Ver_6-2, NetDRMS_Ver_6-1, NetDRMS_Ver_6-0, NetDRMS_Ver_2-7, NetDRMS_Ver_2-6, NetDRMS_Ver_2-5, NetDRMS_Ver_2-4, NetDRMS_Ver_2-3, NetDRMS_Ver_2-2, NetDRMS_Ver_2-1, NetDRMS_Ver_2-0b1, NetDRMS_Ver_2-0b, NetDRMS_Ver_2-0a2, NetDRMS_Ver_2-0a1, NetDRMS_Ver_2-0, HEAD
Changes since 1.1: +1 -1 lines
fix typo

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

main (int argc, char **argv) {
  unsigned long long lval, site_min, site_max;
  short seed;
  char *endptr;

  if (argc < 2) {
    fprintf (stderr, "Error: no site code initialization provided\n");
    fprintf (stderr,
	"  sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
    return 1;
  }
  lval = (unsigned long long)strtoull (argv[1], &endptr, 0);
  if (strlen (endptr) | lval > 32767) {
    fprintf (stderr, "Error: invalid site code provided %s for initialization\n",
	argv[1]);
    fprintf (stderr,
	"  sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
    return 1;
  }
  site_min = lval << 48;
  site_max = site_min + ((long long)1 << 48) - 1;
/*
  printf ("drop sequence SUM_DS_INDEX_SEQ;\n");
*/
  printf ("create sequence SUM_DS_INDEX_SEQ\n");
  printf ("  increment 1\n");
  printf ("  start %ld\n", site_min);
  printf ("  minvalue %ld\n", site_min);
  printf ("  maxvalue %ld\n", site_max);
  printf ("  no cycle\n");
  printf ("  cache 10;\n");
  return 0;
}

Karen Tian
Powered by
ViewCVS 0.9.4