Software Archive
Read-only legacy content
17060 Discussions

Fortran asynchronous offload (again) - possible bug??

james_B_8
Beginner
265 Views

I've built a toy program that offloads to the MIC. The structure of the program is similar to another code that I'm currently porting to the offload model for the MIC.

Basically I'm experimenting with offloading global variables asynchronously. There is some offloadable routine that uses a global variable located in another module. What I want to do is have it so that this global variable gets assigned its value in some other routine and then this value offloaded asynchronously to the MIC so that the version of the global variable on the MIC is up to date and ready for the offloadable routine to use. In practice, this global variable could be a large table for example. Here it is simply a scalar so I know that it's not necessary to offload it asynchronously, but nevertheless it should work anyway so long as I handle the signal tags properly.

I have attached my toy program.

What I'm seeing is that the code apparently works and produces the right answer. However when I run it with the OFFLOAD_REPORT envar enabled then it crashes with a terrible bug:

*** glibc detected *** ./a.out: double free or corruption (out): 0x0000000000fd7ef0 ***
======= Backtrace: =========                                                           
/lib64/libc.so.6(+0x76518)[0x7ffff710c518]                                             
/lib64/libc.so.6(cfree+0x6c)[0x7ffff71114bc]                                           
/opt/intel/mic/coi/host-linux-release/lib/libcoi_host.so(+0x36f3b)[0x7ffff4f7cf3b]     
/opt/intel/mic/coi/host-linux-release/lib/libcoi_host.so(+0x37256)[0x7ffff4f7d256]     
/opt/intel/mic/coi/host-linux-release/lib/libcoi_host.so(+0x39e89)[0x7ffff4f7fe89]     
/lib64/libpthread.so.0(+0x77b6)[0x7ffff74147b6]                                        
/lib64/libc.so.6(clone+0x6d)[0x7ffff716fc5d]                


So either there is a bug with the compiler, or there is a bug in the code that is only set off with the OFFLOAD_REPORT. Can somebody please look at my code and see if what I'm doing is wrong please?

I compiled it with version 13.1.0.146 of ifort.

0 Kudos
3 Replies
Kevin_D_Intel
Employee
265 Views

There is nothing you've done to cause the error. The error is reproducible with the Update 2 (13.1.0.146) as noted but it appears fixed in our latest Update 4 (13.1.0.183). Unfortunately it fails with all three possible values to OFFLOAD_REPORT (1|2|3) w/13.1.0146 so if possible perhaps you could install the Update 4 side-by-side w/Update 2 and use the newer release and still have Update 2 for other reasons if needed.

Not related to the failure, it is not necessary to offload MIC_SIG in main() w/OFFLOAD_TRANSFER since this is the signal variable associated with the async transfer of your global in update_global_var(). It is only necessary to initialize the signal variable’s value on the host.

0 Kudos
james_B_8
Beginner
265 Views

Yeah thanks, Kevin. Similarly, I tried it with the version 14 beta and the bug doesn't show up again. I'll shift to a newer version of the compiler.

0 Kudos
Kevin_D_Intel
Employee
265 Views

Sounds great. Glad you are able to move to the newer version because another issue w/OFFLOAD_REPORT is fixed in Update 4 and the Beta where earlier versions incorrectly report CPU_TIME of 0.00 seconds.

0 Kudos
Reply