X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fphm2if.cpp;h=0eb5c9e1ebc544c765b6788db92e2cccf4b5ce5e;hp=573cb7c697525de4790f1143c8fd8b5d72b4adff;hb=207332eec9416d299766abb697312cfd27eb890e;hpb=5cf6874680f80d238bf34535d711dc223813f951 diff --git a/src/phm2if.cpp b/src/phm2if.cpp index 573cb7c..0eb5c9e 100644 --- a/src/phm2if.cpp +++ b/src/phm2if.cpp @@ -9,7 +9,7 @@ ** 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 @@ -270,7 +270,7 @@ phm2if_main (int argc, char* argv[]) #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); @@ -305,7 +305,7 @@ phm2if_main (int argc, char* argv[]) else { if (mpiWorld.getRank() == 0) cerr << "phmnum < 0" << endl; - exit(1); + return (1); } #endif @@ -323,12 +323,12 @@ phm2if_main (int argc, char* argv[]) 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"); @@ -405,6 +405,16 @@ void mpi_gather_image (MPIWorld& mpiWorld, ImageFile* imGlobal, ImageFile* imLoc 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