** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: phm2if.cpp,v 1.10 2000/06/18 10:27:11 kevin Exp $
+** $Id: phm2if.cpp,v 1.11 2000/06/19 17:58:13 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#endif
#ifdef HAVE_MPI
- TimerMPI timerBcast (mpiWorld.getComm());
+ TimerCollectiveMPI timerBcast (mpiWorld.getComm());
mpiWorld.getComm().Bcast (&opt_verbose, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&opt_debug, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&opt_trace, 1, MPI::INT, 0);
else {
if (mpiWorld.getRank() == 0)
cerr << "phmnum < 0" << endl;
- exit(1);
+ return (1);
}
#endif
image_filter_response (*imGlobal, opt_filter_domain, opt_filter_bw, opt_filter, opt_filter_param, opt_trace);
}
} else {
- TimerMPI timerRasterize (mpiWorld.getComm());
+ TimerCollectiveMPI timerRasterize (mpiWorld.getComm());
phm_to_imagefile (phm, *imLocal, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits(), opt_nsample, opt_trace);
if (opt_verbose)
timerRasterize.timerEndAndReport ("Time to rasterize phantom");
- TimerMPI timerGather (mpiWorld.getComm());
+ TimerCollectiveMPI timerGather (mpiWorld.getComm());
mpi_gather_image (mpiWorld, imGlobal, imLocal, opt_debug);
if (opt_verbose)
timerGather.timerEndAndReport ("Time to gather image");
int
main (int argc, char* argv[])
{
- return (phm2if_main(argc, argv));
+ int retval = 1;
+
+ try {
+ retval = phm2if_main(argc, argv);
+ } catch (exception e) {
+ cerr << "Exception: " << e.what() << endl;
+ } catch (...) {
+ cerr << "Unknown exception" << endl;
+ }
+
+ return (retval);
}
#endif