Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fmpi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raphael.bach
fmpi
Commits
a0588046
Verified
Commit
a0588046
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Update error handling in `fmpi_core` module
parent
eb7d315f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fmpi_core.c
+28
-8
28 additions, 8 deletions
src/fmpi_core.c
with
28 additions
and
8 deletions
src/fmpi_core.c
+
28
−
8
View file @
a0588046
...
...
@@ -53,7 +53,12 @@ struct fmpi_ctx * fmpi_init(int * const argc, char ** argv[])
int
fmpi_exit
(
struct
fmpi_ctx
**
const
ctx
)
{
assert
(
ctx
!=
NULL
);
return
fmpi_ctx_destroy
(
ctx
);
assert
(
*
ctx
!=
NULL
);
const
int
err
=
fmpi_ctx_destroy
(
ctx
);
if
(
err
!=
FMPI_SUCCESS
)
{
fprintf
(
stderr
,
"fmpi_ctx_destroy() failed!
\n
"
);
}
return
err
;
}
/*------------------------------------------------------------------------------
fmpi_abort()
...
...
@@ -79,7 +84,7 @@ int fmpi_world_rank(const struct fmpi_ctx * const ctx)
{
assert
(
ctx
!=
NULL
);
const
int
rank
=
fmpi_mpi_world_rank
(
ctx
->
mpi
);
if
(
rank
<
0
)
{
if
(
rank
<
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_mpi_world_rank() failed!"
);
}
return
rank
;
...
...
@@ -90,11 +95,11 @@ int fmpi_world_rank(const struct fmpi_ctx * const ctx)
int
fmpi_world_barrier
(
const
struct
fmpi_ctx
*
const
ctx
)
{
assert
(
ctx
!=
NULL
);
const
int
err
_id
=
fmpi_mpi_world_barrier
(
ctx
->
mpi
);
if
(
err
_id
==
-
1
)
{
const
int
err
=
fmpi_mpi_world_barrier
(
ctx
->
mpi
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_mpi_world_barrier() failed!"
);
}
return
err
_id
;
return
err
;
}
/*------------------------------------------------------------------------------
fmpi_run_task()
...
...
@@ -105,9 +110,20 @@ int fmpi_run_task(
assert
(
ctx
!=
NULL
);
assert
(
task
!=
NULL
);
if
(
task
->
type
==
FMPI_TASK_TYPE_SYNC
)
{
return
fmpi_task_run_sync
(
ctx
,
task
);
const
int
err
=
fmpi_task_run_sync
(
ctx
,
task
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_task_run_sync() failed!"
);
}
return
err
;
}
if
(
task
->
type
==
FMPI_TASK_TYPE_ASYNC
)
{
const
int
err
=
fmpi_task_run_async
(
ctx
,
task
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_task_run_async() failed!"
);
}
return
fmpi_task_run_async
(
ctx
,
task
);
return
err
;
}
return
FMPI_ERROR
;
}
/*------------------------------------------------------------------------------
fmpi_sync()
...
...
@@ -115,5 +131,9 @@ int fmpi_run_task(
int
fmpi_sync
(
const
struct
fmpi_ctx
*
const
ctx
)
{
assert
(
ctx
!=
NULL
);
return
fmpi_futhark_sync
(
ctx
->
fut
);
const
int
err
=
fmpi_futhark_sync
(
ctx
->
fut
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_futhark_sync() failed!"
);
}
return
err
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment