From: Kevin M. Rosenberg Date: Sat, 29 Apr 2000 23:24:56 +0000 (+0000) Subject: r13: *** empty log message *** X-Git-Tag: debian-4.5.3-3~1003 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=9c40ac1eddbc3ed2b68c88e20b332bd727ca2dde r13: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 8dbe5e5..5a28b65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 0.5.1 - 4/28/2000 Cleaned out library that wasn't being used by CTSim - + Modified ctsim.cgi to read in configuration file ctsim.conf + 0.5.0 - 4/27/2000 First open source distribution for GNU/Linux diff --git a/configure.in b/configure.in index b70c3f9..a55eb7f 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout dnl CDPATH= AC_INIT(src/ctrec.c) -AM_INIT_AUTOMAKE(ctsim,0.5.1) +AM_INIT_AUTOMAKE(ctsim,0.5.2) AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -184,7 +184,7 @@ AC_ARG_WITH(html-dir, [ --with-html-dir=PATH Set directory of html files], [ htmldir=$withval ; AC_SUBST(htmldir) ] ) if test -n "$cgibindir" -o -n "$cgibinurl" ; then - cgiprograms=ctsim.cgi + cgiprograms="ctsim.cgi ctsim.conf" AC_SUBST(cgiprograms) fi @@ -287,4 +287,4 @@ AC_SUBST(my_includes) AM_CONDITIONAL(HAVE_INTERACTIVE_GRAPHICS, test 1==0) -AC_OUTPUT(Makefile libezplot/Makefile src/Makefile libgraph/Makefile libkmath/Makefile Makefile libk/Makefile libir/Makefile libcio/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/ctsim.html html/Makefile include/Makefile getopt/Makefile src/sample-ctrec.sh) +AC_OUTPUT(Makefile libezplot/Makefile src/Makefile libgraph/Makefile libkmath/Makefile Makefile libk/Makefile libir/Makefile libcio/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/ctsim.html html/Makefile include/Makefile getopt/Makefile src/sample-ctrec.sh cgi-bin/ctsim.conf) diff --git a/include/ir.h b/include/ir.h index 3493e75..e510c75 100644 --- a/include/ir.h +++ b/include/ir.h @@ -2,8 +2,11 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ir.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Id: ir.h,v 1.3 2000/04/29 23:24:29 kevin Exp $ ** $Log: ir.h,v $ +** Revision 1.3 2000/04/29 23:24:29 kevin +** *** empty log message *** +** ** Revision 1.2 2000/04/28 14:14:16 kevin ** *** empty log message *** ** @@ -461,8 +464,8 @@ double calc_rsum(const PICTURE *pic, const double x1, const double y1, const dou double calc_objsum(const OBJECT *obj, const double x1, const double y1, const double x2, const double y2); int clipobj(const OBJECT *obj, double *x1, double *y1, double *x2, double *y2); /* rayio.c */ -RAYSUM *raysum_create(const char *fname, const int nview, const int ndet, const int in_memory); -RAYSUM *raysum_create_from_det(const char *fname, const DETECTOR *det, const int in_memory); +RAYSUM *raysum_create(const char *fname, const int nview, const int ndet); +RAYSUM *raysum_create_from_det(const char *fname, const DETECTOR *det); RAYSUM *raysum_open(const char *filename); void raysum_alloc_views(RAYSUM *rs); void raysum_free(RAYSUM *rs); diff --git a/src/ctrec.c b/src/ctrec.c index 56297d2..3c91387 100644 --- a/src/ctrec.c +++ b/src/ctrec.c @@ -2,10 +2,14 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctrec.c,v 1.1 2000/04/28 13:02:44 kevin Exp $ +** $Id: ctrec.c,v 1.2 2000/04/29 23:24:56 kevin Exp $ ** $Log: ctrec.c,v $ -** Revision 1.1 2000/04/28 13:02:44 kevin -** Initial revision +** Revision 1.2 2000/04/29 23:24:56 kevin +** *** empty log message *** +** +** Revision 1.1.1.1 2000/04/28 13:02:44 kevin +** Initial CVS import for first public release +** ** ** ** This program is free software; you can redistribute it and/or modify @@ -21,6 +25,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ + /* FILE * ctrec.c Reconstruct an image from raysums * @@ -104,25 +109,25 @@ usage (const char *program) #ifdef MPI_CT -void mpi_scatter_rs (RAYSUM *rs_global, RAYSUM *rs_local, const int debug); +static void mpi_scatter_rs (RAYSUM *rs_global, RAYSUM *rs_local, const int debug); #endif -void print_raysum_info(const RAYSUM *rs); +static void print_raysum_info(const RAYSUM *rs); int main (const int argc, char *const argv[]) { - IMAGE *im_global; - RAYSUM *rs_global; - char *rs_name, *im_filename; + IMAGE *im_global = NULL; + RAYSUM *rs_global = NULL; + char *rs_name, *im_filename = NULL; char remark[MAXREMARK]; char filt_name[80]; int nx, ny; - double time_start, time_end; + double time_start = 0, time_end = 0; char *endptr; int opt_verbose = 0; int opt_debug = 0; int opt_trace = TRACE_NONE; - double opt_filter_param; + double opt_filter_param = 1; int opt_filter = W_A_BANDLIMIT; int opt_interp = I_LINEAR; int opt_interp_param = 1; @@ -239,10 +244,6 @@ main (const int argc, char *const argv[]) #ifdef MPI_CT if (mpi_ct.my_rank == 0) { - if (file_exists(rs_name) == FALSE) { - fprintf (stderr, "File %s does not exist\n", rs_name); - exit(1); - } rs_global = raysum_open (rs_name); raysum_read (rs_global); print_raysum_info(rs_global); @@ -259,7 +260,6 @@ main (const int argc, char *const argv[]) mpi_rotinc = rs_global->rot_inc; } - mpi_t1 = MPI_Wtime(); MPI_Bcast(&opt_verbose, 1, MPI_INT, 0, mpi_ct.comm); MPI_Bcast(&opt_debug, 1, MPI_INT, 0, mpi_ct.comm); @@ -286,17 +286,24 @@ main (const int argc, char *const argv[]) mpi_ct_calc_work_units(mpi_nview); - rs_local = raysum_create (NULL, mpi_ct.local_work_units[mpi_ct.my_rank], mpi_ndet, TRUE); - // rs_local->ndet = mpi_ndet; - // rs_local->nview = mpi_nview; + if (opt_debug) { + fprintf(stdout, "Calc'd local work units process %d: nviews=%d, local_work_units=%d, start_work_units=%d\n", + mpi_ct.my_rank, mpi_nview, mpi_ct.local_work_units[mpi_ct.my_rank], mpi_ct.start_work_unit[mpi_ct.my_rank]); + MPI_Barrier(mpi_ct.comm); + } + + rs_local = raysum_create (NULL, mpi_ct.local_work_units[mpi_ct.my_rank], mpi_ndet); + if (opt_debug) { + fprintf(stdout, "Created rs_local %lx for process %d: local views=%4d, local dets=%4d\n", (unsigned long int) rs_local, mpi_ct.my_rank, mpi_ct.local_work_units[mpi_ct.my_rank], mpi_ndet); + MPI_Barrier(mpi_ct.comm); + } + + rs_local->ndet = mpi_ndet; + rs_local->nview = mpi_nview; rs_local->det_inc = mpi_detinc; rs_local->piclen = mpi_piclen; rs_local->rot_inc = mpi_rotinc; - if (opt_debug) - fprintf(stderr, "Bcast'd rs vars, my nview=%d, local_work_units=%d, start_work_units=%d (process %d)\n", - mpi_nview, mpi_ct.local_work_units[mpi_ct.my_rank], mpi_ct.start_work_unit[mpi_ct.my_rank], mpi_ct.my_rank); - if (opt_verbose) mpi_t1 = MPI_Wtime(); mpi_scatter_rs(rs_global, rs_local, opt_debug); @@ -387,11 +394,11 @@ main (const int argc, char *const argv[]) #ifdef MPI_CT -void mpi_scatter_rs (RAYSUM *rs_global, RAYSUM *rs_local, const int opt_debug) +static void mpi_scatter_rs (RAYSUM *rs_global, RAYSUM *rs_local, const int opt_debug) { int iproc; int end_work_unit; - int iw; + int iw = 0; if (mpi_ct.my_rank == 0) { for (iproc = 0; iproc < mpi_ct.nproc; iproc++) { @@ -403,27 +410,48 @@ void mpi_scatter_rs (RAYSUM *rs_global, RAYSUM *rs_local, const int opt_debug) fprintf(stdout, "Sending rs data to process %d\n", iproc); for (iw = mpi_ct.start_work_unit[iproc]; iw <= end_work_unit; iw++) { - MPI_Send(&rs_global->view[iw]->view_angle, 1, MPI_DOUBLE, iproc, 0, mpi_ct.comm); + if (opt_debug) + fprintf(stdout, "Sending from process %2d to process %2d: view_angle=%8f, ndet=%5d\n", mpi_ct.my_rank, iproc, rs_global->view[iw]->view_angle, rs_global->view[iw]->ndet); MPI_Send(&rs_global->view[iw]->ndet, 1, MPI_INT, iproc, 0, mpi_ct.comm); + MPI_Send(&rs_global->view[iw]->view_angle, 1, MPI_DOUBLE, iproc, 0, mpi_ct.comm); MPI_Send(rs_global->view[iw]->detval, rs_global->ndet, MPI_FLOAT, iproc, 0, mpi_ct.comm); } } } + if (opt_debug) { + fprintf(stdout, "Receiving rs data in process %d\n", mpi_ct.my_rank); + MPI_Barrier(mpi_ct.comm); + } + end_work_unit = mpi_ct.local_work_units[mpi_ct.my_rank] - 1; for (iw = 0; iw <= end_work_unit; iw++) { MPI_Status status; - MPI_Recv(&rs_local->view[iw]->view_angle, 1, MPI_DOUBLE, 0, 0, mpi_ct.comm, &status); - MPI_Recv(&rs_local->view[iw]->ndet, 1, MPI_INT, 0, 0, mpi_ct.comm, &status); - MPI_Recv(rs_local->view[iw]->detval, rs_global->ndet, MPI_FLOAT, 0, 0, mpi_ct.comm, &status); + if (opt_debug) { + fprintf(stdout,"Receiving into rs_local from mpi_scatter_rs, process %2d: rs_local=%lx, ", mpi_ct.my_rank, (unsigned long int) rs_local); + fprintf(stdout,"iw=%4d, nrot=%4d, ndet=%4d, view=%lx, detval=%lx\n", iw, rs_local->nview, rs_local->ndet, (unsigned long int) rs_local->view[iw], (unsigned long int) rs_local->view[iw]->detval); + } + + // MPI_Recv(&rs_local->view[iw]->ndet, 1, MPI_INT, 0, 0, mpi_ct.comm, &status); + // MPI_Recv(&rs_local->view[iw]->view_angle, 1, MPI_DOUBLE, 0, 0, mpi_ct.comm, &status); + // MPI_Recv(rs_local->view[iw]->detval, rs_global->ndet, MPI_FLOAT, 0, 0, mpi_ct.comm, &status); + + if (opt_debug) { + fprintf(stdout, "Received view_angle=%8f, ndet=%5d\n", rs_local->view[iw]->view_angle, rs_local->view[iw]->ndet); + } } rs_local->nview = mpi_ct.local_work_units[mpi_ct.my_rank]; + if (opt_debug) { + MPI_Barrier(MPI_COMM_WORLD); + fprintf(stdout, "Done with mpi_scatter_rs in process %2d\n", mpi_ct.my_rank); + exit(0); + } } #endif -void print_raysum_info(const RAYSUM *rs) +static void print_raysum_info(const RAYSUM *rs) { printf ("Number of detectors: %d\n", rs->ndet); printf (" Number of views: %d\n", rs->nview); diff --git a/src/phm2rs.c b/src/phm2rs.c index 53c6690..1f28679 100644 --- a/src/phm2rs.c +++ b/src/phm2rs.c @@ -2,8 +2,11 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phm2rs.c,v 1.2 2000/04/28 13:50:45 kevin Exp $ +** $Id: phm2rs.c,v 1.3 2000/04/29 23:24:56 kevin Exp $ ** $Log: phm2rs.c,v $ +** Revision 1.3 2000/04/29 23:24:56 kevin +** *** empty log message *** +** ** Revision 1.2 2000/04/28 13:50:45 kevin ** Removed Makefile Makefile.in that are automatically generated by autoconf ** @@ -43,7 +46,6 @@ #define O_VERBOSE 6 #define O_HELP 7 #define O_PICFILE 8 -#define O_INMEMORY 9 #define O_DEBUG 10 #define O_VERSION 11 @@ -58,7 +60,6 @@ static struct option my_options[] = {"verbose", 0, 0, O_VERBOSE}, {"help", 0, 0, O_HELP}, {"debug", 0, 0, O_DEBUG}, - {"inmemory", 0, 0, O_INMEMORY}, {"version", 0, 0, O_VERSION}, {0, 0, 0, 0} }; @@ -93,7 +94,6 @@ if (mpi_ct.my_rank == 0) fprintf(stdout," rays Trace rays\n"); fprintf(stdout," plot Trace plot\n"); fprintf(stdout," clipping Trace clipping\n"); - fprintf(stdout," --inmemory Use memory storage\n"); fprintf(stdout," --verbose Verbose mode\n"); fprintf(stdout," --debug Debug mode\n"); fprintf(stdout," --version Print version\n"); @@ -122,7 +122,6 @@ main (const int argc, char *const argv[]) int opt_trace = 0, opt_picnum = -1; int opt_verbose = 0; int opt_debug = 0; - int opt_in_memory = FALSE; double opt_rotangle = 1; double time_start, time_end; #ifdef MPI_CT @@ -182,8 +181,6 @@ main (const int argc, char *const argv[]) case O_DEBUG: opt_debug = 1; break; - case O_INMEMORY: - opt_in_memory = 1; break; case O_TRACE: opt_trace = opt_set_trace(optarg, argv[0]); @@ -291,10 +288,10 @@ main (const int argc, char *const argv[]) #ifdef MPI_CT mpi_ct_calc_work_units(opt_nview); if (mpi_ct.my_rank == 0) { - rs_global = raysum_create_from_det (opt_outfile, det, TRUE); + rs_global = raysum_create_from_det (opt_outfile, det); } - rs_local = raysum_create_from_det (NULL, det, TRUE); + rs_local = raysum_create_from_det (NULL, det); rs_local->nview = mpi_ct.local_work_units[mpi_ct.my_rank]; if (opt_debug) printf("rs_local->nview = %d (process %d)\n", rs_local->nview, mpi_ct.my_rank); @@ -321,7 +318,7 @@ main (const int argc, char *const argv[]) printf("Time to gather rs = %f secs, Max = %f secs\n", mpi_t, mpi_t_g); } #else - rs_global = raysum_create_from_det (opt_outfile, det, opt_in_memory); + rs_global = raysum_create_from_det (opt_outfile, det); raysum_collect (rs_global, det, pic, 0, opt_trace, FALSE); #endif @@ -351,8 +348,7 @@ main (const int argc, char *const argv[]) raysum_close (rs_global); } #else - if (opt_in_memory) - raysum_write (rs_global); + raysum_write (rs_global); raysum_close (rs_global); #endif