Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

sigsegv unexpected for parallelisation of private allocated array

$
0
0

A bit of F90 code attached that I am using to see about speeding up the reading in of a number of files. I have 3 OpenMP parallelisation techniques:

(a) allocate array INPUTS, then enter PAR with PRIVATE(INPUTS) - since each thread reads its own data in to INPUTS from a different file

(b) within the PAR DO combo with PRIVATE(INPUTS), then allocate-read-deallocate per iteration

(c) have a PAR fork with PRIVATE(INPUTS), then allocate INPUTS on each thread, then a distributed DO to share reading of files over threads

 

but despite trying on different machines and different versions of Intel ifort compiler, for (a) even with 2 threads I get a sigsegv, sometimes at entry to the PAR DO but sometimes on the 3rd iteration of the loop, whereas the other 2 approaches both work fine. As far as I can see the memory usage is no bigger for (a) so why the sigsegv eg:

 

   file read: chkSum:   5243196.    
    file closed successfully
    file read: chkSum:   5243196.    
    file closed successfully
 PAR-(c) reads took:   41.4187059402466     

Program received signal SIGSEGV, Segmentation fault.
0x0000000000406c67 in L_MAIN___132__par_loop3_2_2 () at thrasher.f90:132
132     !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(filename, myStatus, stream, inputs)
Missing separate debuginfos, use: debuginfo-install libgcc-4.4.7-23.el6.x86_64
(gdb) l
127       ! read files in PARALLEL (a) single alloc pre-PAR
128       start=omp_get_wtime()
129       allocate(inputs(numReals), stat=myStatus)
130       if (myStatus /= 0) stop 'error allocating par-(a) inputs'
131
132     !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(filename, myStatus, stream, inputs)
133       do i=1, numFiles
134          stream=50+i
135          filename(1:5)="fort."
136          filename(6:8)=val2str(i)
(gdb) quit
 

AttachmentSize
Downloadapplication/octet-streamthrasher.f905.35 KB

Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>