Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularize the Arkouda build process #978

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
afa03ef
Add prototype for modularization of Arkouda with FCFs
bmcdonald3 Nov 10, 2021
e1b56df
Add prototype for kextreme server registration
bmcdonald3 Nov 10, 2021
d691cf3
Add setops to server registration prototype
bmcdonald3 Nov 10, 2021
be28ee7
Add SERVER_MODULES command line argument for make to optionally regis…
bmcdonald3 Nov 12, 2021
c223ef1
Add server-side code to add a new module
bmcdonald3 Nov 12, 2021
190551b
Add client side code for new optional module
bmcdonald3 Nov 12, 2021
aeb0872
Add SegmentedMsg to an optional module
bmcdonald3 Nov 12, 2021
78307da
Fix spacing in Makefile and improve function names
bmcdonald3 Nov 15, 2021
28ae73a
Move argsort to an optional module
bmcdonald3 Nov 15, 2021
e3cde00
Remove ServerRegistration file and add it to gitignore
bmcdonald3 Nov 15, 2021
3ebe3be
Add feedback from Brad on FCF use
bmcdonald3 Nov 16, 2021
ce927bf
Go back to dummy function approach
bmcdonald3 Nov 16, 2021
e708352
Switch to using Python script and config file for optional modules:
bmcdonald3 Nov 16, 2021
581d2ec
Add script for adding a user module to client code
bmcdonald3 Nov 17, 2021
468edb6
Add ability to have comments in config file
bmcdonald3 Nov 17, 2021
4aad390
Add new line checking in Python server script
bmcdonald3 Nov 17, 2021
ca883f4
Move all modules to optional dependencies
bmcdonald3 Nov 17, 2021
f6af981
Update CI to generate server registration file before running unit tests
bmcdonald3 Nov 17, 2021
04111f0
Add ARKOUDA_CONFIG_FILE option to override the default config file
bmcdonald3 Nov 17, 2021
611bb97
Change from name of python script to name of config file
bmcdonald3 Nov 17, 2021
e2c86e3
Fix CI file
bmcdonald3 Nov 17, 2021
94ac948
Cleanup up module generation script
bmcdonald3 Nov 17, 2021
96ffd03
Add a ServerIncludes module to fix circular dependency of arkouda_server
bmcdonald3 Nov 17, 2021
d87f3af
Add comments to config file
bmcdonald3 Nov 17, 2021
5983bb9
Cleanup
bmcdonald3 Nov 17, 2021
151173a
Switch to CommandMap for module name
bmcdonald3 Nov 17, 2021
ccbcfca
Remove testing module
bmcdonald3 Nov 17, 2021
685320f
Add comment
bmcdonald3 Nov 17, 2021
f1b0a40
Add segStr-assemble to SegmentedMsg command map calls
bmcdonald3 Dec 14, 2021
34c1087
Add ability to register modules not in the Arkouda src directory
bmcdonald3 Dec 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ jobs:
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" > Makefile.paths
- name: Run unit tests
run: |
python3 src/serverModuleGen.py ServerModules.cfg
start_test test
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ ifdef ARKOUDA_ARROW_PATH
$(eval $(call add-path,$(ARKOUDA_ARROW_PATH)))
endif

ifndef ARKOUDA_CONFIG_FILE
ARKOUDA_CONFIG_FILE := $(ARKOUDA_PROJECT_DIR)/ServerModules.cfg
endif

CHPL_FLAGS += -lhdf5 -lhdf5_hl -lzmq

ifdef ARKOUDA_SERVER_PARQUET_SUPPORT
Expand Down Expand Up @@ -252,8 +256,10 @@ else
ARKOUDA_COMPAT_MODULES += -M $(ARKOUDA_SOURCE_DIR)/compat/lt-125
endif

MODULE_GENERATION_SCRIPT=$(ARKOUDA_SOURCE_DIR)/serverModuleGen.py
# This is the main compilation statement section
$(ARKOUDA_MAIN_MODULE): check-deps $(ARROW_O) $(ARKOUDA_SOURCES) $(ARKOUDA_MAKEFILES)
python3 $(MODULE_GENERATION_SCRIPT) $(ARKOUDA_CONFIG_FILE)
$(CHPL) $(CHPL_DEBUG_FLAGS) $(PRINT_PASSES_FLAGS) $(REGEX_MAX_CAPTURES_FLAG) $(OPTIONAL_SERVER_FLAGS) $(CHPL_FLAGS_WITH_VERSION) $(ARKOUDA_MAIN_SOURCE) $(ARKOUDA_COMPAT_MODULES) -o $@

