summaryrefslogtreecommitdiff
path: root/libgfortran/caf/single.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-06 18:35:00 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-06 18:35:00 +0000
commit84deca68acbb6725d98b1a18f9631cb0fea7a122 (patch)
tree1afaa1e180693afcdcb19e2fe41817bef8308c16 /libgfortran/caf/single.c
parent33d43ac01719b79eb19b4f3fb94373705c51e4cb (diff)
downloadgcc-84deca68acbb6725d98b1a18f9631cb0fea7a122.tar.gz
2011-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 * caf/libcaf.h: Cleanup headers. (_gfortran_caf_critical, _gfortran_caf_end_critical): Make stub. (caf_register_t): New enum. (_gfortran_caf_register, _gfortran_caf_deregister): New prototype. * caf/single.c (_gfortran_caf_critical, _gfortran_caf_end_critical): Remove. (_gfortran_caf_register, _gfortran_caf_deregister): New functions. * caf/mpi.c (_gfortran_caf_critical, _gfortran_caf_end_critical): Remove. (_gfortran_caf_register, _gfortran_caf_deregister): New functions. (caf_world_window): Remove global variable. (_gfortran_caf_init): Fix off-by-one error of this_image. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173505 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/caf/single.c')
-rw-r--r--libgfortran/caf/single.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index 7ee37b3a99d..c5c66b4b955 100644
--- a/libgfortran/caf/single.c
+++ b/libgfortran/caf/single.c
@@ -26,16 +26,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libcaf.h"
#include <stdio.h> /* For fputs and fprintf. */
-#include <stdlib.h> /* For exit. */
+#include <stdlib.h> /* For exit and malloc. */
/* Define GFC_CAF_CHECK to enable run-time checking. */
/* #define GFC_CAF_CHECK 1 */
-
/* Single-image implementation of the CAF library.
Note: For performance reasons -fcoarry=single should be used
rather than this library. */
+
void
_gfortran_caf_init (int *argc __attribute__ ((unused)),
char ***argv __attribute__ ((unused)),
@@ -45,11 +45,30 @@ _gfortran_caf_init (int *argc __attribute__ ((unused)),
*num_images = 1;
}
+
void
_gfortran_caf_finalize (void)
{
}
+
+void *
+_gfortran_caf_register (ptrdiff_t size,
+ caf_register_t type __attribute__ ((unused)),
+ void **token)
+{
+ *token = NULL;
+ return malloc (size);
+}
+
+
+int
+_gfortran_caf_deregister (void **token __attribute__ ((unused)))
+{
+ return 0;
+}
+
+
int
_gfortran_caf_sync_all (char *errmsg __attribute__ ((unused)),
int errmsg_len __attribute__ ((unused)))
@@ -78,15 +97,6 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
return 0;
}
-void
-_gfortran_caf_critical (void)
-{
-}
-
-void
-_gfortran_caf_end_critical (void)
-{
-}
void
_gfortran_caf_error_stop_str (const char *string, int32_t len)
@@ -99,6 +109,7 @@ _gfortran_caf_error_stop_str (const char *string, int32_t len)
exit (1);
}
+
void
_gfortran_caf_error_stop (int32_t error)
{