0% found this document useful (0 votes)
89 views7 pages

Maple Link To Grid: Dana Petcu, Diana Dubu and Marcin Paprzycki

This document discusses grid-enabling computer algebra systems (CASs) like Maple and Mathematica. It analyzes the common approaches used by existing software packages to allow remote execution of codes over networks and grids. It then proposes a "maple2g" package that would allow Maple to connect to computational grids based on the Globus Toolkit, with the goal of facilitating high-performance parallel computing using Maple as an interface.

Uploaded by

Ryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views7 pages

Maple Link To Grid: Dana Petcu, Diana Dubu and Marcin Paprzycki

This document discusses grid-enabling computer algebra systems (CASs) like Maple and Mathematica. It analyzes the common approaches used by existing software packages to allow remote execution of codes over networks and grids. It then proposes a "maple2g" package that would allow Maple to connect to computational grids based on the Globus Toolkit, with the goal of facilitating high-performance parallel computing using Maple as an interface.

Uploaded by

Ryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Maple link to grid

Dana Petcu ∗† , Diana Dubu ∗† and Marcin Paprzycki ‡


∗ Computer Science Department, Western University of Timişoara, Romania
Email: {petcu,ddubu}@info.uvt.ro
† Institute e-Austria Timişoara, Romania
‡ Oklahoma State University, USA

Email: [email protected]

