Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

offload error: cannot find offload entry?

wan_b_
Beginner
5,265 Views

hi

 when I try to run  a fortran progran(compiled by mpiifort with options -offload-build -openmp) on MIC,

it appears two error :

offload error: cannot find offload entry __offload_entry_aoint_2e_dscf_F90_183aoint_2e_dscf_

offload error: process on the device 1 unexpectedly exited with code 1

I  sure the program works well with openmp ,

and I test some MIC examples on my machine to make sure the MIC works.

now I cannot find the problem, can any one help me?

thank a lot.

0 Kudos
31 Replies
baohui_f_
Beginner
1,910 Views

Thank you Kevin Davis for your immediate response.I will try it you suggested

when  I add the offload option(-offload-option,mic,ld,"-z defs"),the program turn out many undefined refereence errors,such as:

radinpMIC.o:In function 'radinp_':

/home/yyz/fbh/.............../cam1/radinp.F90:(text+0x25):undefined reference to 'time_manger_mp_get_curr_calday_'

/home/yyz/fbh/.............../cam1/radinp.F90:(text+0x74):undefined reference to 'shr_orb_mod_mp_shr_orb_dec1_'

0 Kudos
baohui_f_
Beginner
1,910 Views

hello everyone,

         I  want to know whether the following examples have the potential for causing memory leaks.

 1.        

   integer iarray(len)         

        do i=1,len  

         !dec$ offload target(mic:0)  in(iarray)

           !$omp parallel do

                do j=1,len

                    iarray(j)=j

                 end do

           !$omp end parallel do

         end do 

 

0 Kudos
baohui_f_
Beginner
1,910 Views

2.

 integer,allocatable::iarray(:)

  allocate(iarray(len))     

        do i=1,len  

         !dec$ offload target(mic:0)  in(iarray:length(len) alloc_if(.true.) alloc_if(.false.) )

           !$omp parallel do

                do j=1,len

                    iarray(j)=j

                 end do

           !$omp end parallel do

         end do 

0 Kudos
Kevin_D_Intel
Employee
1,910 Views

Sorry, I missed your reply back in December. About that, I’m guessing the numerous errors may relate to the target-side link not including the object files (.o) for routines declared in modules. Let us know if you have not resolved that issue to date.

I do not completely follow your latest question/issue related to memory leaks. What sort of behavior are you experiencing to suspect this?

I think it was just a typo and meant to be free_if, but the compiler will reject double “alloc_if” in the allocatable example.

It would really help us understand and help us offer other ideas if you can provide a complete reproducer.

0 Kudos
baohui_f_
Beginner
1,910 Views

Hello,

        I have solved the question asked on December .Actually,The question I asked last time exactly have a typo. The book  Intel Xeon Phi Coprocessor High Performance Programming  written by  Jeffers and Jim evokes the idea whether the following examples have the potential for causing memory leaks. What’s more,I know the mic card has more than 6G memory,however, the variables and arrays on the in/out/inout/nocopy of target clause I written is much less than 6G,but I often face the problems that segmentation faults and the mic memory is not enough。so,I suspect whether there is memory leak when I use alloc_if and free_if.

The book said:

Pointers  to static data on processor are special-cased. The alloc_if and free_if modifiers are

ignored when the following are both  true:

1.    The processor address used during creation of a target memory association points to statically allocated data.

2.    The variable is also available in the target binary because it has __declspec(target(mic)) or ATTRIBUTES OFFLOAD:mic

The statically allocated memory on the coprocessor is used as the destination of the transfer.

This target memory is not dynamically allocated and never freed.

     There is only one block of target memory associated with a processor address. It is an error to call alloc_if(1)[Fortran:alloc_if(.true.)] to create a second association for a processor address before freeing the existing one . The new association overwrites the earlier one,which has the potential for causing memory leaks on the target.

     It is an error to call free_if(1)[Fortran:free_if(.true.)] for a transferred pointer if a matching association is not found . The attempted removal of an association is silently ignored.An association can be made with a processor address, and a certain length, and another association made with a different processor address within that range.Since origin addresses are different;you can use alloc_if and free_if to create distinct target allocations.

 

Example 1:        

   integer iarray(len)         

        do i=1,len  

         !dec$ offload target(mic:0)  in(iarray)

           !$omp parallel do

                do j=1,len

                    iarray(j)=j

                 end do

           !$omp end parallel do

         end do 

Example  2:

 integer,allocatable::iarray(:)

  allocate(iarray(len))     

        do i=1,len  

         !dec$ offload target(mic:0)  in(iarray:length(len) alloc_if(.true.) alloc_if(.false.) )

           !$omp parallel do

                do j=1,len

         end do 

                                                         Thank you

 

 

                    iarray(j)=j

                 end do

           !$omp end parallel do

 

 

 

0 Kudos
baohui_f_
Beginner
1,910 Views

hello,

    when I use a global variable defined in a head file by including the global variable in a offloaded function,I found the value is different from the value of the global variable without ofloading.How to solve the problem ,can you give me some suggestion? Thank you.

     Following is a example routine:

0 Kudos
Kevin_D_Intel
Employee
1,910 Views

The initial value of the global sslp (assigned in example3.F90) has not been transferred to the coprocessor prior to the offload in example1.F90. Insert an offload_transfer in example3.F90 after the assignment to sslp to transfer the current value, e.g.:

!dec$ offload_transfer target(mic) in(sslp)

Be mindful that if you are running on a multi-card system then you need to offload_transfer to each card.

0 Kudos
baohui_f_
Beginner
1,910 Views

 hello Kevin Davis ,

               thank you for your reponse.Now I face a new problem about MPI+offload routine(a code segment of a MPI procedure is offloaded to MIC ),can you give me some information about  MPI+offload routine.thank you

0 Kudos
Kevin_D_Intel
Employee
1,910 Views

That is a very different question that what this thread is about. The last question was off topic also so can I please request that you start a new thread about using MPI + offload and provide more specifics about what exactly your interests are?

I have not tried MPI + offload so I must defer to experts in our forum here who have for help answering those questions so please start a new thread and with any specific questions/interests that you have.

Thank you,

0 Kudos
baohui_f_
Beginner
1,910 Views

hello,

      today I face a problem of  'mpirun: No match',any suggestions will be appreciated

0 Kudos
baohui_f_
Beginner
1,910 Views

   I faced another problem is that mic0 can't be recognised by the procudure,anyone,can  you give me some suggestion? 

0 Kudos
Reply