How To

There are a number of ways to install SD Erlang/OTP and some are discussed below. If you know a better way, do let us know.

Building and Installing Erlang/OTP

This is standard Erlang/OTP building and installation. Using this method will install SD Erlang/OTP based on Erlang/OTP 17.4, 19.2, and 19.3, and ensure that you use additional features like tracing implemented by ICCS team. Detailed information on building and installation can be found in the $ERL_TOP/HOWTO/INSTALL.md document.

Linux commands are as follows.
(1) ssh cloning

$ git clone git@github.com:release-project/otp.git $ cd otp $ git checkout <19.x or 17.4>-rebased $ git submodule init $ git submodule update $ ./otp_build autoconf $ ./otp_build configure $ ./otp_build boot -a $ make

(2) https cloning

$ git clone https://github.com/release-project/otp.git $ cd otp $ git checkout <19.x or 17.4>-rebased $ git submodule init $ cd lib $ git clone https://github.com/release-project/percept2.git $ cd .. $ ./otp_build autoconf $ ./otp_build configure $ ./otp_build boot -a $ make

Adding Only s_group Functionality

If you only want to try s_groups, you can simply replace some of the Erlang/OTP files in your existing Erlang/OTP (its version should be higher than 17.0). This can be done either manually or using the sd-install.sh script. The files that need to be replaced and compiled are listed below. The compiled files will have .beam extension and should be replaced in /otp/lib/kernel/ebin/

/otp/lib/kernel/src/ global.erl, global_search.erl, kernel.erl, net_kernel.erl, s_group.erl, kernel.app.src

Demos

Some demos related to SD Erlang and Erlang in general can be found here.

S_group Functions

  • Create a new s_group:
    • s_group:new_s_group([Node]).
    • s_group:new_s_group(SGroupName, [Node]).
  • Delete an s_group:
    • s_group:delete_s_group(SGroupName).
  • Add nodes to an s_group:
    • s_group:add_nodes(SGroupName, [Node]).
  • Removes nodes from an s_group:
    • s_group:remove_nodes(SGroupName, [Node]).
  • Return a list of all s_groups known to the node:
    • s_group:s_groups().
  • Return a list of s_group tuples of the s_groups the node belongs to:
    • s_group:own_s_groups().
  • Return a list of nodes the node shares namespaces with:
    • s_group:own_nodes().
  • Return a list of nodes from the given s_group:
    • s_group:own_nodes(SGroupName).
  • Return s_group state information:
    • s_group:info().
  • Register a name in the given s_group:
    • s_group:register_name(SGroupName,Name,Pid).
  • Re-register a name in the given s_group:
    • s_group:re_register_name(SGroupName,Name,Pid).
  • Unregister a name in the given s_group:
    • s_group:unregister_name(SGroupName,Name).
  • Return a list of all registered names on the given node:
    • s_group:registered_names({node,Node}).
  • Return a list of registered names in the given s_group:
    • s_group:registered_names({s_group,SGroupName}).
  • Return the pid of a name registered in the given s_group. The name is searched on the given node:
    • s_group:whereis_name(Node,SGroupName,Name).
  • Send a message to a name registered in the given s_group. The name is searched on the given node:
    • s_group:send(Node,SGroupName,Name,Msg).