report PGCC-S-0000-Internal errors for _mp_malloc while there's no heap allocations

153 views Asked by At

When I tried to compile my code in OpenACC, it reports:

PGCC-S-0000-Internal compiler error. Call in OpenACC region to support routine - _mp_malloc (/home/lisanhu/mine/ws/C/AccSeqC/as_align.cc: 92)
PGCC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages)  (/home/lisanhu/mine/ws/C/AccSeqC/as_align.cc: 92)
inexact_dfs_iter_search(const char *, long, long, const long *, const long *, long, const char *, const long *, const char *, acc_range *, int):
     92, Generating acc routine seq
         93, Accelerator restriction: unsupported call to support routine '_mp_malloc'

While the reported function is defined as following:

int
inexact_dfs_iter_search(const char *query, const array_size q_length, array_size allowed_diffs,
                        const array_size *c, const array_size *o, array_size r_length,
                        const char *ref_bwt, const array_size *rev_o, const char *rev_bwt,
                        Range *res, int num_of_res) {
    array_size d[q_length];
    calculateD(query, q_length, r_length, c, rev_o, rev_bwt, d);
//  for (int i = 0; i < q_length; ++i) {
//      cout << d[i];
//  }
//  cout << endl;
//  cout << strndup(query, q_length) << endl;
    Profile p{q_length - 1, 1, r_length - 1, allowed_diffs};
    int prof_size = 9 * q_length + 1;
    Profile profs[prof_size];
    Stack<Profile> profiles(profs, prof_size);
    profiles.push(p);

    Heap<Range> results(res, num_of_res);
    while (!profiles.empty() && !results.full()) {
        if (profiles.full()) {
            return 1;
        }
//      p = profiles.peek();
        p = profiles.pop();
        inex_dfs_process_profile(query, p, c, o, ref_bwt, d, profiles, results);
    }
    return 0;
}

Line 92 is the 5th line (it's part of function definition, so strange)

I'll really appreciate it if someone can help me with it.

1

There are 1 answers

1
Sanhu Li On BEST ANSWER

I've found the reason for this. For array_size d[q_length];, it actually calls the _mp_malloc to allocate memory on stack. I tried to replace q_length to constant and it works fine. (although this is a temporary tweak, but I find out he reason finally)