Changeset 33204
- Timestamp:
- Feb 6, 2012, 6:50:18 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src
- Files:
-
- 3 added
- 3 edited
-
dvosplit/src/dvosplit.c (modified) (4 diffs)
-
libautocode/def/SkyRegion.d (modified) (1 diff)
-
photdbc/src/AssignSkyToHost.c (added)
-
photdbc/src/CopyToHostLocation.c (added)
-
photdbc/src/HostTableLoad.c (modified) (6 diffs)
-
photdbc/src/rconnect.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/dvosplit/src/dvosplit.c
r25757 r33204 1 1 # include "dvosplit.h" 2 2 3 // XXX : go to this : dvosplit (catdir) (outlevel) [-region Rmin Rmax Dmin Dmax] 3 4 // dvosplit (outlevel) [-region Rmin Rmax Dmin Dmax] 4 5 int main (int argc, char **argv) { … … 14 15 ConfigInit (&argc, argv); 15 16 args (argc, argv); 17 18 // XXX : OUTCAT = strcreate (argv[1]); 19 // XXX : OUT_DEPTH = atoi (argv[2]); 16 20 17 21 OUT_DEPTH = atoi (argv[1]); … … 29 33 // if (current level > out level) skip: cannot currently merge catalogs 30 34 // if (current level == out level) skip: no action is needed 35 // XXX if outdir != indir, copy the tables across 31 36 if (skylist[0].regions[i][0].depth >= OUT_DEPTH) continue; 32 37 … … 51 56 // change sky.regions[i].depth for these regions 52 57 outlist = SkyListByPatch (sky, OUT_DEPTH, skylist[0].regions[i]); 58 // XXX update the filenames for outlist given the new outdir 53 59 54 60 outcatalogs = open_output_catalogs (outlist); -
branches/eam_branches/ipp-20111122/Ohana/src/libautocode/def/SkyRegion.d
r5945 r33204 8 8 FIELD Dmin, D_MIN, float, 9 9 FIELD Dmax, D_MAX, float, 10 FIELD childS, CHILD_S, int, sequence number in full table of first child 11 FIELD childE, CHILD_E, int, sequence number in full table of last child + 1 12 FIELD parent, PARENT, int, sequence number in full table of parent 13 FIELD index, INDEX, int, sequence number in full table of this entry 14 FIELD depth, DEPTH, char, depth of this entry 15 FIELD child, CHILD, char, does this entry have children? 16 FIELD table, TABLE, char, does this entry have a table? 17 FIELD name, NAME, char[21], name / filename 10 FIELD childS, CHILD_S, int, sequence number in full table of first child 11 FIELD childE, CHILD_E, int, sequence number in full table of last child + 1 12 FIELD parent, PARENT, int, sequence number in full table of parent 13 FIELD index, INDEX, int, sequence number in full table of this entry 14 FIELD depth, DEPTH, char, depth of this entry 15 FIELD child, CHILD, char, does this entry have children? 16 FIELD table, TABLE, char, does this entry have a table? 17 FIELD name, NAME, char[19], name / filename 18 FIELD hostID, HOST_ID, unsigned short, host ID where data is stored 19 20 # note : 2012.02.05 : stole 2 bytes from 'name' to use for host ID (no 21 # DBs were created with more than 17 bytes in the name). The 22 # hostID points at an entry in the host table (text file). 23 # There is no safety on this, but it is recoverable (by 24 # examining the directories) if misplaced. 25 # 26 # Note that SkyTables from databases generated in the past may 27 # have garbage characters here. To ensure catch this 28 # condition, we add a header keyword to SkyTables in which the 29 # hostID has been set; if that is not present, the SkyTable 30 # loading software should init these bytes to 0 (== unassigned). -
branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/HostTableLoad.c
r33203 r33204 1 1 # include "photdbc.h" 2 # define DEBUG 1 2 3 3 4 typedef struct { … … 48 49 InitHosts (hosts, Nhosts, NHOSTS); 49 50 51 int maxID = 0; 52 50 53 int Nline; 51 54 for (Nline = 0; TRUE; Nline ++) { … … 69 72 } 70 73 74 // check the validity of ID (0 < ID < MAX_SHORT) 75 76 if (ID < 1) { 77 fprint (stderr, "invalid host ID %d\n", ID); 78 exit (1); 79 } 80 if (ID > 65535) { 81 fprint (stderr, "invalid host ID %d\n", ID); 82 exit (1); 83 } 84 maxID = MAX(maxID, ID); 85 71 86 hosts[Nhosts].hostID = ID; 72 87 hosts[Nhosts].hostname = strcreate(tmphost); … … 85 100 table->hosts = hosts; 86 101 102 ALLOCATE (table->index, unsigned short, maxID + 1); 103 for (i = 0; i <= maxID; i++) table->index[i] = -1; 104 105 for (i = 0; i < table->Nhosts; i++) { 106 if (table->index[table->hosts[i].hostID] == -1) { 107 fprintf (stderr, "error: duplicate hostID %d\n", table->hosts[i].hostID); 108 exit (1); 109 } 110 table->index[table->hosts[i].hostID] = i; 111 } 112 87 113 return table; 88 114 } … … 90 116 int CheckHostsAndPaths (HostTable *table) { 91 117 118 int i; 119 int stdio[3]; 92 120 char command[64]; 93 121 char shell[64]; 94 122 95 123 strcpy (command, "ssh"); 96 strcpy (shell, " pclient");124 strcpy (shell, "csh"); 97 125 98 126 for (i = 0; i < table->Nhosts; i++) { … … 101 129 if (DEBUG) fprintf (stderr, "starting host within thread\n"); 102 130 103 pid = rconnect (command, host[0].hostname, shell, stdio);131 pid = rconnect (command, table->hosts[i].hostname, shell, stdio); 104 132 if (!pid) { 105 133 /** failure to start: extend retry period **/ 106 134 if (DEBUG) fprintf (stderr, "failure to start %s\n", table->hosts[i].hostname); 135 exit (1); 107 136 } 137 138 // XXX check anything else? 139 140 // close the connection 141 close(stdio[0]); 142 close(stdio[1]); 143 close(stdio[2]); 144 145 status = check_dir_access (table->hosts[i].pathname, DEBUG); 146 if (!status) { 147 fprintf (stderr, "failed to find / create target path\n"); 148 exit (2); 149 } 150 151 fprintf (stderr, "success : %s, %s\n", table->hosts[i].hostname, table->hosts[i].pathname); 108 152 } 109 153 return (TRUE); 110 154 }
Note:
See TracChangeset
for help on using the changeset viewer.
