Closed alvaradoo closed 1 year ago
I am able reproduce this on my machine when CHPL_COMM: gasnet
. For me it writes the file 0x0
with my connection info:
cat 0x0
Pierces-MacBook-Pro.local 5555 tcp://Pierces-MacBook-Pro.local:5555
This happens when launch the server, you don't even need to connect from the client. I was able to trace this back to this proc: https://github.com/Bears-R-Us/arkouda/blob/f3f1de8930a536fbb8b40d1538a14a16aab0856b/src/ServerDaemon.chpl#L269-L279
which matches what we see in the file and when setting logger level to DEBUG
, the log statements match what I'm seeing:
[ServerDaemon] createServerConnectionInfo Line 272 DEBUG [Chapel] writing serverConnectionInfo to 0x0
I'm hoping this is just due to this proc not using writefCompat
from ArkoudaIOCompat
. I'll try updating that and see if it fixes the problem. If not I'll lean on @bmcdonald3 and @hokiegeek2 since they both know aspects of this block of code better than me.
If this is the result of a missing compat call, I wonder if we should look for places in the code where we import a compat module within the scope of the proc. Cause it feels like that might be what kept us from catching this one
All the IO and compat stuff seemed fine, so I dug a little deeper and it seems like the result we're getting from getEnv
for environment variable that aren't set has changed in chpl 1.32. I put together a little stand alone chapel program that has all the relevant pieces from arkouda
use CTypes;
// for chpl 1.32, use:
type c_string_ptr = c_ptrConst(c_char);
// for chpl 1.31, use:
// type c_string_ptr = c_string;
proc getEnv(name: string, default=""): string {
extern proc getenv(name : c_string_ptr) : c_string_ptr;
var val = getenv(name.localize().c_str()): string;
if val.isEmpty() { val = default; }
return val;
}
config const emptyStr: string = getEnv("ARKOUDA_SERVER_CONNECTION_INFO", "");
writeln("emptyStr: ", emptyStr);
writeln("emptyStr.isEmpty(): ", emptyStr.isEmpty());
In both of these ARKOUDA_SERVER_CONNECTION_INFO
is unset and CHPL_COMM
is gasnet
with 1.32:
chpl --version
chpl version 1.32.0
built with LLVM version 15.0.7
chpl PlayingAround.chpl -o playing
./playing -nl 1
emptyStr: 0x0
emptyStr.isEmpty(): false
with 1.31:
chpl --version
chpl version 1.31.0
built with LLVM version 15.0.7
chpl PlayingAround.chpl -o playing
./playing -nl 1
emptyStr:
emptyStr.isEmpty(): true
EDIT:
It's worth noting that the proc getEnv
was added to arkouda by @ronawho 4 years ago, and now there is a getenv
method. I was hoping that replacing the extern proc
with the one from OS.POSIX
would fix it, but it just cause 1.31
to give the same answer as 1.32
It seems switching to the getenv
from OS.POSIX
and doing an equality comparison against nil
will fix things. I'm far from convinced this is the most elegant solution
Hmm, nice investigating. Seems like core issue is that a c_nil:string
is no longer considered an empty string. That's kinda surprising, but maybe it's now considered a single element null-terminated string? Checking against nil is certainly an easy fix and may be worth doing in the short term. When I get a chance I'll check with others on the Chapel team to see if that change in behavior is expected.
Describe the bug Every since updating to Arkouda v2023.10.06, launching the arkouda server with
/path/to/arkouda-2023.10.06/arkouda_server -nl 4
causes a file named'(nil)'
to be created with contents printing out the information of the head noden14.cluster.local 5555 tcp://n14.cluster.local:5555
. This happens on Kruskal (cluster at UMD Physical Sciences Lab), I have not tested it on other systems or locally.To Reproduce Steps to reproduce the behavior:
ls
in the directory you ran the server from.Expected behavior Expected the file to not be created.
Error Message None.
Is this a Blocking Issue Nope.
ak.get_config()
OutputAdditional context Grepped environment variables. Note: the problem still happens if
ARKOUDA_QUICK_COMPILE
is not set.Chapel environment.