Skip to content

Commit

Permalink
cleaned up error codes and their doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ahbarnett committed Feb 7, 2024
1 parent cb167a7 commit b5582c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions docs/error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Error (status) codes

In all FINUFFT interfaces, the returned value ``ier`` is a status indicator.
It is ``0`` if successful, otherwise the error code
has the following meanings (see ``include/finufft_errors.h``):
has the following meanings (see codes in ``include/finufft_errors.h``):

::

1 requested tolerance epsilon too small to achieve (warning only)
2 attemped to allocate internal array larger than MAX_NF (defined in defs.h)
2 stopped due to needing internal array size >MAX_NF (defined in defs.h)
3 spreader: fine grid too small compared to spread (kernel) width
4 spreader: if chkbnds=1, a nonuniform point coordinate is out of input range [-3pi,3pi]^d
5 spreader: array allocation error
Expand All @@ -19,11 +19,11 @@ has the following meanings (see ``include/finufft_errors.h``):
8 upsampfac not a value with known Horner poly eval rule (currently 2.0 or 1.25 only)
9 ntrans not valid in "many" (vectorized) or guru interface (should be >= 1)
10 transform type invalid
11 general allocation failure
11 general internal allocation failure
12 dimension invalid
13 spread_thread option invalid
14 invalid mode array (more than ~2^31 modes, dimension with 0 modes, etc)
15 cuda failure (failure to call any cuda function/kernel)
15 CUDA failure (failure to call any cuda function/kernel, malloc/memset, etc))
16 attempt to destroy an uninitialized plan
17 invalid spread/interp method for dim (attempt to blockgather in 1D, e.g.)
18 size of bins for subprob/blockgather invalid
Expand Down
6 changes: 1 addition & 5 deletions include/finufft_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#define FINUFFT_ERRORS_H

// ---------- Global error/warning output codes for the library ---------------
// NB: if change these numbers, also must regen test/results/dumbinputs.refout
// All documentation is at ../docs/errors.rst (not here):
#define FINUFFT_WARN_EPS_TOO_SMALL 1
// this means that a fine grid array dim exceeded MAX_NF; no malloc tried...
#define FINUFFT_ERR_MAXNALLOC 2
#define FINUFFT_ERR_SPREAD_BOX_SMALL 3
#define FINUFFT_ERR_SPREAD_PTS_OUT_RANGE 4
Expand All @@ -14,17 +13,14 @@
#define FINUFFT_ERR_HORNER_WRONG_BETA 8
#define FINUFFT_ERR_NTRANS_NOTVALID 9
#define FINUFFT_ERR_TYPE_NOTVALID 10
// some generic internal allocation failure...
#define FINUFFT_ERR_ALLOC 11
#define FINUFFT_ERR_DIM_NOTVALID 12
#define FINUFFT_ERR_SPREAD_THREAD_NOTVALID 13
#define FINUFFT_ERR_NDATA_NOTVALID 14
// cuda malloc/memset/kernel failure/etc
#define FINUFFT_ERR_CUDA_FAILURE 15
#define FINUFFT_ERR_PLAN_NOTVALID 16
#define FINUFFT_ERR_METHOD_NOTVALID 17
#define FINUFFT_ERR_BINSIZE_NOTVALID 18
#define FINUFFT_ERR_INSUFFICIENT_SHMEM 19
// back to CPU errors
#define FINUFFT_ERR_NUM_NU_PTS_INVALID 20
#endif

0 comments on commit b5582c0

Please sign in to comment.