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

 1 arta  1.1 #include <stdlib.h>
 2           #include <stdio.h>
 3           #include <string.h>
 4           
 5           main (int argc, char **argv) {
 6             unsigned long long lval, site_min, site_max;
 7             short seed;
 8             char *endptr;
 9           
10             if (argc < 2) {
11               fprintf (stderr, "Error: no site code initialization provided\n");
12               fprintf (stderr,
13           	"  sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
14               return 1;
15             }
16             lval = (unsigned long long)strtoull (argv[1], &endptr, 0);
17             if (strlen (endptr) | lval > 32767) {
18               fprintf (stderr, "Error: invalid site code provided %s for initialization\n",
19           	argv[1]);
20               fprintf (stderr,
21           	"  sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
22 arta  1.1     return 1;
23             }
24             site_min = lval << 48;
25             site_max = site_min + ((long long)1 << 48) - 1;
26           /*
27             printf ("drop sequence SUM_DS_INDEX_SEQ;\n");
28           */
29             printf ("create sequence SUM_DS_INDEX_SEQ\n");
30             printf ("  increment 1\n");
31             printf ("  start %ld\n", site_min);
32             printf ("  minvalue %ld\n", site_min);
33             printf ("  maxvalue %ld\n", site_max);
34             printf ("  nocycle\n");
35             printf ("  cache 10;\n");
36             return 0;
37           }

Karen Tian
Powered by
ViewCVS 0.9.4