public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Testsuite integration for devel/coarray_native
@ 2020-12-06 17:37 dhumieres.dominique
  2020-12-06 21:52 ` Thomas König
  0 siblings, 1 reply; 3+ messages in thread
From: dhumieres.dominique @ 2020-12-06 17:37 UTC (permalink / raw)
  To: tk; +Cc: fortran

Hi Thomas,

> I'm currently trying to put together a testsuite for the shared coarray
> branch.  What I have so far is a directory
> gcc/testsuite/gfortran.dg/caf-shared
> which contains the attached dejagnu file plus the test cases

I don't see the point to introduce a new directory.
IMO all the tests for coarray should pass for shared coarray
and a simple test would be to add

     foreach flags $option_list {
	verbose "Testing $nshort (libcaf_single), $flags" 1
         set gfortran_aux_module_flags "-fcoarray=shared $flags 
-lcaf_shared"
	dg-test $test "-fcoarray=shared $flags -lcaf_shared $maybe_atomic_lib" 
""
	cleanup-modules ""
     }

at the end of gfortran.dg/coarray/caf.exp.
This will cover the check of more than 60 programs.

In addition greping for "fcoarray=" in gfortran.dg shows 200 programs
which should be moved to gfortran.dg/coarray/.

> but I am not sure if this is the right way to go about this
> (would this work in the absence of an installed caf_shared library,
> would this cause lots of failures on systems without pthreads, ...?)

Presently if shared coarray is not supported it is impossible to 
bootstrap.
IMO for the moment it is putting "la charrue avant le boeufs" (the plow
before the oxen) to discuss what to do for the tests before having
a solution to bootstrap without -lcaf_shared.

I don't thing the shared coarray tests should go under libgomp.

Cheers,

Dominique

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Testsuite integration for devel/coarray_native
@ 2020-12-05 15:13 Thomas König
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas König @ 2020-12-05 15:13 UTC (permalink / raw)
  To: fortran; +Cc: gcc mailing list

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

Hi,

I'm currently trying to put together a testsuite for the shared coarray
branch.  What I have so far is a directory 
gcc/testsuite/gfortran.dg/caf-shared
which contains the attached dejagnu file plus the test cases

This works with the command

make check-fortran RUNTESTFLAGS="cas.exp=num_images_1.f90"

but I am not sure if this is the right way to go about this
(would this work in the absence of an installed caf_shared library,
would this cause lots of failures on systems without pthreads, ...?)

On some systems, we need librt for shm_open. Since most shared
coarray tests run at the number of CPUs by default, the tests
should probably not be run in parallel.

Might it be better to put the test cases under the libgomp
directory?  If so, what should it look like, and how would it
then be invoked if only testing for shared coarrays was needed?

Any help would be appreciated.

Best regards

	Thomas


[-- Attachment #2: cas.exp --]
[-- Type: text/plain, Size: 1968 bytes --]

# Copyright (C) 2020 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.
#
# Contributed by Thomas König <tkoenig@gcc.gnu.org>

# Test shared coarray support.

load_lib gfortran-dg.exp

set blddir [lookfor_file [get_multilibs] libcaf_shared]
puts $blddir

dg-init

global gfortran_test_path
global gfortran_aux_module_flags
set gfortran_test_path $srcdir/$subdir

# Return true if the rt library is supported on the target.
proc check_effective_target_librt_available { } {
    return [check_no_compiler_messages librt_available executable {
	int main (void) { return 0; }
    } "-lrt"]
}

set maybe_rt_lib ""
if [check_effective_target_librt_available] {
    set maybe_rt_lib "-lrt"
}

# Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
    # If we're only testing specific files and this isn't one of them, skip it.
    if ![runtest_file_p $runtests $test] then {
	continue
    }
    set option_list [list { -O2 } ]

    set nshort [file tail [file dirname $test]]/[file tail $test]
    list-module-names $test

    foreach flags $option_list {
	verbose "Testing $nshort (libcaf_single), $flags" 1
        set gfortran_aux_module_flags "-pthread -fcoarray=shared $flags -lcaf_single"
	dg-test $test "-pthread -fcoarray=shared $flags -lcaf_shared $maybe_rt_lib" ""
	cleanup-modules ""
    }
}

[-- Attachment #3: num_images_1.f90 --]
[-- Type: text/x-fortran, Size: 147 bytes --]

! { dg-do run }
! { dg-set-target-env-var GFORTRAN_NUM_IMAGES "2" }
program main
  implicit none
  if (num_images() /= 2) stop 1
end program main


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-06 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 17:37 Testsuite integration for devel/coarray_native dhumieres.dominique
2020-12-06 21:52 ` Thomas König
  -- strict thread matches above, loose matches on Subject: below --
2020-12-05 15:13 Thomas König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).