OpenCoarrays in WSL, Warning message

Trying to run a program with OpenCoarrays in WSL returns a strange warning.
A minimum working example:

program hello_coarray
      print*, "hello from", this_image(),"out of",num_images(),"images."
end program hello_coarray

Execution and warning message:

$ cafrun -n 4 hello_caf.exe
--------------------------------------------------------------------------
WARNING: Linux kernel CMA support was requested via the
btl_vader_single_copy_mechanism MCA variable, but CMA support is
not available due to restrictive ptrace settings.
The vader shared memory BTL will fall back on another single-copy
mechanism if one is available. This may result in lower performance.

  Local host: DESKTOP-6UETSCV
-------------------------------------------------------------------------
 hello from           1 out of           4 images.
 hello from           2 out of           4 images.
 hello from           3 out of           4 images.
 hello from           4 out of           4 images.
[DESKTOP-6UETSCV:00198] 3 more processes have sent help message help-btl-vader.txt / cma-permission-denied
[DESKTOP-6UETSCV:00198] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

This issue is not original, it has already been reported a couple of times in different forums*. I implemented the suggested solutions, but it persists. I am also not sure that I fully understand the source of the warning as well as the suggested solutions, basically I just blindly applied them.
I would greatly appreciate it if someone could enlighten me here, by explaining in plain English what is the issue.

*Similar reported issues:

Here’s my understanding based on reading the links you provided and my (somewhat limited) understanding of the Linux OS and parallel computing implementations.

The Linux kernel has a (configurable), baked-in security feature that prevents separate processes from accessing each other’s memory directly. Separate processes communicating with each other is the basis for MPI (which I’m assuming your version of OpenCoarrays is using under the hood). WSL is running a full fledged Linux OS, kernel and all, so that is where the message is coming from.

I’m assuming you tried the command sudo echo 0 > /proc/sys/kernel/yama/ptrace_scope from this comment, which should have fixed it, temporarily. It basically overwrites the configuration setting in memory related to the specific security feature generating the message. If that doesn’t work I’m at a bit of a loss for why not. Perhaps trying the permanent solution and fully rebooting the entire system might work?

The permanent solution is to change where that setting is read from on boot up, as listed in the Stack Exchange answer you link to. A reboot would be required for this change to take effect.

Hopefully that was at least somewhat helpful.

1 Like

I tried all the above solutions and I have already permanently set it to 0. But it didn’t work. Anyway, I found this closed issue in open-mpi, that seems to give a temporary solution (at least it works for me), that is, you need to export the following before executing the cafrun or mpiexec.

export OMPI_MCA_btl_vader_single_copy_mechanism=none

Note, that I used this command: sudo vim /proc/sys/kernel/yama/ptrace_scope to permanently set the ptrace value back to one and the above export solution is still valid. Therefore, it seems to be independent of the ptrace value, which I cannot explain.

Regardless, thank you for your explanation, it did give some insight, although the solution is still not very clear. I wonder if anyone else gets the same issue when working with OpenCoarrays in WSL.