[Openmp-commits] [PATCH] D68100: [OpenMP 5.0] declare mapper runtime implementation

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 22 13:10:16 PDT 2020


protze.joachim added a comment.

Ok, the bisecting did not really reveal anything new. The test fails with and without the env var for 140ab574 <https://reviews.llvm.org/rG140ab574a1c81e0878b3238520302509457242d0> , starting with 537b16e9 <https://reviews.llvm.org/rG537b16e9b8da97054663daf638a6c55026af2fe4> the test succeeds with `env LIBOMPTARGET_DEBUG=1`

@grokos Why do you think, it's not the runtime, if the same executable is behaving differently just based on this env variable?

>From me this looks like one of the debugging statements has a side effect, which disappears when I execute without the debugging variable.

  $ env LIBOMPTARGET_DEBUG=0 projects/openmp/libomptarget/test/mapping/Output/declare_mapper_target.cpp.tmp-nvptx64-nvidia-cuda 
  Sum = 1024
  $ env LIBOMPTARGET_DEBUG=1 projects/openmp/libomptarget/test/mapping/Output/declare_mapper_target.cpp.tmp-nvptx64-nvidia-cuda 
  Libomptarget --> Loading RTLs...
  Libomptarget --> Loading library 'libomptarget.rtl.ve.so'...
  Libomptarget --> Unable to load library 'libomptarget.rtl.ve.so': libomptarget.rtl.ve.so: cannot open shared object file: No such file or directory!
  Libomptarget --> Loading library 'libomptarget.rtl.ppc64.so'...
  Libomptarget --> Unable to load library 'libomptarget.rtl.ppc64.so': libomptarget.rtl.ppc64.so: cannot open shared object file: No such file or directory!
  Libomptarget --> Loading library 'libomptarget.rtl.x86_64.so'...
  Libomptarget --> Successfully loaded library 'libomptarget.rtl.x86_64.so'!
  Libomptarget --> Registering RTL libomptarget.rtl.x86_64.so supporting 4 devices!
  Libomptarget --> Loading library 'libomptarget.rtl.cuda.so'...
  Target CUDA RTL --> Start initializing CUDA
  Libomptarget --> Successfully loaded library 'libomptarget.rtl.cuda.so'!
  Libomptarget --> Registering RTL libomptarget.rtl.cuda.so supporting 1 devices!
  Libomptarget --> Loading library 'libomptarget.rtl.aarch64.so'...
  Libomptarget --> Unable to load library 'libomptarget.rtl.aarch64.so': libomptarget.rtl.aarch64.so: cannot open shared object file: No such file or directory!
  Libomptarget --> RTLs loaded!
  Libomptarget --> Image 0x0000000000401350 is NOT compatible with RTL libomptarget.rtl.x86_64.so!
  Libomptarget --> Image 0x0000000000401350 is compatible with RTL libomptarget.rtl.cuda.so!
  Libomptarget --> RTL 0x000000000063d430 has index 0!
  Libomptarget --> Registering image 0x0000000000401350 with RTL libomptarget.rtl.cuda.so!
  Libomptarget --> Done registering entries!
  Libomptarget --> Call to omp_get_num_devices returning 1
  Libomptarget --> Default TARGET OFFLOAD policy is now mandatory (devices were found)
  Libomptarget --> Checking whether device 0 is ready.
  Libomptarget --> Is the device 0 (local ID 0) initialized? 0
  Target CUDA RTL --> Init requires flags to 1
  Target CUDA RTL --> Getting device 0
  Target CUDA RTL --> The primary context is inactive, set its flags to CU_CTX_SCHED_BLOCKING_SYNC
  Target CUDA RTL --> Max CUDA blocks per grid 2147483647 exceeds the hard team limit 65536, capping at the hard limit
  Target CUDA RTL --> Using 1024 CUDA threads per block
  Target CUDA RTL --> Using warp size 32
  Target CUDA RTL --> Max number of CUDA blocks 65536, threads 1024 & warp size 32
  Target CUDA RTL --> Default number of teams set according to library's default 128
  Target CUDA RTL --> Default number of threads set according to library's default 128
  Libomptarget --> Device 0 is ready to use.
  Target CUDA RTL --> Load data from image 0x0000000000401350
  Target CUDA RTL --> CUDA module successfully loaded!
  Target CUDA RTL --> Entry point 0x0000000000000000 maps to __omp_offloading_13_a6fc814_main_l25 (0x0000000000ee5510)
  Target CUDA RTL --> Sending global device environment data 4 bytes
  Libomptarget --> __kmpc_push_target_tripcount(0, 1024)
  Libomptarget --> Entering target region with entry point 0x0000000000401301 and device Id -1
  Libomptarget --> Checking whether device 0 is ready.
  Libomptarget --> Is the device 0 (local ID 0) initialized? 1
  Libomptarget --> Device 0 is ready to use.
  Libomptarget --> Entry  0: Base=0x00007ffc0985c510, Begin=0x00007ffc0985c510, Size=8, Type=0x23
  Libomptarget --> Calling target_data_mapper for the 0th argument
  Libomptarget --> Calling the mapper function 0x0000000000400e90
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00007ffc0985c510, Size=8, Type=0x20).
  Libomptarget --> __tgt_mapper_num_components(Handle=0x00007ffc0985c190) returns 1
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00007ffc0985c510, Size=8, Type=0x20).
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00000000006a0600, Size=4096, Type=0x2000000000013).
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Creating new map entry: HstBase=0x00007ffc0985c510, HstBegin=0x00007ffc0985c510, HstEnd=0x00007ffc0985c518, TgtBegin=0x00002ad71e600000
  Libomptarget --> There are 8 bytes allocated at target address 0x00002ad71e600000 - is new
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8, updated RefCount=2
  Libomptarget --> There are 8 bytes allocated at target address 0x00002ad71e600000 - is not new
  Libomptarget --> Has a pointer entry: 
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8, RefCount=2
  Libomptarget --> There are 8 bytes allocated at target address 0x00002ad71e600000 - is not new
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00000000006a0600, Size=4096)...
  Libomptarget --> Creating new map entry: HstBase=0x00000000006a0600, HstBegin=0x00000000006a0600, HstEnd=0x00000000006a1600, TgtBegin=0x00002ad71e600200
  Libomptarget --> There are 4096 bytes allocated at target address 0x00002ad71e600200 - is new
  Libomptarget --> Moving 4096 bytes (hst:0x00000000006a0600) -> (tgt:0x00002ad71e600200)
  Libomptarget --> Update pointer (0x00002ad71e600000) -> [0x00002ad71e600200]
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8, RefCount=2
  Libomptarget --> Obtained target argument 0x00002ad71e600000 from host pointer 0x00007ffc0985c510
  Libomptarget --> loop trip count is 1024.
  Libomptarget --> Launching target execution __omp_offloading_13_a6fc814_main_l25 with pointer 0x0000000000eb1d10 (index=0).
  Target CUDA RTL --> Setting CUDA threads per block to default 128
  Target CUDA RTL --> Using 8 teams due to loop trip count 1024 and number of threads per block 128
  Target CUDA RTL --> Launch kernel with 8 blocks and 128 threads
  Target CUDA RTL --> Launch of entry point at 0x0000000000eb1d10 successful!
  Libomptarget --> Calling target_data_mapper for the 0th argument
  Libomptarget --> Calling the mapper function 0x0000000000400e90
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00007ffc0985c510, Size=8, Type=0x20).
  Libomptarget --> __tgt_mapper_num_components(Handle=0x00007ffc0985c190) returns 1
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00007ffc0985c510, Size=8, Type=0x20).
  Libomptarget --> __tgt_push_mapper_component(Handle=0x00007ffc0985c190) adds an entry (Base=0x00007ffc0985c510, Begin=0x00000000006a0600, Size=4096, Type=0x2000000000013).
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00000000006a0600, Size=4096)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00000000006a0600, TgtPtrBegin=0x00002ad71e600200, Size=4096, updated RefCount=1
  Libomptarget --> There are 4096 bytes allocated at target address 0x00002ad71e600200 - is last
  Libomptarget --> Moving 4096 bytes (tgt:0x00002ad71e600200) -> (hst:0x00000000006a0600)
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00000000006a0600, Size=4096)...
  Libomptarget --> Deleting tgt data 0x00002ad71e600200 of size 4096
  Libomptarget --> Removing mapping with HstPtrBegin=0x00000000006a0600, TgtPtrBegin=0x00002ad71e600200, Size=4096
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8, updated RefCount=1
  Libomptarget --> There are 8 bytes allocated at target address 0x00002ad71e600000 - is not last
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Mapping exists with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8, updated RefCount=1
  Libomptarget --> There are 8 bytes allocated at target address 0x00002ad71e600000 - is last
  Libomptarget --> Removing shadow pointer 0x00007ffc0985c510
  Libomptarget --> Looking up mapping(HstPtrBegin=0x00007ffc0985c510, Size=8)...
  Libomptarget --> Deleting tgt data 0x00002ad71e600000 of size 8
  Libomptarget --> Removing mapping with HstPtrBegin=0x00007ffc0985c510, TgtPtrBegin=0x00002ad71e600000, Size=8
  Sum = 2048
  Libomptarget --> Unloading target library!
  Libomptarget --> Image 0x0000000000401350 is compatible with RTL 0x000000000063d430!
  Libomptarget --> Unregistered image 0x0000000000401350 from RTL 0x000000000063d430!
  Libomptarget --> Done unregistering images!
  Libomptarget --> Removing translation table for descriptor 0x0000000000423900
  Libomptarget --> Done unregistering library!
  Libomptarget --> Deinit target library!
  $ 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68100/new/

https://reviews.llvm.org/D68100





More information about the Openmp-commits mailing list