Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
80196940
Commit
80196940
authored
Jul 14, 2011
by
Daniel Carrera
Committed by
Daniel Carrera
Jul 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove error parameter from caf_runtime_error. Add caf_runtime_error to single.c.
From-SVN: r176278
parent
d772f97c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
libgfortran/ChangeLog
+13
-0
libgfortran/caf/mpi.c
+7
-6
libgfortran/caf/single.c
+19
-6
No files found.
libgfortran/ChangeLog
View file @
80196940
2011-07-14 Daniel Carrera <dcarrera@gmail.com>
* caf/single.c: Include stdarg.h header.
(caf_runtime_error): New function. Use "exit(EXIT_FAILURE)".
(_gfortran_caf_register): Use caf_runtime_error.
(_gfortran_caf_sync_images): Use "exit(EXIT_FAILURE)".
* caf/mpi.c (caf_runtime_error): Remove "error" parameter.
Return EXIT_FAILURE instead.
(_gfortran_caf_register): Update call to caf_runtime_error.
(_gfortran_caf_sync_all): Ditto.
(_gfortran_caf_sync_images): Ditto.
(_gfortran_caf_error_stop_str): Use "exit(EXIT_FAILURE)".
2011-07-13 Janne Blomqvist <jb@gcc.gnu.org>
2011-07-13 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/49296
PR libfortran/49296
...
...
libgfortran/caf/mpi.c
View file @
80196940
...
@@ -47,8 +47,9 @@ static int caf_is_finalized;
...
@@ -47,8 +47,9 @@ static int caf_is_finalized;
caf_static_t
*
caf_static_list
=
NULL
;
caf_static_t
*
caf_static_list
=
NULL
;
/* Keep in sync with single.c. */
static
void
static
void
caf_runtime_error
(
int
error
,
const
char
*
message
,
...)
caf_runtime_error
(
const
char
*
message
,
...)
{
{
va_list
ap
;
va_list
ap
;
fprintf
(
stderr
,
"Fortran runtime error on image %d: "
,
caf_this_image
);
fprintf
(
stderr
,
"Fortran runtime error on image %d: "
,
caf_this_image
);
...
@@ -59,10 +60,10 @@ caf_runtime_error (int error, const char *message, ...)
...
@@ -59,10 +60,10 @@ caf_runtime_error (int error, const char *message, ...)
/* FIXME: Shutdown the Fortran RTL to flush the buffer. PR 43849. */
/* FIXME: Shutdown the Fortran RTL to flush the buffer. PR 43849. */
/* FIXME: Do some more effort than just MPI_ABORT. */
/* FIXME: Do some more effort than just MPI_ABORT. */
MPI_Abort
(
MPI_COMM_WORLD
,
error
);
MPI_Abort
(
MPI_COMM_WORLD
,
EXIT_FAILURE
);
/* Should be unreachable, but to make sure also call exit. */
/* Should be unreachable, but to make sure also call exit. */
exit
(
2
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -179,7 +180,7 @@ error:
...
@@ -179,7 +180,7 @@ error:
}
}
}
}
else
else
caf_runtime_error
(
caf_is_finalized
?
STAT_STOPPED_IMAGE
:
1
,
msg
);
caf_runtime_error
(
msg
);
}
}
return
NULL
;
return
NULL
;
...
@@ -223,7 +224,7 @@ _gfortran_caf_sync_all (int *stat, char *errmsg, int errmsg_len)
...
@@ -223,7 +224,7 @@ _gfortran_caf_sync_all (int *stat, char *errmsg, int errmsg_len)
memset
(
&
errmsg
[
len
],
' '
,
errmsg_len
-
len
);
memset
(
&
errmsg
[
len
],
' '
,
errmsg_len
-
len
);
}
}
else
else
caf_runtime_error
(
caf_is_finalized
?
STAT_STOPPED_IMAGE
:
ierr
,
msg
);
caf_runtime_error
(
msg
);
}
}
}
}
...
@@ -291,7 +292,7 @@ _gfortran_caf_sync_images (int count, int images[], int *stat, char *errmsg,
...
@@ -291,7 +292,7 @@ _gfortran_caf_sync_images (int count, int images[], int *stat, char *errmsg,
memset
(
&
errmsg
[
len
],
' '
,
errmsg_len
-
len
);
memset
(
&
errmsg
[
len
],
' '
,
errmsg_len
-
len
);
}
}
else
else
caf_runtime_error
(
caf_is_finalized
?
STAT_STOPPED_IMAGE
:
ierr
,
msg
);
caf_runtime_error
(
msg
);
}
}
}
}
...
...
libgfortran/caf/single.c
View file @
80196940
...
@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
...
@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <stdio.h>
/* For fputs and fprintf. */
#include <stdio.h>
/* For fputs and fprintf. */
#include <stdlib.h>
/* For exit and malloc. */
#include <stdlib.h>
/* For exit and malloc. */
#include <string.h>
/* For memcpy and memset. */
#include <string.h>
/* For memcpy and memset. */
#include <stdarg.h>
/* For variadic arguments. */
/* Define GFC_CAF_CHECK to enable run-time checking. */
/* Define GFC_CAF_CHECK to enable run-time checking. */
/* #define GFC_CAF_CHECK 1 */
/* #define GFC_CAF_CHECK 1 */
...
@@ -40,6 +41,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
...
@@ -40,6 +41,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
caf_static_t
*
caf_static_list
=
NULL
;
caf_static_t
*
caf_static_list
=
NULL
;
/* Keep in sync with mpi.c. */
static
void
caf_runtime_error
(
const
char
*
message
,
...)
{
va_list
ap
;
fprintf
(
stderr
,
"Fortran runtime error: "
);
va_start
(
ap
,
message
);
fprintf
(
stderr
,
message
,
ap
);
va_end
(
ap
);
fprintf
(
stderr
,
"
\n
"
);
/* FIXME: Shutdown the Fortran RTL to flush the buffer. PR 43849. */
exit
(
EXIT_FAILURE
);
}
void
void
_gfortran_caf_init
(
int
*
argc
__attribute__
((
unused
)),
_gfortran_caf_init
(
int
*
argc
__attribute__
((
unused
)),
char
***
argv
__attribute__
((
unused
)),
char
***
argv
__attribute__
((
unused
)),
...
@@ -73,12 +89,12 @@ _gfortran_caf_register (ptrdiff_t size, caf_register_t type, void **token,
...
@@ -73,12 +89,12 @@ _gfortran_caf_register (ptrdiff_t size, caf_register_t type, void **token,
if
(
unlikely
(
local
==
NULL
||
token
==
NULL
))
if
(
unlikely
(
local
==
NULL
||
token
==
NULL
))
{
{
const
char
msg
[]
=
"Failed to allocate coarray"
;
if
(
stat
)
if
(
stat
)
{
{
*
stat
=
1
;
*
stat
=
1
;
if
(
errmsg_len
>
0
)
if
(
errmsg_len
>
0
)
{
{
const
char
msg
[]
=
"Failed to allocate coarray"
;
int
len
=
((
int
)
sizeof
(
msg
)
>
errmsg_len
)
?
errmsg_len
int
len
=
((
int
)
sizeof
(
msg
)
>
errmsg_len
)
?
errmsg_len
:
(
int
)
sizeof
(
msg
);
:
(
int
)
sizeof
(
msg
);
memcpy
(
errmsg
,
msg
,
len
);
memcpy
(
errmsg
,
msg
,
len
);
...
@@ -88,10 +104,7 @@ _gfortran_caf_register (ptrdiff_t size, caf_register_t type, void **token,
...
@@ -88,10 +104,7 @@ _gfortran_caf_register (ptrdiff_t size, caf_register_t type, void **token,
return
NULL
;
return
NULL
;
}
}
else
else
{
caf_runtime_error
(
msg
);
fprintf
(
stderr
,
"ERROR: Failed to allocate coarray"
);
exit
(
1
);
}
}
}
if
(
stat
)
if
(
stat
)
...
@@ -140,7 +153,7 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
...
@@ -140,7 +153,7 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
{
{
fprintf
(
stderr
,
"COARRAY ERROR: Invalid image index %d to SYNC "
fprintf
(
stderr
,
"COARRAY ERROR: Invalid image index %d to SYNC "
"IMAGES"
,
images
[
i
]);
"IMAGES"
,
images
[
i
]);
exit
(
1
);
exit
(
EXIT_FAILURE
);
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment