source: ThirdParty/mpqc_open/src/lib/util/psi3/libpsio/error.cc@ 00f983

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 00f983 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*!
2** \file error.cc
3** \ingroup (PSIO)
4*/
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <util/psi3/libpsio/psio.h>
9#include <util/psi3/libpsio/psifiles.h>
10
11namespace psi3 {
12namespace libpsio {
13
14/*!
15** \ingroup (PSIO)
16**
17** PSIO_ERROR(): Print out an error message for libpsio.
18**
19** \param unit = file number
20** \param errval = error code (defined symbolically, PSIO_ERROR_XXX)
21**
22*/
23void psio_error(unsigned int unit, unsigned int errval)
24{
25 int i;
26
27 fprintf(stderr, "PSIO_ERROR: unit = %d\n", unit);
28 /* Try to save the TOCs for all open units */
29 /* psio_tocwrite() does not call psio_error() so this is OK */
30 for(i=0; i < PSIO_MAXUNIT; i++) psio_tocwrite(i);
31
32 switch(errval) {
33 case PSIO_ERROR_INIT:
34 fprintf(stderr, "PSIO_ERROR: %d (I/O inititalization failed)\n",
35 PSIO_ERROR_INIT);
36 break;
37 case PSIO_ERROR_DONE:
38 fprintf(stderr, "PSIO_ERROR: %d (I/O cleanup failed)\n",
39 PSIO_ERROR_DONE);
40 break;
41 case PSIO_ERROR_MAXVOL:
42 fprintf(stderr, "PSIO_ERROR: %d (maximum number of volumes exceeded)\n",
43 PSIO_ERROR_MAXVOL);
44 break;
45 case PSIO_ERROR_NOVOLPATH:
46 fprintf(stderr, "PSIO_ERROR: %d (no volume path given)\n",
47 PSIO_ERROR_NOVOLPATH);
48 break;
49 case PSIO_ERROR_IDENTVOLPATH:
50 fprintf(stderr, "PSIO_ERROR: %d (two identical volume paths)\n",
51 PSIO_ERROR_IDENTVOLPATH);
52 break;
53 case PSIO_ERROR_OPEN:
54 fprintf(stderr, "PSIO_ERROR: %d (file not open or open call failed)\n",
55 PSIO_ERROR_OPEN);
56 break;
57 case PSIO_ERROR_REOPEN:
58 fprintf(stderr, "PSIO_ERROR: %d (file is already open)\n",
59 PSIO_ERROR_REOPEN);
60 break;
61 case PSIO_ERROR_CLOSE:
62 fprintf(stderr, "PSIO_ERROR: %d (file close failed)\n",
63 PSIO_ERROR_CLOSE);
64 break;
65 case PSIO_ERROR_RECLOSE:
66 fprintf(stderr, "PSIO_ERROR: %d (file is already closed)\n",
67 PSIO_ERROR_RECLOSE);
68 break;
69 case PSIO_ERROR_OSTAT:
70 fprintf(stderr, "PSIO_ERROR: %d (invalid status flag for file open)\n",
71 PSIO_ERROR_OSTAT);
72 break;
73 case PSIO_ERROR_LSEEK:
74 fprintf(stderr, "PSIO_ERROR: %d (lseek failed)\n",
75 PSIO_ERROR_LSEEK);
76 break;
77 case PSIO_ERROR_NOTOCENT:
78 fprintf(stderr, "PSIO_ERROR: %d (no such TOC entry)\n",
79 PSIO_ERROR_NOTOCENT);
80 break;
81 case PSIO_ERROR_TOCENTSZ:
82 fprintf(stderr, "PSIO_ERROR: %d (TOC entry size mismatch)\n",
83 PSIO_ERROR_TOCENTSZ);
84 break;
85 case PSIO_ERROR_KEYLEN:
86 fprintf(stderr, "PSIO_ERROR: %d (TOC key too long)\n",
87 PSIO_ERROR_KEYLEN);
88 break;
89 case PSIO_ERROR_BLKSIZ:
90 fprintf(stderr, "PSIO_ERROR: %d (Requested blocksize invalid)\n",
91 PSIO_ERROR_BLKSIZ);
92 break;
93 case PSIO_ERROR_BLKSTART:
94 fprintf(stderr, "PSIO_ERROR: %d (Incorrect block start address)\n",
95 PSIO_ERROR_BLKSTART);
96 break;
97 case PSIO_ERROR_BLKEND:
98 fprintf(stderr, "PSIO_ERROR: %d (Incorrect block end address)\n",
99 PSIO_ERROR_BLKEND);
100 break;
101 }
102 exit(PSI_RETURN_FAILURE);
103}
104
105}
106}
Note: See TracBrowser for help on using the repository browser.