Questions tagged [openacc]
The OpenACC Application Program Interface describes a collection of compiler directives to specify loops and regions of code in standard C, C++ and Fortran to be offloaded from a host CPU to an attached accelerator, providing portability across operating systems, host CPUs and accelerators.
334
questions
1
vote
1answer
58 views
Some questions about acc routine
One MPI code, I am trying to parallelize a simple loop of it with openacc,and the output is not expected.
Here, the loop has a call and I add a 'acc routine seq' in the subroutine. If I manually make ...
0
votes
0answers
21 views
How to offload to the GPU with OpenACC in Windows?
I am trying to use OpenACC in Windows. I am using GCC to compile. (with version 8.1.0)
I found a sample code online using OpenACC.
So using the command prompt, I typed as follows.
"C:\Users\chang&...
0
votes
0answers
38 views
How can I check I am actually using GPU parallelization with Openacc(or OpenMP)?
I am trying to use GPU parallelization with Openacc. (I am using GCC in windows)
g++ -fopenacc -o D:\Dropbox\cpp_files\Practice_openmp_denser\testing.exe D:\Dropbox\cpp_files\Practice_openmp_denser\...
0
votes
0answers
19 views
How can I check it Openacc works well?
I am trying to use Openacc. I am using gcc to compile C++ code in windows.
In openmp, I could set the number of cores I want to use explicitly.
However, with Openacc, I am not sure whether ...
0
votes
1answer
39 views
how should I set copy() when using Openacc(parallelization) in C++?
I am using gcc compiler. (g++ -o test testfile.cpp)
I want to use Openacc to parallelize my code but I am a bit confused about using #pragma correctly.
Below is the part where I used parallelization.
...
2
votes
1answer
32 views
How to apply a reduce OpenACC directive to a multidimensional vector?
I'm trying to paralelize some code with OpenACC.
#pragma acc parallel loop reduction (+:matriz())
for(auto i = 0; i <= (width-siz); i += siz)
for(auto j = 0; j <= (...
0
votes
1answer
51 views
How do I correctly copy an array of C++ objects to GPU using OpenACC?
I am trying to copy over an array of C++ objects from the host to the GPU device using OpenACC. I've tried looking online but have only found very vague documentation of how to accomplish this so wasn'...
0
votes
1answer
28 views
Sequential dot_product in OpenACC Fortran loop
In a Fortran program, I have a large loop with several dot_product calls on small vectors generated within the loop:
program test
implicit none
real :: array1(2, 2), array2(2, 2), res(...
0
votes
1answer
40 views
Why OpenACC gang-level loop does not work
This code:
integer :: g_i, w_i
!$acc parallel num_gangs(3) num_workers(2) vector_length(1)
!$acc loop independent gang
do g_i = 1, 3
!$acc loop independent worker
do w_i = 1, 2
...
0
votes
2answers
33 views
Matmul in OpenACC Fortran loop
Accelerating a Fortran code with OpenACC using the PGI compiler, I got problems with a matmul call in an accelerated loop.
In the simplified example, I apply the identity matrix on two vectors, so the ...
0
votes
2answers
26 views
Disabling OpenACC implicit pragma generation with pgc++ compiler
I'm using the pgc++ compiler on some C++ code that uses OpenACC directives, and I was wondering if there is a compiler option to disable implicit pragma generation that is performed when compiling ...
0
votes
0answers
33 views
OpenACC managed memory code works when using debug symbols, but crashes without them
I have a C++ program that uses ROS libraries and OpenACC directives and is compiled with the PGI compiler (version 20.11) on Ubuntu 18.04. I've noticed that if I build the program with debug symbols ...
0
votes
1answer
53 views
How a loop is mapped into the GPU, in blocks, warps and threads?
I would need clarification on how a loop is mapped on the device, using OpenACC. I'm also not sure about the role of blocks, warps and threads.
If I have a loop like this:
#pragma acc parallel loop
...
0
votes
1answer
19 views
Obtain OpenACC free (or total) device memory
I have a GPU code that, at each iteration, decides if the iteration can be offloaded to the accelerator. OpenACC come to be the best tool:
void module(struct my_aos *aos, int n_aos){
int criteria ...
0
votes
1answer
34 views
OpenACC routine vector with intent out argument
I am currently accelerating a Fortran code where I have a main accelerated loop in subroutine sub. In the loop, I want to call subroutine subsub on the device with acc routine. The subroutine has an ...
0
votes
1answer
57 views
How can Fortran-OpenACC contained subroutine access data from parent subroutine
I am currently accelerating a Fortran code where a contained subroutine (subsub) accesses and modifies variables declared in the parent subroutine (sub):
module mod
implicit none
contains
...
0
votes
1answer
28 views
openacc error when assigning values to dynamically allocated struct member array of struct referenced by pointer
I am trying to wrap my head around combining openacc with pointers to structs containing dynamically allocated members. The code below fails with
Failing in Thread:1
call to cuStreamSynchronize ...
0
votes
1answer
33 views
#pragma acc host_data use_device() with complex variables
I need to pass to #pragma acc host_data use_device() an element of a vector of pointers of vectors:
static double *send_bufL[3];
static double *recv_bufL[3];
send_bufL[IDIR] = ARRAY_1D(NVAR*grid->...
0
votes
1answer
67 views
Why does gcc-10 fail to link with error “error: array section is not contiguous in ‘map’ clause” in 2D array openacc application?
I am trying to compile a basic openacc program in C, using gcc-10. It works fine for one-dimensional arrays, and arrays allocated through "A[N_x][N_y]" but when trying a 2D array allocated ...
1
vote
1answer
39 views
OpenACC reduction clause with max()
I am learning OpenACC and came across the code bellow for the Jacobi iteration, provided by NVidia. From my understanding, reduction(max:err) creates a private err variable for each loop iteration, ...
0
votes
1answer
17 views
Is there any profiler able to identify the name of variables being copied in and out GPU with openacc program
I'm trying to accelerate a legacy MPI Fortran program with GPU and OpenACC. And after I compile and profile the program with Nsight system, I found some unexpected data copy from HtoD and DtoH. I want ...
0
votes
0answers
36 views
OpenACC: External variable and declare directive
I'm dealing with the acceleration of this subroutine.
void PTC3D(double ****V, double ****U)
{
int i,j,k, nv;
static double **u, **v;
if (u == NULL){
u = ARRAY_2D(NMAX_POINT, NVAR, double);
...
1
vote
1answer
51 views
OpenACC: Deep Copy and Unified Memory
I would like to understand clearly a situations I faced often accelerating an application with OpenACC. Let's say I have this loop:
#pragma acc parallel loop collapse(4)
for (k = KBEG; k <= KEND; k+...
2
votes
0answers
194 views
Gcc offload compilation options
I'm trying to build the simplest OpenMP or OpenACC C++ program with GPU offload using gcc-10, CUDA 11 on Ubuntu 18.04 and this CMakeLists.txt file (or OpenMP version):
cmake_minimum_required(VERSION 3....
0
votes
1answer
44 views
Issue with #pragma acc host_data use_device
I'd like the MPI function MPI_Sendrecv() to run on the GPU. Normally I use something like:
#pragma acc host_data use_device(send_buf, recv_buf)
{
MPI_Sendrecv (send_buf, N, MPI_DOUBLE, proc[0], ...
-1
votes
1answer
68 views
OpenACC and CUDA aware MPI
I want to move on the device the whole while loop in the main. The problems emerges when I add #pragma acc host_data use_device(err) to MPI_Allreduce (&err, &err, 1, MPI_DOUBLE, MPI_SUM, ...
0
votes
1answer
40 views
OpenACC firstprivate variables
I encounter an issue with arrays in OpenACC kernels. Here is the demo code:
module mpoint
type point
real :: x, y, z
real :: tmp
real :: v(3)
end type point
end module mpoint
...
0
votes
1answer
399 views
How to enable CUDA Aware OpenMPI?
I'm using OpenMPI and I need to enable CUDA aware MPI. Together with MPI I'm using OpenACC with the hpc_sdk software.
Following https://www.open-mpi.org/faq/?category=buildcuda I downloaded and ...
0
votes
0answers
64 views
MPI+OpenACC: How #pragma acc host_data use_device() works?
#pragma acc parallel loop present(phi[:ny_tot][:nx_tot], send_buf[:NX_GLOB+2*NGHOST], recv_buf[NX_GLOB+2*NGHOST])
for (i = ibeg; i <= iend; i++) send_buf[i] = phi[j][i];
#pragma acc host_data ...
0
votes
1answer
85 views
OpenACC: DEVICE TYPE
I see a lot of functions, such as acc_get_num_devices(), requires as input the device type. I used int devtype=acc_get_device_type() that returns devtype=2.
(In the documenation:
acc_get_num_devices( ...
0
votes
1answer
37 views
Accelerating incomplete LDL^T preconditioner with OpenACC
Original question:
I am relatively new to OpenACC, but have so far managed to accelerate my suite of iterative Fortran solvers (based on CG) with relative success, and am getting speed-ups of around 7 ...
0
votes
1answer
39 views
Which OpenACC directive will tell compiler to execute a statement on device only?
I am learning OpenACC with Fortran (with a suite of tools from Nvidia) and am doing it by porting my implementation of the Conjugate Gradient (CG) solver to GPUs.
Clearly, I am trying to keep as much ...
0
votes
2answers
78 views
(OpenACC) pool allocator: Specified pool size too big for this device Current file
I'm getting this error every time I try to run the application though it compile well:
pool allocator: Specified pool size too big for this device
Current file: /home/marco/Desktop/tools.c
...
0
votes
1answer
169 views
Routines inside acc parallel region
After reading this how-can-a-fortran-openacc-routine-call-another-fortran-openacc-routine, I am still puzzled by this OpenACC function call limitation.
Below is a modified nonsense code from the above ...
0
votes
2answers
80 views
NVIDIA Nsight waring: OpenACC injection initialization failed. Is the PGI runtime version greater than 15.7?
I am trying to venture into accelerating my Fortran 2003 programs with OpenACC directives on my Ubuntu 18.04. workstation with Nvidia GeForce RTX 2070 card. To that end, I have installed Nvidia HPC-...
0
votes
1answer
327 views
nvprof Warning: The path to CUPTI and CUDA Injection libraries might not be set in LD_LIBRARY_PATH
I get the message in the subject when I try to run a program I developed with OpenACC through Nvidia's nvprof profiler like this:
nvprof ./SFS 4
If I run nvprof with -o [output_file] the warning ...
1
vote
1answer
60 views
Using the routine directive on a Fortran90 intrinsic
I have given OpenAcc access to the subroutine called "lang_force", and within that subroutine I call the Fortran90 intrinsic RANDOM_NUMBER().
subroutine lang_force(damp, temp, noise)
!$acc ...
0
votes
1answer
30 views
OpenACC constant parameters
I am wondering what is the proper way to handle constants in OpenACC kernels.
For example, in the following code
module vecaddmod
implicit none
integer, parameter :: n = 100000
!$acc declare ...
0
votes
1answer
107 views
OpenACC Declare Construct
I went through the OpenACC 2.6 supported features with PGI compilers, and encountered an issue with the memory management between CPU and GPU.
The following Fortran code is a modified version from the ...
-1
votes
1answer
105 views
Are SYCL and OpenACC competing frameworks? or complementary?
I'm gathering information about heterogeneous computing. I've come across SYCL and OpenACC. I gather that OpenACC has many pragma directives (similar to OpenMP) to abstract GPU calculations (either ...
1
vote
0answers
91 views
Disrepancy in results between OpenMP/OpenACC implementation and gcc/PGI compilers
I have a larger Fortran program that I am trying to convert so that the computationally intensive part will run on an NVidia GPU using OpenMP and/or OpenACC. During development I had some issues to ...
1
vote
1answer
106 views
Calling OpenACC code from Rust does not run on GPU
Update 09/07/2020
I'm adding a small example for this at https://gitlab.com/lisanhu2016/rust-openacc-example.git
It's a public repository with a README, you should be able to try the example there.
...
0
votes
1answer
33 views
OPENACC How to handle a library function in a #pragma acc routine
I have to call the <stdlib.h> function exit() inside this routine:
#pragma acc routine(Check) seq
int Check (double **u, char *str)
{
for (int i = beg; i <= end; i++) {
for (int v = 0; ...
0
votes
1answer
71 views
Parallel FOR loop with OpenACC using recursive pointers
I have this parallel FOR loop with OpenMP:
#pragma omp parallel for default(none) private(k,cell) shared(sim,mesh)
for(i=0;i<mesh->ncells;i++){
cell=&(mesh->cell[i]);
...
1
vote
0answers
113 views
Error: cannot compute suffix of object files: cannot compile while building GCC 10 with offloading OpenACC Support to Nvidia GPU
I am trying to install GCC 10 for Nvidia PTX on Ubuntu 20.04 so that I can offload the openACC loads to Nvidia GPU.
I am following the steps given in this link
Installing nvptx-tools
git clone https:...
0
votes
1answer
111 views
C++ Matrix Multiply Slower OpenACC
When I enable OpenACC during compilation using GCC, is there a reason why my code is slower? I'm currently using GCC 6.3.0, on Windows 10. I'm really unsure why this is happening.
This is the command ...
0
votes
1answer
22 views
OpenACC: error “unsupported statement type: opcode=JSRA”
I'm trying to parallelize this loop but I'm having a problem with the function fRSolver (&sw, ts->cmax);
#pragma acc parallel loop collapse(2) present(d, sw, ts)
for (k = KBEG; k <= KEND; k++...
0
votes
1answer
123 views
OpenACC: How to apply the reduction clause to a struct variable
I simply need to apply the reduction(max: ) clause to Dts->t but nothing seems to work, I tried reduction(max:Dts.t), reduction(max:Dts->t), reduction(max:Dts) and reduction(max:t).
#pragma ...
0
votes
1answer
103 views
OpenACC - Complex loop carried dependence of a->,c->,b-> prevents parallelization
I am using OpenACC to compare the execution time of a parallelized vs non-parallelized matrix multiplication operation on the CPU using PGI Community Edition 19.10 (on Windows). The code I am using is:...
0
votes
1answer
99 views
OpenACC: nested loops with private variable
I want to accelerate these nested loops. Because of the dimension of v (NMAX=MAX(NX1, NX2, NX3)), I understand that can be a conflict in the parallelization of the two external loops. I tried to use ...