IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 2:59:09 PM (16 years ago)
Author:
Paul Price
Message:

Merging trunk in advance of reintegrating into trunk.

Location:
branches/pap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/psphot

  • branches/pap/psphot/src/psphotTest.c

    r24187 r28484  
    2525
    2626bool FillImage_Threaded (psThreadJob *job) {
    27    
     27
    2828    psImage *image = job->args->data[0];
    2929    int xs = PS_SCALAR_VALUE(job->args->data[1],S32);
     
    3636    psRegion region = psRegionSet (xs, xs + dx, ys, ys + dy);
    3737    for (int i = 0; i < 100; i++) {
    38         psImage *subset = psImageSubset (image, region);
    39         psImageInit (subset, value + i);
    40         psFree (subset);
     38        psImage *subset = psImageSubset (image, region);
     39        psImageInit (subset, value + i);
     40        psFree (subset);
    4141    }
    4242    return true;
     
    4646
    4747    if (argc != 3) {
    48         fprintf (stderr, "USAGE: psphotTest (output.fits) (nThreads)\n");
    49         exit (2);
     48        fprintf (stderr, "USAGE: psphotTest (output.fits) (nThreads)\n");
     49        exit (2);
    5050    }
    5151
     
    6262
    6363    for (int ix = 0; ix < 1000; ix += 100) {
    64         for (int iy = 0; iy < 1000; iy += 100) {
     64        for (int iy = 0; iy < 1000; iy += 100) {
    6565
    66             // allocate a job -- if threads are not defined, this just runs the job
    67             psThreadJob *job = psThreadJobAlloc ("FILL_IMAGE");
     66            // allocate a job -- if threads are not defined, this just runs the job
     67            psThreadJob *job = psThreadJobAlloc ("FILL_IMAGE");
    6868
    69             psArrayAdd(job->args, 1, image);
    70             PS_ARRAY_ADD_SCALAR(job->args, ix, PS_TYPE_S32);
    71             PS_ARRAY_ADD_SCALAR(job->args, iy, PS_TYPE_S32);
    72             PS_ARRAY_ADD_SCALAR(job->args, 100, PS_TYPE_S32);
    73             PS_ARRAY_ADD_SCALAR(job->args, 100, PS_TYPE_S32);
    74             PS_ARRAY_ADD_SCALAR(job->args, ix + iy, PS_TYPE_S32);
     69            psArrayAdd(job->args, 1, image);
     70            PS_ARRAY_ADD_SCALAR(job->args, ix, PS_TYPE_S32);
     71            PS_ARRAY_ADD_SCALAR(job->args, iy, PS_TYPE_S32);
     72            PS_ARRAY_ADD_SCALAR(job->args, 100, PS_TYPE_S32);
     73            PS_ARRAY_ADD_SCALAR(job->args, 100, PS_TYPE_S32);
     74            PS_ARRAY_ADD_SCALAR(job->args, ix + iy, PS_TYPE_S32);
    7575
    76             // FillImage (image, ix, iy, 100, 100, ix + iy);
     76            // FillImage (image, ix, iy, 100, 100, ix + iy);
    7777
    78             if (!psThreadJobAddPending(job)) {
    79                 fprintf (stderr, "failure to run FillImage(1)");
    80                 psFree (job);
    81                 exit (1);
    82             }
    83             psFree(job);
    84         }
     78            if (!psThreadJobAddPending(job)) {
     79                fprintf (stderr, "failure to run FillImage(1)");
     80                exit (1);
     81            }
     82        }
    8583    }
    8684
     
    8886    // wait for the threads to finish and manage results
    8987    if (!psThreadPoolWait (true)) {
    90         fprintf (stderr, "failure to run FillImage (2)");
    91         exit (1);
     88        fprintf (stderr, "failure to run FillImage (2)");
     89        exit (1);
    9290    }
    9391
Note: See TracChangeset for help on using the changeset viewer.