From d1432e5bd8fedc8e23494bf02ab84bd9bf91ec29 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 26 Nov 2023 08:15:40 +0100 Subject: [PATCH] allow MPI parallel execution --- src/test/test_IO.f90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/test_IO.f90 b/src/test/test_IO.f90 index c1a750bc0..0ec2495a0 100644 --- a/src/test/test_IO.f90 +++ b/src/test/test_IO.f90 @@ -1,5 +1,6 @@ module test_IO use prec + use parallelization use IO implicit none(type,external) @@ -14,24 +15,25 @@ subroutine test_IO_run() real, dimension(30) :: rnd_real character(len=size(rnd_real)) :: rnd_str character(len=pSTRLEN), dimension(1) :: strarray_out - character(len=:), allocatable :: str_out + character(len=:), allocatable :: str_out, fname integer :: u,i call IO_selfTest() call random_number(rnd_real) + fname = 'test'//IO_intAsStr(worldrank)//'.txt' do i = 1, size(rnd_real) rnd_str(i:i) = char(32 + int(rnd_real(i)*(127.-32.))) end do - open(newunit=u,file='test.txt',status='replace',form='formatted') + open(newunit=u,file=fname,status='replace',form='formatted') write(u,'(a)') rnd_str close(u) - str_out = IO_read('test.txt') + str_out = IO_read(fname) if (rnd_str//IO_EOL /= str_out) error stop 'IO_read' - strarray_out = IO_readlines('test.txt') + strarray_out = IO_readlines(fname) if (rnd_str /= strarray_out(1)) error stop 'IO_readlines' end subroutine test_IO_run