Abstract— One of the developments that can lead to a wider Observe that CASs like Matlab and Mathematica are used
usage of grids technologies is grid-enabling of computer algebra mainly as interfaces for grid services (e.g. in Geodise [5] or
systems. Several software packages allow nowadays the remote Netsolve [3]) and not as tools offering services on grids, while
execution of non-proprietary or legacy codes. The common
facilities and limitations of those packages are analyzed here. A MathGridLink [22] envisages support of both types of activ-
pattern is establish in the construction of a grid-enabled version ities. Looking to both approaches we try to add a new func-
of a computer algebra system, applicable to any legacy code. tionality to the system by developing a wrapper that facilities
A case study is done on Maple: the proposed maple2g package the development of grid-oriented high performance computing
allows the connection between the current Maple version and the codes based on a standard message-passing interface.
computational grids based on Globus Toolkit.
Further research directions are outlined in the last section.
I. I NTRODUCTION II. C URRENT NETWORK AND GRID - ENABLED CAS
Computer algebra systems (CASs) are frequently used A. Accessing external services
by mathematicians or engineers in performing complicated Several projects (e.g. NetSolve [3], Nimrod/G [1], Ninf
calculations and are rightfully seen as a major source of [17]) aim at providing simple ways (APIs, GUIs) to exe-
user’s productivity. Currently, many pieces of functionality cute scientific libraries or programs over the Internet/grid.
are implemented in only one CAS or as stand-alone programs This approach has been commonly labeled “network-enabled
sometimes running best on special hardware such as a parallel server” (NES) [14]. Fully developed NES systems are expected
machine. Whichever is the case, it is desirable to be able to to change the RPC model by involving resource discovery,
augment the CAS with functionality from an external piece dynamic problem solving capabilities, load balancing, fault
of software. In this process one can rely on already available tolerance, security, etc. For example, the NetSolve [3] provides
solutions, such as the grid computing technology. a web tool that users can query for information concerning all
The state of the art concerning network and grid-aware CAS available software modules within the NetSolve system.
is shortly presented in Section 2. The expectations from a NetSolve is an example of a grid based server that supports
grid-enabled CAS and the approaches to accomplish them are Matlab and Mathematica as native clients for grid computing.
analyzed in Section 3. Recently, a proxy was built for the NetSolve client that knows
Maple is utilized as the CAS of choice in our attempt to how to interact with and make use of Globus resources.
couple a CAS and a computational grid. The main reason for th MathLink [25] enables Mathematica to interface with exter-
is choice is that, despite its robustness and ease of use, we were nal programs via an API interface. Such an external program
not able to locate efforts to link Maple with grids. Second, it is sends its arguments to a mathematical computation service and
well known that Maple excels other CAS in solving selected returns result directly into Mathematica.
classess of problems like systems of nonlinear equations or MathGridLink [22] permits the access to the grid service
inequalities [23]. Furthermore, Maple has already a sockets within Mathematica, and the deployment of new grid services
library for communicating over the Internet, and a library for entirely from within Mathematica. MathGridLink allows two
parsing XML. These built-in capabilities match very well with ways of interaction: one from the view-point of a Mathematica
our goal as they suffice to make Maple a client for an external user who wants to use an existing grid service, and the other
computational service (note also that there is a recent trend from the viewpoint of a grid user, who wants to access a
to use the XML syntax as a de-facto standard in the grid Mathematica service.
community). Finally, the Geodise toolkit [5] is a suite of tools for grid-
Section 3 describes the functionality of Maple2g: the grid- services which are presented to the user as Matlab functions.
wrapper for Maple. It has two parts: one which is CAS- The user of the Geodise toolkit acts as a client to remote com-
dependent and the other, which is grid-dependent. Any change pute resources. Users are authenticated, and then authorized to
in the CAS or the grid will be reflected only in one part of the access resources to which they have rights. The user is able
proposed system. The CAS-dependent part is relatively simple to discover available resources, to decide where to run a job,
and easy to be ported to support another CAS or legacy code. to monitor its status, and to easily retrieve the results. The
functions implemented in the language of Matlab call Java
Fig. 1. Operating modes between a CAS and a computational grid: (a) CAS
classes which in turn access the Java CoG API [6]. as an interface for the grid services; (b) CAS as grid service; (c) multiple
CAS kernels on user and grid sides
B. Availability of interactive mathematical web content
This goal can be achieved in a limited way using applets
grain parallel grid distributed CAS applications, a CAS inter-
in a web browser: computing even the most fundamental
face to a message-passing library is needed.
mathematical operations such as the integral can require a
gridMathematica [26] allows the distribution of Mathemat-
complicated piece of software and thus, it is usually necessary
ica tasks among different kernels in a distributed environment
to incorporate existing mathematical software into a web
and is built on a PVM-like architecture. A typical installa-
application to achieve the required functionality. To implement
tion of gridMathematica has one master kernel and several
interactive mathematical web content the following steps are
computation kernels: the master kernel handles all inputs,
required [20]: install/maintain the “external” computational
parallelizes mathematical computations, schedules calculations
component, write the wrapper for this component to enable
for the computation kernels, and collects the results.
it to be called from another program, write an applet to
There exist more then 30 parallel Matlab projects (for more
present the interactive element together with a (most likely
details ans a list of projects see [4]). They use distinct ap-
Java) servlet which will interact with the wrapper, and write
proaches to achieving their goal(s): compile Matlab script into
the content and embed the applet or form into the text with
parallel native code, provide a parallel backend to Matlab using
the appropriate parameters. JavaMath SDK [21] can assist the
Matlab as a graphical frontend, or coordinate multiple Matlab
user in this process enabling the development of conglomerate
processes to work in parallel. For example Matlab*P 2.0 [4]
systems in Java from existing components. It gives a template
is a parallel Matlab using the backend support approach.
for writing wrappers and an API for creating and using
MatlabMPI [10] implements basic MPI routines entirely in
sessions with these components. For example the code would
Matlab scripts; it supports only basic MPI routines like send,
be part of a servlet on a server, and it would make use of
recv, size and rank. PVMTB [2] is a complete Matlab interface
Maple running on a JavaMath server.
to PVM, by means of which Matlab users can prototype
To achieve a single generic mechanism which could be
applications in the usual high-level programming environment,
used for all computation requests with no extra software that
while retaining the ability to make PVM calls.
needs to be loaded into the CAS to interface with each new
Distributed version of Maple have been recently reported in
online service, it is is necessary to establish a standard for
[18] and [19].
request-response exchanges. Part of this is a standard for the
representation of the mathematical objects to be exchanged. III. D EVELOPING A GRID - AWARE CAS EXTENSION
MathML [13] is well advanced on the path to solving this
problem. A. Requirements
In the context of our paper, where one of our goals is Let us now look in a bit more details into main issues
to explore the possibility of adding Maple modules to the involved in developing grid enmeshed CAS systems. Currently
set of grid available services, we note that MapleNet [12] most of the codes available on the grid are free or highly
offers a software platform to effective large-scale deployment specialized. General-purpose solving environments belonging
of comprehensive content involving live math computations. to the category of legacy code are less frequently used as
MapleNet client is an applet which encapsulates the edu- services in the computational grids due to some particular
cational content; MapleNet publisher offers tools to create problems such as, for instance, respecting license agreements.
applet-based exploration tools. MapleNet server coordinates Our analysis of the grid aware CAS systems described in
all the essential software infrastructure, including the general the previous section indicates, that any such a system must
web server, math engines, content, and other databases; it have at least the following facilities (Figure 1):
manages concurrent Maple instances as required to serve client
Ability to accept “inputs” from the grid:
connections for math computation and display services, and it
the CAS must be opened to augment its facilities
provides some additional services including user authentica-
with external modules, in particular it should be able
tion.
to explore computational grid facilities, to connect to
a specific grid service, to use the grid service, and
C. Parallel/distributed CAS versions
to translate its results for the CAS interface;
While so far we have mostly discussed the possibility of Being a source of an “input” for the grid:
making the CAS available as a part of grid services, obviously the CAS or some of its facilities must be seen as
it can be beneficial if the CAS is capable of utilizing the grid services and activated by remote users in appro-
computational capabilities of the grid itself. In this context priate security and licensing conditions; furthermore,
observe that coarse grain parallelism can result in effective deployment of grid services must be done in an easy
speedups under an interpreted computation environment such way from the inside of the CAS;
as the CAS. To be able to facilitate development of coarse- Ability to communicate and cooperate over the grid:
Fig. 2. CAS openness towards grid services: (a) using specific grid-aware Fig. 3. CAS openness as grid service: (a) entire functionality exposed as
function library; (b) using a general CAS-grid interface grid-service; (b) partial exposing; (c) using CAS to create stand-alone grid-
services