CLEAN_TARGETS += arkouda-clean
Expand Down
28 changes: 28 additions & 0 deletions ServerModules.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Comment out modules using a `#` to exclude
# a module from a build

ArraySetopsMsg
KExtremeMsg
ArgSortMsg
SegmentedMsg
OperatorMsg
RandMsg
IndexingMsg
UniqueMsg
In1dMsg
HistogramMsg
SortMsg
ReductionMsg
FindSegmentsMsg
EfuncMsg
ConcatenateMsg
JoinEqWithDTMsg
RegistrationMsg
CastMsg
BroadcastMsg
FlattenMsg

# Add additional modules below
# For modules not in the Arkouda `src/` directory,
# make sure to include the full path to the module.
# Example: `/Users/my-username/MyModule.chpl`
1 change: 1 addition & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
TAGS
ArrowFunctions.o
ServerRegistration.chpl
6 changes: 6 additions & 0 deletions src/ArgSortMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -485,4 +485,10 @@ module ArgSortMsg
asLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("argsort", argsortMsg);
registerFunction("coargsort", coargsortMsg);
}
}
8 changes: 8 additions & 0 deletions src/ArraySetopsMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,12 @@ module ArraySetopsMsg
moduleName=getModuleName(),
errorClass="ErrorWithContext");
}

proc registerMe() {
use CommandMap;
registerFunction("intersect1d", intersect1dMsg);
registerFunction("setdiff1d", setdiff1dMsg);
registerFunction("setxor1d", setxor1dMsg);
registerFunction("union1d", union1dMsg);
}
}
5 changes: 5 additions & 0 deletions src/BroadcastMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ module BroadcastMsg {
bmLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("broadcast", broadcastMsg);
}
}
6 changes: 5 additions & 1 deletion src/CastMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,9 @@ module CastMsg {
castLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),returnMsg);
return returnMsg;
}


proc registerMe() {
use CommandMap;
registerFunction("cast", castMsg);
}
}
22 changes: 22 additions & 0 deletions src/CommandMap.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module CommandMap {
use ServerRegistration;
use Map;
use Message;
use MultiTypeSymbolTable;

// This is a dummy function to get the signature of the Arkouda
// server FCF. Ideally, the `func()` function would be able to
// construct the FCF type, but there is no way to generate a
// FCF that throws using `func()` today.
proc akMsgSign(a: string, b: string, c: borrowed SymTab): MsgTuple throws {
var rep = new MsgTuple("dummy-msg", MsgType.NORMAL);
return rep;
}

var f = akMsgSign;
var commandMap: map(string, f.type);

proc registerFunction(cmd: string, fcf: f.type) {
commandMap.add(cmd, fcf);
}
}
5 changes: 5 additions & 0 deletions src/ConcatenateMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,9 @@ module ConcatenateMsg
}
}
}

proc registerMe() {
use CommandMap;
registerFunction("concatenate", concatenateMsg);
}
}
8 changes: 8 additions & 0 deletions src/EfuncMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -692,4 +692,12 @@ module EfuncMsg
return C;
}

proc registerMe() {
use CommandMap;
registerFunction("efunc", efuncMsg);
registerFunction("efunc3vv", efunc3vvMsg);
registerFunction("efunc3vs", efunc3vsMsg);
registerFunction("efunc3sv", efunc3svMsg);
registerFunction("efunc3ss", efunc3ssMsg);
}
}
5 changes: 5 additions & 0 deletions src/FindSegmentsMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,9 @@ module FindSegmentsMsg
fsLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("findSegments", findSegmentsMsg);
}
}
6 changes: 6 additions & 0 deletions src/FlattenMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,10 @@ module FlattenMsg {
fmLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("segmentedFlatten", segFlattenMsg);
registerFunction("segmentedSplit", segmentedSplitMsg);
}
}
5 changes: 5 additions & 0 deletions src/HistogramMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ module HistogramMsg
hgmLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("histogram", histogramMsg);
}
}
7 changes: 6 additions & 1 deletion src/In1dMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@ module In1dMsg
repMsg = "created " + st.attrib(rname);
iLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}
}

proc registerMe() {
use CommandMap;
registerFunction("in1d", in1dMsg);
}
}
14 changes: 13 additions & 1 deletion src/IndexingMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -719,5 +719,17 @@ module IndexingMsg
repMsg = "%s success".format(pn);
imLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}
}

