Home
COMPSs User Manual: Application Development
Contents
1. o compss_wait_on o For instances of user defined classes the classes of these objects should have an empty constructor otherwise the programmer will not be able to invoke task instance methods on those objects MyClass object init__ self empty constructor ret_func o invoking a task instance method on a future object can only be done when an empty constructor is defined in the object s class yet_another_task o In order to make the COMPSs Python binding function correctly the programmer should not use relative imports in the code Relative imports can lead to ambiguous code and they are discouraged in Python as explained in http docs python org 2 faq programming html what are the best practices for using import in a module 13 3 2 Application Execution The next subsections describe how to execute applications with the COMPSs Python binding 3 2 1 Environment The following environment variables must be defined before executing a COMPSs Python application JAVA_HOME Java JDK installation directory e g usr lib jum java 7 openjdk 3 2 2 Command In order to run a Python application with COMPSs the runcompss script can be used like for Java and C C applications An example of an invocation of the script is For full description about the options available for the runcompss command please check the COMPSs User Manual Application Executi
2. COMP SUPERSCALAR User Manual Application development guide VERSION 1 3 Barcelona Supercomputing Center Centro Nacional de Supercomputaci n This manual only provides information about the development of COMPSs applica tions Specifically it details the programming model features available in Java Python and C C languages For an extensive list of COMPSs application examples codes execution commands results logs etc please refer to the COMPSs Sample Applications guide at compss bsc es For information about the installation process please refer to the COMPSs Installation Guide available at http compss bsc es For further information about the application execution please refer to the COMPSs User Manual Application execution guide available at http compss bsc es Contents 1 COMP Superscalar COMPSs 2 1 Programming Modell oe daa e 64a a A E 2 1 1 Main application CO O s 2 4 8 i662 6 08 be eee er ERS ee ee ee ee ee eee ee 2 1 3 Java annotated interface 2 2 2 a eee eee comer yey ee ane aoe AS ace ek oe ee ee ee since SME Ga SR a ee eee Se es 3 Python Binding 3 1 Programming Model o crisis sed e hed BET Task Sel ction c s ers es ae AA Dre a te wig a We e eS AA 3 1 3 Important Notes ooa aa 64 hes eb de REGS Da Y Rw se ee Sok ee e Se a 3 2 1 Environment isc cra rra 3 2 2 Command 4 C C Binding 4 1 Programming Model 2er estas pre a a Se MEA A x S
3. 3 N M compss_on A Matrix init N M val initMatrix amp B N M val initMatrix amp C N M 0 0 cout lt lt compss_wait_on B compss_wait_on C cout lt lt C multiply A B compss_off 0 16 The developer has to take into account the following rules 1 The directive DEBUG_BINDING can be defined if we need debug information from the binding A header file with the same name as the main file must be included in this case Matmul h This header file is automatically generated by the binding and it con tains other includes and type definitions that are required A call to the compss_on binding function is required to turn on the COMPSs runtime As in C language out or inout parameters should be passed by reference by means of the amp operator before the parameter name Synchronization on a parameter can be done calling the compss_wait_on binding function The argument of this function must be the variable or object we want to synchronize There is an implicit synchronization in the init method of Matrix It is not possible to know the address of A before exiting the method call and due to this it is necessary to synchronize before for the copy of the returned value into A for it to be correct A call to the compss_off binding function is required to turn off the COMPSs runtime 4 1 4 Functions file The implementation of the tasks i
4. Through the Constraints annotation developers can specify the common constraints for a whole set of methods In the following example only one core is required to run the method of both sorting algorithms However these sorting algorithms have different memory consumption thus each al gorithm might require a specific amount of memory and that should be stated in the implementation constraints For this purpose the developer can add a Multiconstraints annotation containing the specific constraints for each implementation Since the Merge sort has a higher memory consumption than the quicksort the following example sets a requirement of 1 core and 2GB of memory for the mergesort implementation and 1 core and 500MB of memory for the quicksort 2 2 Application Compilation A COMPSs Java application needs to be packaged in a jar file containing the class files of the main code of the methods implementations and of the tf annotation Next we provide a set of commands to compile the Java Simple application detailed at the COMPSs Sample Applications available at our website http compss bsc es In order to properly compile the code the CLASSPATH variable has to contain the path of the compss engine jar package The default COMPSs installation automati cally add this package to the CLASSPATH please check that your environment variable CLASSPATH contains the compss engine jar location by running the following command If the re
5. are immutable x File Type FILE It can have any direction IN OUT or INOUT The real Java type associated with a FILE parameter is a String that contains the path to the file However if the user specifies a parameter as a FILE COMPSs will treat 1t as such x Object Type Object It can have any direction IN OUT or INOUT Return type Any object a basic type or a generic class object Method modifiers the method has to be STATIC e Service level Metadata for each selected service the following metadata has to be defined Service Mandatory It specifies the service properties namespace Mandatory Service namespace name Mandatory Service name 5 port Mandatory Service port operation Operation type x priority True if the service takes priority false otherwise This parameter is used by the COMPSs scheduler The Java annotated interface of the Simple app example Simpleltf java includes the description of the Increment method metadata The method interface contains a single input parameter a string containing a path to the file counterFile In this example there are constraints on the minimum number of processors and minimum memory size needed to run the method simple integratedtoolkit types annotations Constraints integratedtoolkit types annotations Method integratedtoolkit types annotations Parameter integratedtoolkit types annotations Parameter Direction integratedto
6. i 0 i lt bSize 1 j 0 j lt bSize j 4 block gt datalil j initVal block COMPSS_WORKER Block multiply Block block1 Block block2 i 0 i lt M i 08 Jog gr al G k 0 k lt M k datalil j blocki data i k block2 data k j gt O Block print 4 i 0 i lt M i JOR Jog ges a cout lt lt datalil j lt lt cout lt lt 19 4 2 Application Compilation To compile the user application with the C C binding the buildapp command the user has to be executed in the directory of the main application code the name of the application has to be passed as argument to this script in this case Matmul user localhost matmul_objects buildapp Matmul Building application g DCOMPSS_MASTER g 1 I opt COMPSs Runtime bindings c include I opt COMPSs Runtime bindings bindings common include c Block cc Matrix cc ar rvs libmaster a Block o Matrix o g DCOMPSS_WORKER g 1 I opt COMPSs Runtime bindings c include I opt COMPSs Runtime bindings bindings common include c Block cc Matrix cc ar rvs libworker a Block o Matrix o Building all Building Master g g 02 o Matmul Matmul empty o Matmul stubs o Matmul o L lib lmaster L usr lib jvm java 6 openjdk amd64 jre lib amd64 server ljvm 1dl1l L opt COMPSs Runtime bindings c bindings common lib lbindings_common L opt COMPSs Runtime bindings c lib lcbindings lb
7. unassigned processorCPUCount Required number of CPUs for the host Default 0 processorCoreCount Required number of Cores Default 1 processorSpeed Required processor frequency Default 0 0f x Memory memoryPhysicalSize Required physical memory size in GBs Default 0 0f memory VirtualSize Required virtual memory size in GBs Default 0 0f memoryAccessTime Top memory access time in nanoseconds Default 0 0f memorySTR Minimal Memory bandwith in GB s Default 0 0f Storage storageElemSize Amount of required storage space in GB Default 0 0f storageElemAccessTime Top access time to the storage system in milliseconds Default 0 0f storageElemSTR Minimal Storage bandwith in MB s Default 0 0f x Miscellaneous OperatingSystemType Required operative system Default lunassigned hostQueue Required queues Default lunassigned appSoftware Required applications Default lunassigned e Parameter level Metadata Parameter for each parameter and method the user must define Direction Direction IN Direction INOUT or Direction OUT Type COMPSs supports the following types for task parameters x Basic types Type BOOLEAN Type CHAR Type BYTE Type SHORT Type IN T Type LONG Type FLOAT Type DOUBLE They can only have IN direction since primitive types in Java are always passed by value String Type STRING It can only have IN direction since Java Strings
8. FileNotFoundException fnfe fnfe printStackTrace F IOException ioe ioe printStackTrace 2 1 3 Java annotated interface The Java interface is used to declare the methods to be executed remotely along with Java annotations that specify the necessary metadata about the tasks The metadata can be of three different types 1 For each parameter of a method the data type currently File type primitive types and the String type are supported and its directions IN OUT or INOUT 2 The Java class that contains the code of the method 3 The constraints that a given resource must fulfill to execute the method such as the number of processors or main memory size A complete and detailed explanation of the usage of the metadata includes e Method level Metadata for each selected method the following metadata has to be defined Method Mandatory It specifies the class that implements the method isModifier True if the method modifies the implicit object false other wise priority True if the task takes priority and false otherwise This parameter is used by the COMPSs scheduler Constraints The user can specify the capabilities that a resource must have in order to run a method For example in a cloud execution the COMPSs runtime creates a VM that fulfils the specified requirements in order to perform the execution Processor processorArchitecture Required processor architecture Default
9. are supported e Direction it can be read only IN default read write INOUT or write only OUT COMPSs is able to automatically infer the parameter type for primitive types strings and objects while the user needs to specify it for files On the other hand the direction is only mandatory for INOUT and OUT parameters Thus when defining the parameter metadata in the task decorator the user has the following options e INOUT the parameter is read write The type will be inferred 9 e OUT the parameter is write only The type will be inferred e FILE the parameter is a file The direction is assumed to be JN e FILE_INOUT the parameter is a read write file e FILE_OUT the parameter is a write only file Consequently please note that in the following cases there is no need to include an argument in the Q task decorator for a given task parameter e Parameters of primitive types integer long float boolean and strings the type of these parameters can be automatically inferred by COMPSs and their direction is always IN e Read only object parameters the type of the parameter is automatically inferred and the direction defaults to IN Continuing with the example in the following code snippet the decorator specifies that func has a parameter called f of type FILE and INOUT direction Note how the second parameter 7 does not need to be specified since its type integer and direction IN are automatically
10. be defined in the main class or in other ones we recommend to define the tasks in a separated class from the main method to force its public declaration Java objects Objects used by tasks must follow the java beans model implementing an empty constructor and getters and setters for each attribute or implement the serializable interface This is due to the fact that objects will be transferred to remote machines to execute the tasks Services types The current COMPSs version only supports SOAP based services that implement the WS interoperability standard REST services are not supported Use of file paths The persistent workers implementation has a unique Working Directory per worker That means that tasks should not use hardcoded file names to avoid file collisions and tasks misbehaviours We recommend to use files declared as task parameters or to manually create a sandbox inside each task execution and or to generate temporary random file names Tracing The current version of the COMPSs tracing system slows down the application ex ecution Users running huge applications may experience a non negligible overhead when using this feature Intermediate files Some applications may generate intermediate files that are only used among tasks and are never needed inside the master s code However COMPSs will transfer back these files to the master node at the end of the execution Currently the only way to avoid transferring the
11. d above replaces the call to this method with the generation of a remote task that will be executed on an available node main String args 4 String counterName R initialValue args 0 i a m a a a a l a M Creation of the file which will contain the counter variable V SS SSS SSS SSS SS SS SSS SSS SS SE SSS SS SSS Wik FileOutputStream fos fos write initialValue System out println tinitialValue FileOutputStream counterName fos close Jr IOException ioe 4 ioe printStackTrace y TI I I iN rg a alia ote al Hy Ah Execution of the program Hil i a a al aad aad oh a ee an ie SimpleImpl increment counterName NS a a a Z Reading from an object stored in a File Id A a al ae FileInputStream fis System out println fis close T IOException ioe ioe printStackTrace FileInputStream counterName fis read 2 1 2 Remote methods code The following code contains the implementation of the remote method of the Simple application SimpleImpl java that will be executed remotely by COMPSs simple java java java java ios FileOutputStream O io io FilelnputStreanm IOException FileNotFoundException SimpleImpl increment String counterFile 1 FileInputStream fis count fis read fis close 0 FileInputStream counterFile FileOutputStream fos fos write count fos closet File0utputStream counterFile F
12. e he a ee oe eee 4 1 2 Value and Object return cocine ee ee ee 41 3 Main Programi s sack Ae Set k Ae a eS 4 1 4 Functions Tels 24 a Hk es oe Ee ee ee wae 4 1 5 Additional source Files oo er a ORE awe EA i Oh bone ph aed bee hae dae 4 1 7 Method Task Ee REESE Se Ee ES 4 2 Application Compilation oe ae be Kee boa ODE HE ODE DEERE ES 4 3 Application Execution od eee ea pee ade e ee du da eee 5 4 4 Execution Graph Known Limitations 11 12 14 14 14 15 15 15 16 16 17 18 18 19 20 20 21 22 List of Figures 1 Matmul Execution Graph cios 62 EA 21 ill List of Tables 1 Arguments of the Otask decorator o 11 2 COMPSs Python API functions a a 12 iv 1 COMP Superscalar COMPSs COMP Superscalar COMPSs is a programming model which aims to ease the develop ment of applications for distributed infrastructures such as Clusters Grids and Clouds COMP Superscalar also features a runtime system that exploits the inherent parallelism of applications at execution time For the sake of programming productivity the COMPSs model has four key charac teristics e Sequential programming COMPSs programmers do not need to deal with the typical duties of parallelization and distribution such as thread creation and syn chronization data distribution messaging or fault tolerance thus eliminating most of the difficulties of concurrent distributed p
13. ications The next subsections explain how to program a Python application for COMPSs and how to configure the binding library 3 1 Programming Model 3 1 1 Task Selection As in the case of Java a COMPSs Python application is a sequential program that contains calls to tasks In particular the user can select as a task e Functions e Instance methods methods invoked on objects e Class methods static methods belonging to a class The task definition in Python is done by means of Python decorators instead of an annotated interface In particular the user needs to add before the definition of the function method a task decorator that describes the task As an example let us assume that the application calls a function func which receives a string parameter containing a file name and an integer parameter The code of func updates the file In order to select func as a task the corresponding task decorator needs to be placed right before the definition of the function providing some metadata about the parameters of that function The metadata corresponding to a parameter is specified as an argument of the decorator whose name is the formal parameter s name and whose value defines the type and direction of the parameter The parameter types and directions can be e Types primitive types integer long float boolean strings objects instances of user defined classes dictionaries lists tuples complex numbers and files
14. ill see later The grammar for the interface file is task name parameter parameter ask name lt qualified name of the or method gt parameter direction parameter name direction 15 class name class name lt qualified name of the class gt 4 1 2 Value and Object return The binding allows returning a value void int long float etc or an object from a function or method In C C the default policy is to make a copy of the value or object when it is returned A foo and this copy A is a new position in memory whom reference or address is not possible to know before the return statement As the COMPSs runtime cannot know such reference before returning from the task execution foo it must do a synchronization before the return statement for the correct value to be copied when returning This is called an explicit synchronization Alternatively the return of a value or an object can be done also by mean of an out or inout parameter and no explicit synchronization is needed because the reference is passed to the binding in this case using the amp operator foo amp A 4 1 3 Main Program The next listing includes an example of matrix multiplication written in C DEBUG_BINDING Matmul h Block h MSIZE BSIZE val main argc argv N M Matrix A Matrix B Matrix C atoi argv 1 atoi argv 2 val atof argv
15. inferred by COMPSs If the function or method returns a value the programmer must specify the type of that value using the returns argument of the Q task decorator For tasks corresponding to instance methods by default the task is assumed to modify the callee object the object on which the method is invoked The programmer can tell otherwise by setting the z7sModifier argument of the Qtask decorator to False The programmer can also mark a task as a high priority task with the priority argu ment of the task decorator In this way when the task is free of dependencies it will be scheduled before any of the available low priority regular tasks This functionality is useful for tasks that are in the critical path of the application s task dependency graph 10 Table i summarizes the arguments that can be found in the task decorator Argument Value Formal parameter name INOUT read write parameter all types except file primi tives strings objects OUT read write parameter all types except file primitives strings objects FILE read only file parameter FILE_INOUT read write file parameter FILE_OUT write only file parameter returns int for integer and boolean long float str dict list tuple user defined classes isModifier True default or False priority True or False default Table 1 Arguments of the Qtask decorator 3 1 2 Main Program The
16. iplications i e three multiplications of 4x4 matrices of doubles The light blue circle corresponds to the initialization of matrix A by means of a method task and it has an implicit synchronization inside The dark blue circles corre spond to the other two initializations by means of function tasks in this case the syn chronizations are explicit and must be provided by the developer after the task call Both implicit and explicit synchronizations are represented as red circles Each green circle is a partial matrix multiplication of a set of 3 One block from matrix A and the correspondent one from matrix B The result is written in the right block in C that accumulates the partial block multiplications Each multiplication set has an explicit synchronization All green tasks are method tasks and they are executed in parallel N 3 Matrix size M 4 Block size Parallel tasks 3x3 Matrix 9 blocks Each block accumulates 3 4x4 matrix multiplications Implicit synchronization Explicit synchronizations Figure 1 Matmul Execution Graph 21 5 Known Limitations The current COMPSs version 1 3 has the following limitations Exceptions The current COMPSs version is not able to propagate exceptions raised from a task to the master However the runtime catches any exception and sets the task as failed Java tasks Java tasks must be declared as public Despite the fact that tasks can
17. main program of the application is a sequential code that contains calls to the selected tasks In addition when synchronizing for task data from the main program there exist two API functions that need to be invoked e compss_open file name mode r similar to the Python open call It synchro nizes for the last version of file filename and returns the file descriptor for that synchronized file It can have an optional parameter mode which defaults to r containing the mode in which the file will be opened the open modes are analogous to those of Python open e compss_wait_on obj to_write True synchronizes for the last version of object obj and returns the synchronized object It can have an optional boolean parameter to_write which defaults to True that indicates whether the main program will modify the returned object To illustrate the use of the aforementioned API functions the following example first invokes a task func that writes a file which is later synchronized by calling compss_open Later in the program an object of class MyClass is created and a task method method that modifies the object is invoked on it the object is then synchronized with compss_wait_on so that it can be used in the main program from that point on 11 pycompss api api compss_open compss_wait_on my_file func my_file fd compss_open my_file my_obj MyClass my_obj method my_obj compss_wait_on
18. my_obj The corresponding task selection for the example above would be task f FILE_OUT func f MyClass object task method self self is modified here Table 2 summarizes the API functions to be used in the main program of a COMPSs Python application Function Use compss_open file name mode r Synchronizes for the last version of a file and returns its file descriptor compss_wait_on obj to_write True Synchronizes for the last version of an object and returns it Table 2 COMPSs Python API functions 3 1 3 Important Notes If the programmer selects as a task a function or method that returns a value that value is not generated until the task executes task returns MyClass ret_func MyClass o is a future object o ret_func 12 The object returned can be involved in a subsequent task call and the COMPSs run time will automatically find the corresponding data dependency In the following example the object o is passed as a parameter and callee of two subsequent asynchronous tasks respectively o is a future object o ret_func another_task o o yet_another_task In order to synchronize the object from the main program the programmer has to synchronize using the compss_wait_on function in the same way as with any object updated by a task o is a future object ret_func o i
19. n a C or C program has to be provided in a functions file Its name must be the same as the main file followed by the suffix functions In our case Matmul functions cc In the previous code class methods have been encapsulated inside a function This is useful when the class method returns an object or a value and we want to avoid the explicit synchronization when returning from the method 17 4 1 5 Additional source Files Other source files needed by the user application must be placed under the directory src In this directory the programmer must provide a Makefile that compiles such source files in the proper way When the binding compiles the whole application it will enter into the src directory and execute the Makefile It generates two libraries one for the master application and another for the worker application The directive COMPSS_MASTER or COMPSS_WORKER must be used in order to compile the source files for each type of library Both libraries will be copied into the lib directory where the binding will look for them when generating the master and worker applications 4 1 6 Class Serialization In case of using an object as method parameter as callee or as return of a call to a function the object has to be serialized The serialization method has to be provided inline in the header file of the object s class by means of the boost library The next listing contains an example of serialization for two
20. objects of the Block class BLOCK_H BLOCK_H lt vector gt lt boost archive text_iarchive hpp gt lt boost archive text_oarchive hpp gt lt boost serialization serialization hpp gt lt boost serialization access hpp gt lt boost serialization vector hpp gt std boost serialization Block BO Block bSize Block init bSize initVal multiply Block block1 Block block2 print M std vector lt std vector lt gt gt data friend class serialization access template lt class Archive gt void serialize Archive amp ar const unsigned int version ar amp M ar amp data 18 For more information about serialization using boost visit the related documentation at www boost org 4 1 7 Method Task A task can be a C class method A method can return a value modify the this object or modify a parameter If the method has a return value there will be an implicit synchronization before exit the method but for the this object and parameters the synchronization can be done later after the method has finished This is because the this object and the parameters can be accessed inside and outside the method but for the variable where the returned value is copied to 1t can t be known inside the method Block Block bSize M bSize data resize M OM ah datalil resize M Block Block init bSize initVal Block block Block bSize
21. olkit types annotations Parameter Type SimpleItf Constraints processorCPUCount 1 memoryPhysicalSize 0 3f Method declaringClass simple Simplelmpl increment Parameter type Type FILE direction Direction INOUT String file 2 1 4 Alternative method implementations Since version 1 2 the COMPSs programming model allows developers to define sets of alternative implementations of the same method in the Java annotated interface The following code depicts an example where the developer sorts an integer array using two different methods merge sort and quick sort that are respectively hosted in the pack agepath Mergesort and packagepath Quicksort classes Method declaringClass packagepath Mergesort packagepath Quicksort sort Parameter type Type OBJECT direction Direction INOUT array As depicted in the example the name and parameters of all the implementations must coincide the only difference is the class where the method is implemented This is reflected in the attribute declaringClass of the Method annotation Instead of stating that the method is implemented in a single class the programmer can define an array of declaring classes for the method As independent remote methods the sets of equivalent methods might have common restrictions to be fulfilled by the resource hosting the execution Or even each implemen tation can have specific constraints
22. on available at nttp compss ibsc es 14 4 C C Binding COMPSs provides a binding for C and C applications The new C version in the current release comes with support for objects as task parameters and the use of class methods as tasks 4 1 Programming Model 4 1 1 Task Selection As in Java the user has to provide a task selection by means of an interface In this case the interface file has the same name as the main application file plus the suffix idl i e Matmul idl where the main file is called Matmul cc interface Matmul C functions initMatrix inout Matrix matrix in mSize in nSize in val multiplyBlocks inout Block blocki inout Block block2 inout Block block3 C class methods Block multiply in Block block1 in Block block2 Matrix Matrix init in mSize in bSize in val 5 The syntax of the interface file is shown in the previous code Tasks can be declared as classic C function prototypes this allow to keep the compatibility with standard C applications In the example initMatrix and multiplyBlocks are functions declared using its prototype like in a C header file but this code is C as they have objects as parameters objects of type Matrix or Block A class method can be also a task and it is declared using its signature In the example Block multiply and Matrix init are class methods In this example C functions encapsulates object method calls as we w
23. oost_iostreams lboost_serialization Building Worker g g 02 o Matmul worker Matmul worker o Matmul functions o L lib lworker 1dl lboost_iostreams lboost_serialization L opt COMPSs Runtime bindings c lib Command succesful The previous output has been cut for simplicity 4 3 Application Execution The following environment variables must be defined before executing a COMPSs C C application JAVA HOME Java JDK installation directory e g usr lib jvm java 7 openjdk After compiling the application two directories master and worker are generated The master directory contains a binary called as the main file which is the master appli cation in our example is called Matmul The worker directory contains another binary called as the main file followed by the suffix worker which is the worker application in our example is called Matmul worker The runcompss script has to be used to run the application compss bsc runcompss lang c g home compss workspace_c matmul_objects master Matmul 3 4 2 0 The completelist of options of the runcompss command is available in the COMPSs User Manual Application Execution at http compss bsc es 20 4 4 Execution Graph Figure 1 depicts the execution graph for the Matmul application in its object version with 3x3 blocks matrices each one containing a 4x4 matrix of doubles Each block in the result matrix accumulates three block mult
24. rogramming A task is a method or a service called from the application code that is intended to be spawned asyn chronously and possibly run in parallel with other tasks on a set of resources instead of locally and sequentially e Infrastructure unaware COMPSs offers a model that abstracts the application from the underlying infrastructure Hence COMPSs programs do not include any detail that could tie them to a particular platform like deployment or resource management This makes applications portable between infrastructures with diverse characteristics e Standard programming languages COMPSs natively supports Java applica tions but also offers language bindings for Python and C C applications e No APIs In the case of COMPSs applications in Java the model does not require to use any special API call pragma or construct in the application everything is standard Java syntax and libraries As regards the Python and C C bindings a small set of API calls should be used on the COMPSs applications 2 Java This section illustrates the steps to develop a Java COMPSs application to compile and to execute it The Simple application will be used as reference code The user is required to select a set of methods invoked in the sequential application that will be run as remote tasks on the available resources 2 1 Programming Model A COMPSs application is composed of three parts e Main application code the code that is executed
25. se intermediate files is to manually erase them at the end of the master s code Users must take into account that this only applies for files declared as task parameters and not for files created and or erased inside a task Workers cache Persistent workers maintain a cache to avoid transferring files and objects repeatedly However this cache is not working for INOUT parameters only works for IN and OUT parameters For most applications if users are willing to exploit this cache we recommend to convert INOUT parameters in two separated parameters one declared as IN parameter and the other declared as OUT parameter 22 Please find more details on the COMPSs framework at http compss bsc es 23
26. sequentially and contains the calls to the user selected methods that will be executed by the COMPSs runtime as asynchronous parallel tasks e Remote methods code the implementation of the tasks e Java annotated interface It declares the methods to be run as remote tasks along with metadata information needed by the runtime to properly schedule the tasks The main application file name has to be the same of the main class and starts with capital letter in this case it is Simple java The Java annotated interface filename is application name Itf java in this case it is Simpleltf java And the code that imple ments the remote tasks is defined in the application name Impl java file in this case it is SimpleImpl java All code examples are in the home compss workspace_java folder of the develop ment environment 2 1 1 Main application code In COMPSs the user s application code is kept unchanged no API calls need to be included in the main application code in order to run the selected tasks on the nodes The COMPSs runtime is in charge of replacing the invocations to the user selected methods with the creation of remote tasks also taking care of the access to files where required Let s consider the Simple application example that takes an integer as input parameter and increases it by one unit The main application code of Simple app Simple java is executed sequentially until the call to the increment method COMPSs as mentione
27. sult of the previous command is empty it means that you are missing the compss engine jar package in your classpath We recommend to automatically load the variable by editing the bashrc file If you are using an IDE such as Eclipse or NetBeans we recommend you to add the compss engine jar file as an external file to the project The compss engine jar file is avail able at your current COMPSs installation under the path opt COMPSs Runtime compss engine jar An Integrated Development Environment for Eclipse is also available to simplify the development compilation deployment and execution COMPSs applications For fur ther information about the COMPSs IDE please refer to the COMPSs IDE User Guide available at http compss bsc es 2 3 Application Execution A Java COMPSs application is executed through the runcompss script An example of an invocation of the script is A comprehensive description of the runcompss command is available in the COMPSs User Manual Application Execution document available at http compss bsc es In addition to Java COMPSs supports the execution of applications written in other languages by means of bindings A binding manages the interaction of the no Java appli cation with the COMPSs Java runtime providing the necessary language translation The next sections describe the Python and C C language bindings offered by COMPSs 3 Python Binding COMPSs features a binding for Python 2 x appl
Download Pdf Manuals
Related Search
Related Contents
Scaricare - File PDF LG RU-42PZ61/71 User's Manual Snuggーe Nesf IIT 1500 - Electrocomponents DESATASCADOR PARA TUBERIAS Y DESAGÜES MPL T-TeleSec LineCrypt L100 Atelier photo nature Smeg SCP496X-8 Descargar trabajo completo () Copyright © All rights reserved.
Failed to retrieve file