similar or different kernels of CASs must be able Fig. 4. Grid-version of a distributed CAS
cooperate within a grid in solving general problems;
in order to have the same CAS on different com-
CAS or a wrapper is build in order to launch multiple CAS
putational nodes a “grid-version” of the CAS must
kernels for each user request. A second approach is to expose
be available; in the case of different CASs, appro-
only partially the CAS functionality with the possibility to
priate interfaces between them must be developed
install a visibility hierarchy with different levels of security.
and implemented or a common languages for inter-
A third approach is to use a CAS installed in the user or in the
communication must be adopted.
grid environment to deploy services in other languages than
Rewriting a CAS kernel in order to improve its function- the one provided by the CAS, using its facilities to export
ality towards grids can be a painful and high-cost solution. codes (Figure 3).
Wrapping the existing CAS kernel in a special code acting as 3) CAS over the grids – grid-enabled versions of distributed
the interface between the grid, the user and the CAS can be CAS.: The computational power given by a CAS can be
done relatively easily as an added-functionality to the CAS. augmented by using several other CAS kernels (the same or
It will be then adapted “on-the-fly” when new versions of the different CASs) when the problem to be solved is properly
CAS in question become available. split between these kernels or a distributed-memory parallel
1) CAS input from grids – importing grid services in a method is used in order to solve it. The usage of a stan-
CAS.: Most CASs have the possibility to launch system com- dard message-passing interface for inter-kernel communication
mands or to call external codes written in other languages than allows the portability of the parallel version of a CAS in
the native language of the CAS. Using these facilities special particular the easy deployment on clusters and grids (Figure
libraries can be constructed in the CAS language, describing 4).
in an user-friendly manner, the calls to the grid middleware The two extreme approaches to design the interaction with
tools, like those provided by the Globus team [6]. On the user the message-passing interface are minimal, respectively fully,
side, some minimal facilities to access the computational grid access to the functions of the message-passing interface. In the
and the CAS must be installed. The grid facilities which must first case the set of functions is restricted to those allowing to
be provided to the user are those currently provided by the send commands and receive results from the remote kernels.
grid middleware. In the second case it is possible to enhance the CAS with
The interface between the grid middleware and the CAS parallel or distributed computing facilities, allowing the access
can be written entirely in the CAS language or partially in into a CAS to other parallel codes than the ones written
the CAS language and partially in some other language, more in the CAS language (the message-passing interface can be
appropriate for the grid middleware (for example, in the case used as interpreter between parallel codes written in different
of Globus, such a language would be Java CoG). In the first languages, including those of different CASs).
approach the added-code is oriented towards a particular CAS
and is not portable (Figure 2). The second approach can be B. Case study: Maple2g
more flexible in integrating new CAS in the user environment. Maple2g is a prototype of a grid-enabling wrapper for
The Geodise project [5] has adopted the second approach. Maple. As described below it consists of two components,
The Geodise toolbox includes a Java-grid client and a special MGProxy, a Java interface between Maple and the grid/cluster
library describing of the Matlab functions mapping into the environment, and m2g, a Maple library of functions allowing
Matlab environment the current Globus line commands. The the Maple user to interact with the grid/cluster middleware.
Java-grid client interacts with the Globus server, sending and MGProxy acts as interface between Maple and the local
receiving information from and towards the location service(s), or remote environments (that of the CAS-grid-interface from
authorization service and metadata archive/query service(s). At Figure 2.b, the CAS-grid-service from Figure 3.b, and par-
user request via the special Matlab functions, it sends to the tially the master/worker interfaces from Figure 4). The Maple
Matlab interface data concerning the available grid services, library m2g is a easy-to-use interface inside the Maple to
and then makes the connections to the specific service(s). the MGProxy, playing the role of the interface link from
2) CAS output toward grids – deploying CAS services on Figure 2.b, the grid interface from Figure 3.b, and partially
grid.: MapleNet [12], allowing the secure access of a thin-user the master/worker interfaces from Figure 4.
to a Maple server, gives a good example for a first approach MGProxy has three operating modes:
in grid-enabling a CAS: the entire functionality of the CAS 1) user mode: activated from inside the Maple environment
can be exposed in a computational grid respecting the license (by the m2g MGProxy command), receives the user
conditions. Full access to the CAS functionality can further command from the user’s Maple interface via a socket
give access to other grid services. To do this the entire CAS interface, contacts the grid/cluster services (including
kernel is rebuild to construct a multi-threaded version of the also other MGProxy processes), queries the user requests
TABLE I
to the contacted services, and sends to the main Maple
ACTIVATION OF MGP ROXY AND R ETRIEVAL OF G RID S ERVICES ’
interface results of queries.
PROCESSING
2) server mode: activates a Maple twin process (which
enters in a infinite cycle of interpreting commands in- Action Description
coming via the socket interface from MGProxy), acts as Activate MGProxy User commands in Maple syntax, parsed
within the m2g package, initiate the com-
a server waiting for external calls, interprets the requests, munication with the middleware which acts
sends the authentications requests to the Maple twin as an intermediary between Maple and the
process, enters in receive mode of the Maple results, grids. This is performed via the commands
for external code invocation (including Java)
and sends them back to the user. which are already available in Maple 8
3) parallel mode: activated from user’s Maple interface Grid Services’ invocation The user invokes the remote services by
with several other MGProxy copies; the copy with the issuing commands in RSL syntax
Job Submission MGProxy activates GridJob (described bel-
rank 0 enters in user mode and normally runs in the low), which is a Java class encapsulating
user environment, while the others enter in server mode; GRAM job that deals with job submission
the communication between different MGProxy copies over the grids
Results Retrieval Results can be requested either during the
is done via a standard message passing interface. communication or even after closing the con-
The Maple commands are passed in the system as strings, and nection with the grids
the Maple results are presented in MathML format.
Let us now discuss in more details three modes of operation
of the grid-enabled Maple CAS. first of the two approaches for the discovery of services further
1) Mode 1: grid-service access in Maple.: In order to make described. GridService acts as a server for GridJob which
grid services available to the user of the Computer Algebra is the client performing the actual task of submitting job,
System, the coupling with the services exposed within the grid the client-server communication being established via sockets.
has to be performed in a transparent way. This implies that GridService receives the commands to be send over the Grid
the service methods call should be only in the CAS native to the available services from MapleListener until an ’end of
language syntax. In order to achieve this we have incorporated job’ is signaled, meaning that the connection with the Grid is
a suite of Maple functions which allow the communication no longer necessary.
with the services available within the Grid in the package m2g. The underlying principles for service retrieval in Globus,
These functions allow the programmatic access to Globus Grid referred to as Monitoring and Discovery Service, are as pre-
enabled resources. The m2g package translates internally the sented in the following sections which describe the alternative
functions from the syntax familiar to the Maple user into ways provided on one hand by MDS2 and on the other in the
commands, allowing the initiation and further communication new release, namely GT3.
with the MGProxy middleware. a) Metacomputing Directory Service: The Globus toolkit
MGProxy acts as an intermediary between Maple and the provides a directory service which has the functionality of the
grid and has been written in Java, due to its portability and white pages directory and yellow pages directory and is named
to the fact that libraries specialized for the grid computing the Metacomputing Directory Service (MDS)[11]. MDS make
have been already implemented for Java in the Globus Toolkit. available the information regarding
Globus is today’s ”the facto” tool for the grid architecture and • The computational resources within the Grid
Java CoG (i.e. Commodity Grid) Kit provided by it integrates • The Grid network
the software for grid computing eveloped by Globus and the thus providing information about the hardware, the software
Java commodity framework, thus facilitating the development and the system status.
and deployment of grid services, while also permitting the use
of Web services as parts of the Grids.
The procedure for the communication within the Grid
starting from the user’s Maple interface is as described in
Table I and depicted in picture 5
MGProxy can be viewed as the entry point to the grid. The
commands issued by the user from its Maple interface are
passed as strings to MGProxy which at its turn forwards the
messages further to the MapleListener class responsible for
parsing the messages and calling the appropriate tool for their
management.
For the invocation of Grid Services MapleListener activates,
according to the request, either MDSService or GridService.
MDSService is responsible for the retrieval of information
regarding the available resources from the grid, including the
software resources, and in the current version is based on the Fig. 5. Communication flow when accessing Grid Services from Maple
TABLE II
While the White Pages offers the information concerning the
S EQUENCE OF STEPS FOLLOWED IN ORDER TO POPULATE THE LDAP
hardware performance (i.e. IP number, amount of memory),
DATABASE AND SEARCH FOR AVAILABLE SERVICES
Yellow Pages deal with the the computers of a particular class
or with a particular property. This later organizational principle Command Result
is what we are interested in. /usr/sbin/slapd -f <conf file> Activate the LDAP
server with the
MDS is based on LDAP (Lightweight Directory Access configuration from
Protocol) which is a software protocol for enabling the lo- $GLOBUS LOCATION/etc/openlda
calization of organizations, individuals, and other resources ldapadd -h localhost -a -w <password>
-x -D <binddn> -f <.ldif file> Populate LDAP
such as files and devices in a network, whether on the public database with the
Internet or on a corporate intranet. LDAP, as a version of entries specified
Directory Access Protocol , is part of X.500, a standard for in the ldif (LDAP
Data Interchange
directory services in a network. A directory provides informa- Format) file
tion within a network about the localization of components. ldapsearch -x -s <scope> -b <baseDN>
LDAP allows the search for an individual without knowing filter -p <ldapport> Searches for the
objects specified
where its particular location. within the filter
An LDAP directory is organized in a simple ”tree” hierarchy starting in the
consisting of the following levels: directory from
the baseDN. The
• The root directory (the starting place or the source of the scope restricts the
tree), which branches out to search level
$GLOBUS LOCATION/libexec/grid-info-mds-core Retrieve the
• Countries, each of which branches out to necessary
• Organizations, which branch out to information for
• Organizational units (divisions, departments, and so the above queries
such as such as
forth), which branches out to (includes an entry for) $GLOBUS LOCATION,
• Individuals (which includes people, files, and shared base DNs of
resources such as printers) servers, and slapd
process ids.
An LDAP directory can be distributed among many servers. /etc/rc.d/init.d/ldap stop Stop the ldap
Each server can have a replicated version of the total directory server
that is synchronized periodically. A LDAP server is called a
TABLE III
Directory System Agent (DSA). An LDAP server that receives
S EQUENCE OF STEPS FOLLOWED IN ORDER TO POPULATE THE LDAP
a request from a user takes responsibility for the request,
DATABASE AND SEARCH FOR AVAILABLE SERVICES
passing it to other DSAs as necessary, but ensuring a single
coordinated response for the user [24]. Command Action
In order to make use of the LDAP principles within Globus, ogsi-find-service-data a command-line interface for query-
ing the service data available from
several steps have to be performed, namely: any Grid service
1) Initialization. LDAM schema files must be updated with ogsi-find-service-data-by-name Searches for Service Data Element
the description of the attributes associated with Grid- values in a service by name
ogsi-set-service-data-by-name Adds Service Data Element values to
specific entry classes. The directory structure described a service
above has therefore to be adapted such that it would ogsi-delete-service-data-by-name Deletes Service Data Elements in a
contain the information regarding the resources in the service
ogsi-add-service Adds a service to a Service Group
computational Grid Registration service supporting re-
2) Population. The LDAP directory has to be further pop- mote registration
ulated with information according to the hierarchies ogsi-remove-service Removes a service from a Service
Group Registration service support-
established at initialization phase. ing remote registration
3) Querying Is the essential step as it represents the request
for information. The information is retrieved from the
directory service. the Service Data containers. The schema used is GLUE (Grid
For the Initialization step, there exist a naming schema for Laboratory Uniform Environment) [9].
MDS as reported in [16]. The functions provided within Globus GT3 for the manage-
A combination of LDAP and Globus commands can be used ment of data and thus services are described on the Globus
in order to perform the above operations. Alternatively, Java webpage [7] and the functions of interest are summarized in
APIs can be used. The suite of commands and their use is Table ??. Alternatively, the gui can provided a user-friendly
depicted in Table III. manner [8].
b) Globus Toolkit 3: Alternatively, in GT3 (Globus Once the information regarding the existing services has
Toolkit 3) the data format is not LDIF but XML and the been obtain - whether it is a script which is activated within
receival, storage and delivery of the data is performed within the Java code or via the functions provided by a Java API - the
TABLE IV
subsequent step is to deploy such service in order to retrieve
F UNCTIONS AVAILABLE IN M 2 G PACKAGE FOR EXTENDING M APLE BY
the result. Information is passed in the form of strings, the
USING GRID SERVICES
GridJob class being responsible for the job submission to the
service provides which in turn sends back the result of the Function Description
computation, again in the String format. This result is further m2g proxyinit() Starts Globus grid proxy init and returns the text
provided by it
retrieved by the Maple user, which can use it in subsequent m2g getservice(c, l) Search for a service c and give a link to it, retrieve
operations. The results are valid even after the connection is its location l
closed, due to the label which identifies them. m2g jobsubmit(t, c) Based on the service location retrieved in the
previous step, perform a job submission in the grid
The GridJob class is responsible for the job submission. environment labeled with the number t: the com-
Requests received from the Maple’s user interface in RSL mand from the string c is send to the MGProxy
syntax are send over the grids to remote resources. The which treats it as a grid-service request
m2g status(t) Queries the status of the submitted job labeled t
underlying framework used is Java CoG. The connection is m2g results(t) Retrieve the results of the submitted job labeled t
established with the remote server, referred to as the ’gate-
keeper’, which is responsible for the execution of the job (i.e. > # write the problem data in a file date.txt
a binary executable or command to be run remotely). Both the > with(m2g): m2g MGProxy(); m2g proxyinit();
host and the gatekeeper must comply with the authentication > m2g getservice(”gauss”,‘service access‘)
requirements. The Grid Security Infrastructure (GSI) is used > m2g jobsubmit(1,cat(service access,”gauss ”,”date.txt”));
for enabling secure authentication and communication over > m2g results(1);
an open network. Globus uses GASS for porting and running
the applications requiring I/O files to the Grid environment. Fig. 6. Accessing in Maple an external linear solver, available as grid service
Therefore, GridJob starts a GASS server and submits all
GRAM job requests to this server. The request is formatted
accordingly in the RSL format. The output of the processed functional Maple kernel is allowed from the grid: MGProxy
job is returned through the MGProxy intermediary to Maple acting as CAS-grid interface (Figure 3.b) implements only an
in the user’s interface. account check procedure in order to verify the user rights
The GridJob class incorporates the following methods: to access the licensed version of Maple lying on the grid.
• public GridJob(String Contact, int p, boolean batch) /* Obviously, our system can be further developed to restrict the
contructor responsible for the initialization of the contact access to some special Maple commands or function libraries.
string variable (Contact), gatekeeper port (p) and submis- The user interface can be a simple Java applet which
sion mode (i.e. whether batch or not) */ allows the user to send Maple commands as strings via a
• private boolean startGassServer(GSSCredential cred) /* socket connection to a local MGProxy awaken in the user
Starts the Globus GASS Server. Retrieves the output from mode by the Java applet initialization. The connection with
the GASS server and sends it to the client via GridService the remote Maple kernel is established at the initialization
and MapleListener as a string */ stage by sending a specific string in the format in which
• private void initJobOutListeners() /* Initiate and registers m2g jobsubmit send the information, specifying in this case
job out listeners for non-batch mode jobs */ the remote MGProxy as the grid-service, which will be awake
• public void statusChanged(GramJob job) /* Used to in the server mode. After the connection is established, Maple
notify the implementer when the status of a GramJob commands can be send to the remote Maple kernel (via the two
has changed. A waiting thread is notified when a job is MGProxy), their results being returned in a MathML format.
finished and when this is the case the URL is returned 3) Mode 3: message passing interface in Maple.: Parallel
and output */ codes using MPICH as message-passing interface can be easily
• public void outputChanged(String output) /* Called when ported to grid environments due to the existence of a MPICH-
the output is modified performs itself an update */ G version which runs on top of the Globus Toolkit. On other
• public String GlobusRun(String RSL) /* The default hand, the latest Globus Toolkit is build on Java, and the Java
Globus proxy is loaded provided that it exists and user clients are easier to write. This being the case, we selected
credentials are setup properly.// The GASS server is mpiJava [15] as the message-passing interface between Maple
started.// The RSL is formatted accordingly to the ex- kernels.
pected structure. In Maple2g a small number of commands is available to
A GramJob instance is created and the object sends a the user, for sending commands to other Maple kernels and
request to the remote host */ for receiving their results (Table V). These facilities are similar
The suite of functions incorporated in m2g Maple package to those introduced in PVMaple [18] and in Distributed Maple
allowing all this processing are presented in Table IV, while [19]. The user’s Maple interface is seen as the master process,
a short example is shown in Figure 6. while the other Maple kernels are working in a slave mode.
2) Mode 2: Maple services on grid.: The component func- Command sending is possible not only from the user’s Maple
tionality is similar to that of the MapleNet [12]. In the current interface, but also from one kernel to another (i.e. a user
version of the Maple2g prototype, the access to the fully command can contain inside a send/receive command between
TABLE V
other systems, in order for it to become comparably robust
M APLE 2 G FUNCTIONS / CONSTANTS FOR REMOTE PROCESS
as NetSolve or Geodise. Tests on grid on a large domain of
LAUNCH / COMMUNICATIONS
problems represent the next step that will help guide further
Function/const. Description development of the system. Deployment of grid services
m2g run(p) Starts p processs MGProxy in parallel modes from Maple in other languages than Maple using the code
m2g send(d, t, c) Send at the destination kernel labeled d a message
labeled t containing the Maple command c; d and generation tools must be take also into consideration. The
t are numbers, c is a string; when ’all’ is used in next MGProxy version will allow the cooperation between
destination field, c is send to all Maple kernels different CAS kernels lying on the same or different sites of
m2g recv(s, t) Receive from the source kernel labeled s a message
containing the results from the a previous Maple a computational grid.
command which was labeled with t; when ’all’ is
used in source field, a list is returned with the results R EFERENCES
from all Maple kernels which have executed the [1] Abramson D., Giddy J., Kolter L.: High performance para-
command labeled t metric modelling with Nimrod/G: A killer application for the
m2g exit() Kill all MGProxy processes, shutdown the twin Ma- global grid? In Procs. IPDPS’2000, Cancun (2000), 520–528,
ple kernels http://www.csse.monash.edu.au/˜davida/papers/ipdps.pdf
m2g rank MGProxy rank in the MPI World, can be used in a [2] Baldomero J.F.: Parallel Virtual Machine Toolbox. In Procs.
command MATLAB’99, Madrid, ed. S. Dormido (1999), 523-532,
m2g size Number of MGProxy processes, can be used in a http://atc.ugr.es/javier-bin/pvmtb eng
command [3] Casanova H. and Dongarra J.: NetSolve: a network server for solving
computational science problems. Inter.J. Supercomputer Appls. & HPC,
#Maple sequential code
> f:=(x,y)-->(xˆ2-y2+0.32, 2*x*y+0.043):
11(3), 212–223 (1997), http://icl.cs.utk.edu/netsolve/
> g:=(x,y)-->xˆ2+yˆ2: [4] Choy R., Edelman A.: Matlab*P 2.0: a unified parallel MATLAB, In
> h:=(x,y)-->if g((f@@130)(x,y))<1 then 0 else 1 fi:
> plot3d(‘h(x,y)‘, x=-1..1,y=-1.15..1.15,grid=[400,400],style=point,
Procs. 2nd Singapore-MIT Alliance Symp. (2003), in print.
view=[-1..1,-1.15..1.15,0..0.1],orientation=[90,0],scaling=constrained); [5] Eres M. H. et al:Implementation of a grid-enabled problem solv-
#Maple2g code
ing environment in Matlab. In Procs. WCPSE03 (2003), in print,
> with(m2g): m2g_MGProxy(); m2g_run(4): http://www.geodise.org
> m2g_send(‘all‘,1,"f:=(x,y)-->(xˆ2-yˆ2+0.32, 2*x*y+0.043):"):
> m2g_send(‘all‘,2,"g:=(x,y)-->xˆ2+yˆ2:"):
[6] Globus Toolkit, http://www.globus.org.
> m2g_send(‘all‘,3,"h:=(x,y)-->if g((f@@130)(x,y))<1 then 0 else 1 fi:"): [7] Globus Toolkit 3.2: Developer’s Guide, http://www-
> m2g_send(‘all‘,4,"plot3d(‘h(x,y)‘,grid=[400/mg_size,400],y=-1.15..1.15,
> x=-1+2*mg_rank/mg_size..-1+2*(mg_rank+1)/mg_size,style=point,
unix.globus.org/toolkit/docs/3.2/developer/commandlineclients.html# .
> view=[-1..1,-1.15..1.15,0..0.1],orientation=[90,0]);"): [8] GT3 Index Service Users Guide, http://www-
> plots[display3d](m2g_recv(‘all‘,4));
unix.globus.org/toolkit/3.0/ogsa/docs/users guide.html#CommandLineClient
[9] http://www.hicb.org/glue/glue.htm
[10] Kepner J.: Parallel programmimg with MatlabMpi. In Procs. HPEC2001
Fig. 7. Maple plot of a Julia fractal on a grid of 1.6 × 105 points: the (2001)
plotting time of order O(103 ) seconds in the sequential case can be reduced [11] von Laszewski, G and Foster, I, Usage of LDAP in
by a factor of Sp = 3.5 using p = 4 Maple kernels treating equal vertical Globus, CSE 225 (High Performance Distributed Computing),
slices http://www.globus.org/mds/globus in ldap.html
[12] MapleNet, http://www.maplesoft.com/maplenet/.
[13] MathML, The W3C’s Math Homepage, http://www.w3.org/Math/.
[14] Matsuoka S., Casanova H., Network-enabled server systems
slaves). and the computational grid. In Procs GF4-WG3, (2000),
To test the feasibility of this approach to developemnt of http://www.eece.unm.edu/˜ apm/WhitePapers/ GF4-WG3-NES-
distributed Maple applications, several tests have been per- whitepaper-draft-000705.pdf
[15] mpiJava, http://www.npac.syr.edu/projects/pcrc/HPJava/mpiJava.html
formed on a small PC cluster (4 Intel P4 1500 MHz processors, [16] MDS 2.2 Schemas. Definition of Schema,
connected by a Myrinet switch at 2Gb/s). We have observed http://www.globus.org/mds/Schema.html
then the speedup obtained when splitting time-consuming [17] Nakada H., Sato M. and Sekiguchi S.: Design and implementations
of Ninf: towards a global computing infrastructure. Future Generation
computations. While a detailed report on our experimental Computing Systems, Metacomputing Issue, 15(5-6) (1999), 649–658.
results is outside of the scope of this paper, we can report [18] Petcu D., PVMaple: A distributed approach to cooperative work of
that for instance in the case of constructing a Julia fractal (as Maple processes. LNCS 1908, eds. J.Dongarra et al., Springer (2000),
216–224.
illustrated in Figure 7) a speedup of 3.5 was obtained. [19] Schreiner W.: Developing a distributed system for algebraic geometry. In
Procs. EuroCM-Par’99, ed. B. Topping, Civil-Comp. Press, Edinburgh
IV. C ONCLUSIONS AND FUTURE PROJECTS (1999), 137–146.
Building grid-enabled versions of a computer algebra sys- [20] Solomon A.: Distributed computing for conglomerate mathematical
systems, In Integration of Algebra and Geometry Software Systems, eds.
tems are part of the emergence of true value of grid computing. M. Joswig, N. Takayama, http://www.illywhacker.net/papers/webarch.ps
Several approaches to construct such systems were discussed [21] JavaMath, http://javamath.sourceforge.net/.
in this paper. Following one such path, we have initiated a [22] Tepeneu D. and Ida T.: MathGridLink - A bridge between Mathematica
and the Grid. In Procs. JSSST03, Tokyo (2003), in print.
development of Maple2g, a wrapper for Maple enabling it [23] Wester M., A critique of the mathematical abilities of CA systems.
to access the grid services and to be accessed as the grid In Computer Algebra Systems: A Practical Guide, ed. M.Wester, John
service. Furthermore, Maple2g allows the distribution of the Wiley & Sons (1999), http://math.unm.edu/˜wester/ cas review.html
[24] http://whatis.techtarget.com/
computational effort to several Maple kernels running on a [25] Wolfram Research, MathLink, http://www.wolfram.com/solutions/ math-
parallel computer, a cluster, or a grid. link/.
At this stage Maple2g exists as a demonstrator system, [26] Wolfram Research, gridMathematica, http://www.wolfram.com.
however it already shows its potential. In the near future
it will be further developed to include facilities existing in

You might also like