I'm looking to use WSTP to make functions defined in a C MPI application available to a remote Mathematica kernel. I've got this working for a non-MPI version of the application, but now wish to have the WSTP backend run on e.g. 8 remote machines, which are parallelising the backend calls. I'm unsure how this could work in principle. I imagine it's not possible (or at least, sensible) to simply launch the WSTP link on each node (which can MP to eachother) and have the MMA kernel link to each, and ignore the returns of all but one node. Is there a better way to achieve this, e.g. having WSTP run on some intermediate machine which can talk to the backend machines?
Additionally, after compiling the WSTP-wrapped code with MPI compilers, I encounter the error during linking on Linux
WSTPlibs/libWSTPi4.36.a: file not recognized: File format not recognized
invoked from
mpicc -O2 -std=c99 -mavx -Wall -Isomefolder -o wstplink filename.o libWSTPi4.36.a -lm
I suppose this is because the libWSTPi4.36.a
archive is for MacOS, taken from /Applications/Mathematica.app/Contents/SystemFiles/Links/WSTP
. Where can an archive for Linux be downloaded?
ObjectLink
works (or how the kernel talks to the remote WSTP through TCP). Perhaps the intermediate node would be running an MMA kernel and TCP-talk to all of the 'work' nodes on different ports (or pairs of ports), each of which are running WSTP (wrapping the MPI program). I suppose the only benefit is that it moves the onus of talking to all work nodes to the intermediate note, which e.g. can be on their internal network. The user's remote kernel talks to only the intermediate node. $\endgroup$ObjectLink
, but merely clones the TCP message it sent to a nominated work node, to all other nodes. I still really don't know if MPI will behave correctly in WSTP's seemingly async style $\endgroup$