[SCore-users-jp] Re: [SCore-users] unformatted io bug gnu mpif77 score 5.8.x

kameyama @ pccluster.org kameyama @ pccluster.org
2005年 2月 22日 (火) 10:13:42 JST


In article <4219E993.7010108 @ streamline-computing.com> Nick Birkett <nick @ streamline-computing.com> wrotes:
> Platforms: RedHat 7.3,9       Score 5.8.2
>             SuSE Linux 9 64bit Score 5.8.1
> 
> When using unformatted IO in fortran, the files
> produced are incorrect when compiling with
> 
> mpif77 -compiler gnu
> 
> However
> 
> mpif77 -compiler intel8
> 
> mpif77 -compiler pgi
> 
> give the correct answer.
> 
> 
> Some test programs attached.
> 
> Under Score 5.6.1 all compilers give correct answer.

Sorry, this is bug on scwrap.
Please apply this patch on the following file:
    score-src/SCore/sclib/scwrap/lib/scwrap.c

                       from Kameyama Toyohisa
---------------------------------------cut here---------------------------------
Index: scwrap.c
===================================================================
RCS file: /develop/cvsroot/score-src/SCore/sclib/scwrap/lib/scwrap.c,v
retrieving revision 1.28
retrieving revision 1.32
diff -u -r1.28 -r1.32
--- scwrap.c	18 Nov 2004 08:05:54 -0000	1.28
+++ scwrap.c	23 Dec 2004 23:36:43 -0000	1.32
@@ -239,7 +239,7 @@
   int whence = va_arg(args, int);
 
   *(int*)retp = syscall(SYS__llseek, fd, 
-			offset_high, offset_low, &result, whence);
+			offset_high, offset_low, result, whence);
 }
 #endif
 
@@ -1208,29 +1208,31 @@
 }
 
 #if ULONG_MAX < 0xffffffffffffffffULL
-int ___llseek(int fd, u_long offset_high, u_long offset_low, loff_t *result, int whence) {
+loff_t __llseek(int fd, loff_t offset, int whence) {
   int ret;
+  off_t offset_high = (off_t)(offset >> 32);
+  off_t offset_low  = (off_t) (offset & 0xffffffff);
+  loff_t result;
 
-  if (score_syscall(get_handle(SYS__llseek), &ret, fd, offset_high, offset_low, result, whence) == -1) {
+  if (score_syscall(get_handle(SYS__llseek), &ret, fd, offset_high, offset_low,
+			  &result, whence) == -1) {
     ret = -1;
   }
-  return ret;
-}
-
-int _llseek(int fd, u_long offset_high, u_long offset_low, loff_t *result, int whence) {
-  return ___llseek(fd, offset_high, offset_low, result, whence);
+  if(ret != 0)
+     return (loff_t)ret;
+  return result;
 }
 
-int llseek(int fd, u_long offset_high, u_long offset_low, loff_t *result, int whence) {
-  return ___llseek(fd, offset_high, offset_low, result, whence);
+loff_t llseek(int fd, loff_t offset, int whence) {
+  return __llseek(fd, offset, whence);
 }
 
-int __lseek64(int fd, u_long offset_high, u_long offset_low, loff_t *result, int whence) {
-  return ___llseek(fd, offset_high, offset_low, result, whence);
+loff_t __lseek64(int fd, loff_t offset, int whence) {
+  return __llseek(fd, offset, whence);
 }
 
-int lseek64(int fd, u_long offset_high, u_long offset_low, loff_t *result, int whence) {
-  return ___llseek(fd, offset_high, offset_low, result, whence);
+loff_t lseek64(int fd, loff_t offset, int whence) {
+  return __llseek(fd, offset, whence);
 }
 #endif
 
---------------------------------------cut here---------------------------------
_______________________________________________
SCore-users mailing list
SCore-users @ pccluster.org
http://www.pccluster.org/mailman/listinfo/score-users



SCore-users-jp メーリングリストの案内