proc registerMe() {
use CommandMap;
registerFunction("[int]", intIndexMsg);
registerFunction("[slice]", sliceIndexMsg);
registerFunction("[pdarray]", pdarrayIndexMsg);
registerFunction("[int]=val", setIntIndexToValueMsg);
registerFunction("[pdarray]=val", setPdarrayIndexToValueMsg);
registerFunction("[pdarray]=pdarray", setPdarrayIndexToPdarrayMsg);
registerFunction("[slice]=val", setSliceIndexToValueMsg);
registerFunction("[slice]=pdarray", setSliceIndexToPdarrayMsg);
}
}
6 changes: 5 additions & 1 deletion src/JoinEqWithDTMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,9 @@ module JoinEqWithDTMsg
jeLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}// end joinEqWithDTMsg()


proc registerMe() {
use CommandMap;
registerFunction("joinEqWithDT", joinEqWithDTMsg);
}
}// end module JoinEqWithDTMsg
6 changes: 6 additions & 0 deletions src/KExtremeMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,10 @@ module KExtremeMsg
}
}
}

proc registerMe() {
use CommandMap;
registerFunction("mink", minkMsg);
registerFunction("maxk", maxkMsg);
}
}
21 changes: 0 additions & 21 deletions src/MsgProcessing.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@ module MsgProcessing

use AryUtil;

public use OperatorMsg;
public use RandMsg;
public use IndexingMsg;
public use UniqueMsg;
public use In1dMsg;
public use HistogramMsg;
public use ArgSortMsg;
public use SortMsg;
public use ReductionMsg;
public use FindSegmentsMsg;
public use EfuncMsg;
public use ConcatenateMsg;
public use SegmentedMsg;
public use JoinEqWithDTMsg;
public use RegistrationMsg;
public use ArraySetopsMsg;
public use KExtremeMsg;
public use CastMsg;
public use BroadcastMsg;
public use FlattenMsg;

private config const logLevel = ServerConfig.logLevel;
const mpLogger = new Logger(logLevel);

Expand Down
9 changes: 9 additions & 0 deletions src/OperatorMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1696,4 +1696,13 @@ module OperatorMsg
omLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("binopvv", binopvvMsg);
registerFunction("binopvs", binopvsMsg);
registerFunction("binopsv", binopsvMsg);
registerFunction("opeqvv", opeqvvMsg);
registerFunction("opeqvs", opeqvsMsg);
}
}
6 changes: 6 additions & 0 deletions src/RandMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,10 @@ module RandMsg
randLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("randint", randintMsg);
registerFunction("randomNormal", randomNormalMsg);
}
}
9 changes: 8 additions & 1 deletion src/ReductionMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -961,5 +961,12 @@ module ReductionMsg
else if str == "False" then return false;
throw new owned ErrorWithMsg("message: skipNan must be of type bool");
}
}

proc registerMe() {
use CommandMap;
registerFunction("segmentedReduction", segmentedReductionMsg);
registerFunction("reduction", reductionMsg);
registerFunction("countReduction", countReductionMsg);
}

}
7 changes: 7 additions & 0 deletions src/RegistrationMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,11 @@ module RegistrationMsg
regLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("register", registerMsg);
registerFunction("attach", attachMsg);
registerFunction("unregister", unregisterMsg);
}
}
20 changes: 19 additions & 1 deletion src/SegmentedMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -942,4 +942,22 @@ module SegmentedMsg {
smLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}
}

proc registerMe() {
use CommandMap;
registerFunction("segmentLengths", segmentLengthsMsg);
registerFunction("segmentedHash", segmentedHashMsg);
registerFunction("segmentedEfunc", segmentedEfuncMsg);
registerFunction("segmentedFindLoc", segmentedFindLocMsg);
registerFunction("segmentedFindAll", segmentedFindAllMsg);
registerFunction("segmentedPeel", segmentedPeelMsg);
registerFunction("segmentedSub", segmentedSubMsg);
registerFunction("segmentedIndex", segmentedIndexMsg);
registerFunction("segmentedBinopvv", segBinopvvMsg);
registerFunction("segmentedBinopvs", segBinopvsMsg);
registerFunction("segmentedGroup", segGroupMsg);
registerFunction("segmentedIn1d", segIn1dMsg);
registerFunction("randomStrings", randomStringsMsg);
registerFunction("segStr-assemble", assembleStringsMsg);
}
}
5 changes: 5 additions & 0 deletions src/SortMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,9 @@ module SortMsg
sortLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}// end sortMsg()

proc registerMe() {
use CommandMap;
registerFunction("sort", sortMsg);
}
}// end module SortMsg
6 changes: 6 additions & 0 deletions src/UniqueMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,10 @@ module UniqueMsg
umLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
return new MsgTuple(repMsg, MsgType.NORMAL);
}

proc registerMe() {
use CommandMap;
registerFunction("unique", uniqueMsg);
registerFunction("value_counts", value_countsMsg);
}
}
Loading