Changeset 34463 for trunk/Ohana/src/opihi/dvo/mmatch.c
- Timestamp:
- Sep 25, 2012, 9:21:15 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/mmatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/mmatch.c
r34462 r34463 78 78 DECvec = NULL; 79 79 if (PARALLEL && !HOST_ID) { 80 81 // We need to copy the args to a temp array and modify them so that we send the 82 // correct set to the remote client. The args list looks like this: 83 // if (!CoordsFile) : mmatch (RA) (DEC) (RADIUS) field, ... 84 // if ( CoordsFile) : mmatch (RADIUS) field, ... [because we stripped off the -coords filename elements] 85 86 // allocate the temp array and copy all but (RA) (DEC) 87 int targc = 0; 88 char **targv = NULL; 89 ALLOCATE (targv, char *, argc + 2); 90 for (i = 0; i < argc; i++) { 91 if (!CoordsFile && (i == 1)) continue; 92 if (!CoordsFile && (i == 2)) continue; 93 targv[targc] = strcreate (argv[i]); 94 targc ++; 95 } 96 97 // if not specified, create the coords.fits input file 80 98 if (!CoordsFile) { 81 99 // get vectors corresponding to coordinates of interest … … 92 110 } 93 111 94 char *targv1 = argv[1]; 95 char *targv2 = argv[2]; 96 argv[1] = strcreate ("-coords"); 97 argv[2] = strcreate (CoordsFile); 98 free (CoordsFile); 99 100 // I need to pass the RA & DEC vectors to the remote clients... 101 int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0, VERBOSE); 112 // add the coords file to the args list 113 targv[targc+0] = strcreate ("-coords"); 114 targv[targc+1] = CoordsFile; // this gets freed with targv 115 targc += 2; 116 117 // if needed, add the index vector to the args list 118 if (IDXvec) { 119 REALLOCATE (targv, char *, targc + 2); 120 targv[targc+0] = strcreate ("-index"); 121 targv[targc+1] = strcreate (IDXvec[0].name); 122 targc += 2; 123 } 124 125 // call the remote client 126 int status = HostTableParallelOps (targc, targv, RESULT_FILE, 0, VERBOSE); 102 127 if (vec) free (vec); 103 128 104 free (argv[1]); 105 free (argv[2]); 106 argv[1] = targv1; 107 argv[2] = targv2; 129 // free up targv 130 for (i = 0; i < targc; i++) { 131 free (targv[i]); 132 } 133 free (targv); 108 134 109 135 return status; … … 278 304 // only write the fields which were in a valid catalog 279 305 if (RESULT_FILE) { 280 // extend the array by one to hold index array 281 REALLOCATE (vec, Vector *, Nfields + 1); 282 vec[Nfields] = IDXvec; 283 284 int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nfields + 1, FALSE, NULL); 306 if (IDXvec) { 307 // extend the array by one to hold index array 308 Nfields ++; 309 REALLOCATE (vec, Vector *, Nfields); 310 vec[Nfields-1] = IDXvec; 311 } 312 int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nfields, FALSE, NULL); 285 313 if (!status) goto escape; 286 314 }
Note:
See TracChangeset
for help on using the changeset viewer.
