Because of the “data is partically exists in device”, I changed to solve the problem with cuda. However, when I link the program, it occurred the following problem.
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DPG -DDBLE_PRECSN -acc -ta=tesla -Mfixed -Minfo=accel -Mcuda=rdc -o cfl3d_mpi development.o data_x.o main.o \
libdist.a libcommon.a -L/home/xiell/pgi/linux86-64/2018/mpi/openmpi-2.1.2/lib
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:16:36: error: redefinition of ‘__cudaRegisterLinkedBinary_8data_x_F’
#define __REGISTERFUNCNAME_CORE(X) __cudaRegisterLinkedBinary##X
^
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:17:31: note: in expansion of macro ‘__REGISTERFUNCNAME_CORE’
#define __REGISTERFUNCNAME(X) __REGISTERFUNCNAME_CORE(X)
^
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:22:8: note: in expansion of macro ‘__REGISTERFUNCNAME’
void __REGISTERFUNCNAME(id)(void (*callback_fp)(void **), \
^
/tmp/pgcudaayCibaqy1hWiG.reg.c:36:1: note: in expansion of macro ‘DEFINE_REGISTER_FUNC’
DEFINE_REGISTER_FUNC(_8data_x_F)
^
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:16:36: note: previous definition of ‘__cudaRegisterLinkedBinary_8data_x_F’ was here
#define __REGISTERFUNCNAME_CORE(X) __cudaRegisterLinkedBinary##X
^
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:17:31: note: in expansion of macro ‘__REGISTERFUNCNAME_CORE’
#define __REGISTERFUNCNAME(X) __REGISTERFUNCNAME_CORE(X)
^
/home/xll/pgi/linux86-64/18.4/include_acc/linkstub.c:22:8: note: in expansion of macro ‘__REGISTERFUNCNAME’
void __REGISTERFUNCNAME(id)(void (*callback_fp)(void **), \
^
/tmp/pgcudaayCibaqy1hWiG.reg.c:2:1: note: in expansion of macro ‘DEFINE_REGISTER_FUNC’
DEFINE_REGISTER_FUNC(_8data_x_F)
^
pgacclnk: child process exit status 2: /home/xll/pgi/linux86-64/18.4/bin/pgnvd
the structure of the program is as follows:
PROGRAM
MAIN.F
DATA.F
A.F
B.F
C.F
END PROGRAM
the compile order is DATA.F C.F B.F A.F MAIN.F. All the code are compiled with"mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DPG -DDBLE_PRECSN -fast -r8 -acc -ta=tesla -Mfixed -Minfo=accel -Mcuda=rdc -c *.F"
DATA.F defines some common variable, and it also includes some “!$acc decleare create”.
C.F defines a device function.
B.F defines a kernel function that invoke C.
A.F is a function that invoke B.
MAIN.F invokes A.
Where maight be wrong?