INFORMATION PROCESSING APPARATUS AND COMPILATION METHOD
20170139750 ยท 2017-05-18
Assignee
Inventors
Cpc classification
G06F9/4843
PHYSICS
International classification
Abstract
An apparatus includes one or more memories; and one or more processors configured to be coupled to the one or more memories, wherein the one or more processors are configured to generate, through compiling a source code, an object program, execute the object program as multiple processes generated by execution of the object program, allocate a first storage domain in the one or more memories for each of the multiple processes, allocate a variable in the first storage domain for each of the multiple processes, notify multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
Claims
1. An apparatus, comprising: one or more memories; and one or more processors configured to be coupled to the one or more memories, wherein the one or more processors are configured to generate, through compiling a source code, an object program, execute the object program as multiple processes generated by execution of the object program, allocate a first storage domain in the one or more memories for each of the multiple processes, allocate a variable in the first storage domain for each of the multiple processes, notify multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
2. The apparatus according to claim 1, wherein the first storage domain is a storage domain which is referred to by each of the multiple processes.
3. The apparatus according to claim 1, wherein the one or more processors generate the object program in which a second storage domain that is a storage domain of the address information is notified so as to be shared in the multiple processes when the object program is executed.
4. The apparatus according to claim 1, wherein the one or more processors generate the object program that refers to the first storage domain indicated by the address information corresponding to the variable to be referred to, in a case where the variable of a different process included in the multiple processes is referred to in response to execution of the object program.
5. The apparatus according to claim 1, wherein the multiple processes are processes which are operated respectively by physical machines different from each other.
6. The apparatus according to claim 1, wherein the one or more processors generate the object program that prepares the address information when the object program is executed.
7. A non-transitory, computer-readable recording medium having stored therein a program for causing a computer to execute a process, the process comprising: generating, through compiling a source code, an object program, executing the object program as multiple processes generated by execution of the object program, allocating a first storage domain in one or more memories for each of the multiple processes, allocating a variable in the first storage domain for each of the multiple processes, notifying multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
8. The non-transitory, computer-readable recording medium which stores a compilation program according to claim 7, wherein the first storage domain is a storage domain which can be referred to by each of the multiple processes.
9. The non-transitory, computer-readable recording medium which stores a compilation program according to claim 7, wherein a second storage domain which is a storage domain of the address information is notified so as to be shared in the multiple processes in notification processing.
10. The non-transitory, computer-readable recording medium which stores a compilation program according to claim 7, the processing further comprising: referring to the storage domain indicated by the address information corresponding to the variable to be referred to, in a case where the variable of a different process included in the multiple processes is referred to.
11. The non-transitory, computer-readable recording medium which stores a compilation program according to claim 7, wherein the multiple processes are processes which are operated respectively by physical machines different from each other.
12. The non-transitory, computer-readable recording medium which stores a compilation program according to claim 7, the processing further comprising: preparing the address information before the notification processing of the address information.
13. A compilation method employed in a computer, the compilation method comprising: generating, through compiling a source code, an object program; executing the object program as multiple processes generated by execution of the object program; allocating a first storage domain in one or more memories for each of the multiple processes; allocating a variable in the first storage domain for each of the multiple processes; notifying multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
DESCRIPTION OF EMBODIMENT
[0044] Configuration of Information Processing System
[0045]
[0046] The physical machines 1 and 2 execute processing for providing users with service. For example, in order to disperse the load entailed by execution of the processing, the physical machines 1 and 2 execute the same object.
[0047] For example, the storage device 3 stores objects for providing users with service, source codes, and compilation programs (hereinafter, will also be referred to as compilers). For example, when the object is executed, the physical machines 1 and 2 acquire the object from the storage device 3 and execute the acquired object.
[0048] The service provider terminal 11 is a terminal through which a service provider performs management of the physical machines 1 and 2, and the storage device 3. Specifically, for example, the service provider instructs each physical machine to generate the object, via the service provider terminal 11. In addition, for example, the service provider instructs each physical machine to execute the object, via the service provider terminal 11.
[0049] The information processing system 10 illustrated in
[0050] Specific Example of Source Code
[0051]
[0052] In the example illustrated in
[0053] In addition, in the example illustrated in
[0054] In addition, in the example illustrated in
[0055] In addition, in the example illustrated in
[0056] In addition, in the example illustrated in
[0057] In addition, in the example illustrated in
[0058] In addition, in the example illustrated in
[0059] In addition, in the example illustrated in
[0060] In addition, in the example illustrated in
[0061] In addition, in the example illustrated in
[0062] In other words, the source codes illustrated in
[0063] Specific Example of Memory Domain Allocated to Variable Having No ALLOCATABLE Attribute
[0064] Next, description will be given regarding a specific example of a shared memory domain which is allocated to a variable having no ALLOCATABLE attribute (a variable of which the address does not change during the operation of the process).
[0065] In the source codes illustrated in
[0066] Specifically, in the example illustrated in
[0067] Specific Example of Memory Domain Allocated to Variable Having ALLOCATABLE Attribute
[0068] Next, description will be given regarding a specific example of a memory domain which is allocated to a variable having an ALLOCATABLE attribute (a variable of which the address changes during the operation of the process).
[0069] In the source code illustrated in
[0070] In this case, when the object is generated, for example, the compiler allocates the memory domain which stores the address of the shared memory domain of the variables, in addition to the shared memory domain which stores the contents of the variable Z2 and the array V2 are stored. Specifically, as illustrated in
[0071] For example, in a case of having access to the variable Z2 which can be traced from the first element of the array X2 of a different process, each process acquires the address (the address P2) of the coarray C2 by having access to the address P1, and acquires the address (the address P3) of the variable Y2 which is a component of the first element of the array X2 by having access to the address P2. Thereafter, each process acquires the address (the address P4) of the variable Z2 which is a component of the variable Y2 by having access to the address P3, and acquires the contents of the variable Z2 by having access to the address P4.
[0072] Here, in a case where the processes are executed by the physical machines different from each other, each process desirably has access to a different physical machine when referring to the shared memory domain of a different process. Accordingly, in this case, the desired time for communication with respect to the different process is lengthened compared to a case where the different process is executed in the same physical machine.
[0073] Moreover, there are cases where the address of a variable in the shared memory domain of each process is determined when the object is executed, as described in
[0074] Therefore, the physical machine 1 according to the present embodiment generates an object such that address information of a variable subjected to communication among the processes, that is, a variable (hereinafter, will also be referred to as a first variable) to which a memory domain (a shared memory domain) is designated at the time of execution of the object is notified so as to be shared with a different physical machine (for example, the physical machine 2) when the object is executed. Hereinafter, the shared memory domain of the physical machine 1 according to the present embodiment will be described.
[0075]
[0076] Accordingly, even in a case where a different process to be subjected to access is present in a different physical machine, the physical machine 1 can reduce the desired number of times of communication for access to the variable of the different process. Accordingly, the physical machine 1 can shorten the desired time for execution of the object.
[0077] Hardware Configuration of Physical Machine
[0078] Next, hardware configurations of the physical machines 1 and 2 will be described.
[0079] The physical machine 1 includes a CPU 101 which has one, two, or more processors, a memory 102, an external interface (an I/O unit) 103, and a storage medium (a storage) 104. The units are connected to each other via a bus 105.
[0080] The storage medium 104 stores a program 110 (hereinafter, will also be referred to as an object generating program 110) for performing processing (hereinafter, will also be referred to as object generation processing) in which an object is generated, in a program storage domain in the storage medium 104. As a non-volatile storage medium, the storage medium 104 includes at least one selected from a read only memory (ROM), a hard disk drive (HDD), a solid state drive (SSD), an electrically erasable programmable read-only memory (EEPROM), a flash memory, and the like. The non-volatile storage medium stores an OS or various types of application programs, and data used when the programs are executed. In addition, for example, the storage medium 104 has an information storage domain 130 (hereinafter, will also be referred to as a storage section 130) which stores information used when the object generation processing is performed.
[0081] As illustrated in
[0082] The physical machine 2 includes a CPU 201 which has one, two, or more processors, a memory 202, an external interface (an I/O unit) 203, and a storage medium (a storage) 204. The units are connected to each other via a bus 205.
[0083] The storage medium 204 stores an object generating program 210 for performing the object generation processing, in the program storage domain in the storage medium 204. As a non-volatile storage medium, the storage medium 204 includes at least one selected from a read only memory (ROM), a hard disk drive (HDD), a solid state drive (SSD), an electrically erasable programmable read-only memory (EEPROM), a flash memory, and the like. The non-volatile storage medium stores an OS or various types of application programs, and data used when the programs are executed. In addition, for example, the storage medium 204 has an information storage domain 230 (hereinafter, will also be referred to as a storage section 230) which stores information used when the object generation processing is performed.
[0084] As illustrated in
[0085] As a non-volatile storage medium, the storage device 3 includes at least one selected from a read only memory (ROM), a hard disk drive (HDD), a solid state drive (SSD), an electrically erasable programmable read-only memory (EEPROM), a flash memory, and the like. The non-volatile storage medium may store an OS or various types of application programs, and data used when the programs are executed. The storage device 3 has an information storage domain 330 (hereinafter, will also be referred to as a storage section 330) configured to store desired information for the CPU 101 of the physical machine 1 or the CPU 201 of the physical machine 2 which execute the object generation processing. Hereinafter, information stored in the information storage domain 330 will be described.
[0086]
[0087] Software Configuration of Physical Machine
[0088] Next, software configurations of the physical machines 1 and 2 will be described.
[0089] The object generating section 111 acquires the source code 331 and the compiler 332 stored in the information storage domain 330. The object generating section 111 generates the object 333 when the compiler 332 compiles the source code 331. Thereafter, the object generating section 111 stores the generated object 333 in the information storage domain 330.
[0090] Specifically, the object generating section 111 generates the object 333 such that the address information 131 of the first storage domain of a variable subjected to communication in multiple processes generated in response to execution of the same object 333, that is, the first variable to which the storage domain is allocated in response to execution of the object 333 is notified so as to be shared in the multiple processes when the object 333 is executed.
[0091] For example, the object generating section 111 may generate the object 333 when information on starting compilation of a predetermined source code 331 is received from the service provider terminal 11. In addition, the object generating section 111 may be configured to generate the object 333 such that the address position information 132 indicating the address of the storage domain of the address information 131 is notified, instead of the address information 131, when the object 333 is executed.
[0092] The object executing section 112 acquires the object 333 stored in the information storage domain 330. The object executing section 112 executes the acquired object 333. In this case, the object executing section 112 issues notification of the address information 131 stored in the first storage domain, in response to execution of the object 333 so as to be shared in the multiple processes generated in response to execution of the object 333. The ID allocation information 133, the ID width information 134, the ID allocation number information 135, and the ID allocation expression information 136 will be described later.
[0093] In addition,
[0094] Operations of the object generating section 211 and the object executing section 212 are the same as the operations of the object generating section 111 and the object executing section 112. Thus, detailed description thereof will be omitted. In addition, the contents of the address information 231, the address position information 232, the ID allocation information 233, and the ID width information 234 are the same as the contents of the address information 131, the address position information 132, the ID allocation information 133, and the ID width information 134. Thus, detailed description thereof will be omitted. Moreover, the contents of the ID allocation number information 235 and the ID allocation expression information 236 are the same as the contents of the ID allocation number information 135 and the ID allocation expression information 136. Thus, detailed description thereof will be omitted.
Outline of First Embodiment
[0095] Next, the outline of a first embodiment will be described.
[0096] As illustrated in
[0097] In a case where it is the object generation time (YES in S1), the physical machine 1 generates the object 333 when the compiler 332 compiles the source code 331. Specifically, the physical machine 1 generates the object 333 such that the address information 131 of the first storage domain of the first variable is notified so as to be shared in the multiple processes generated in response to execution of the object 333 when the object 333 is executed (S2). Hereinafter, description will be given regarding a case of executing the object generated through the processing of S2.
[0098]
[0099] In the example illustrated in
[0100] Accordingly, for example, the process P1 can refer to the first storage domain 202a in a case of having access to the first variable in the process P2. In this case, the process P1 can have direct access to the first variable in the process P2 by referring to the address information 231 stored in the first storage domain 202a. Accordingly, the physical machine 1 can reduce the number of times of communication with respect to the physical machine 2 entailed by execution of the object 333.
[0101] Here, in the example illustrated in
[0102] However, as in the processing described in the 37th line to the 39th line of the source codes illustrated in
[0103] Accordingly, in the physical machine 1 according to the present embodiment, the physical machine 1 does not store the first variable in the process P2. The physical machine 1 stores only the address information 231 of the first variable in the process P2. The physical machine 1 has access to the first variable in the process P2 stored in the first storage domain 202a of the physical machine 2, with reference to the address information 231.
[0104] In this manner, the physical machine 1 has the object generating section 111 which generates the object 333 such that the address information of the first storage domain 102a configured to store a variable subjected to communication in the multiple processes generated in response to execution of the object 333, that is, the first variable to which the storage domain is designated in response to execution of the object 333 is notified so as to be shared in the multiple processes when the object 333 is executed.
[0105] Accordingly, even in a case where a different process to be subjected to access is present in a different physical machine, the physical machine 1 can reduce the desired number of times of communication for access to the variable of the different process. Accordingly, the physical machine 1 can shorten the desired time for execution of the object.
Details of First Embodiment
[0106] Next, the details of the first embodiment will be described.
[0107] As illustrated in
[0108] Details of Processing of S12
[0109]
[0110] Details of Processing of S21
[0111]
[0112] Thereafter, for example, in a case where the first variable specified through the processing of S32 is referred to by a different process, the object generating section 111 determines whether or not the first variable is desired to perform three or more times of communication (S33). As a result thereof, in a case where the first variable is desired to perform three or more times of communication in a case where the first variable is referred to by a different process (YES in S33), the object generating section 111 adds the first variable specified through the processing of S32 to the ID allocation information 133 (S34). Meanwhile, in a case where the first variable is not desired to perform three or more times of communication in a case where the first variable is referred to by a different process (NO in S33), the object generating section 111 does not execute the processing of S34.
[0113] Specifically, in the example illustrated in
[0114] In other words, in the processing of S33 and S34, the object generating section 111 extracts only the first variable of which the number of times of communication in the physical machines can be efficiently reduced, from the source code 331.
[0115] Thereafter, the object generating section 111 determines whether or not all of the ALLOCATE statements are extracted from the source code 331 (S35). As a result thereof, in a case where extraction of all of the ALLOCATE statement is completed (YES in S35), the object generating section 111 ends the processing of S21. Meanwhile, in a case where extraction of all of the ALLOCATE statement is not completed (NO in S35), the object generating section 111 executes the processing after S31 again.
[0116] In the processing of S33, the object generating section 111 may be configured to execute the processing of S34 only in a case where the first variable specified through the processing in S32 is a variable to which ID can be statically allocated (YES in S33).
[0117] In other words, for example, in a case where the first variable extracted through the processing of S32 is an array or the like of which the size is unknown until the object is executed, the object generating section 111 may not specify the number of the first variables desired to be subjected to allocation of ID when the object 333 is generated. Accordingly, regarding the first variable specified through the processing in S32 is a variable to which ID may not be statically allocated, in order to exclude the aforementioned first variable from the first variables to which ID is allocated, the object generating section 111 may be configured not to perform addition with respect to the ID allocation information 133.
[0118] Next, a specific example of the processing of S21 will be described.
[0119] In the source code 331 illustrated in
[0120] Thereafter, the object generating section 111 extracts ALLOCATE(C2%X2(1)%Y2) described in the 33rd line, and specifies the variable Y2 included in the extracted description (S31 and S32). Here, for example, in a case where the process P2 has access to the coarray C2 of the process P1, the process P2 is desired to have access three times to the shared memory domain allocated to the process P1 (YES in S33). Accordingly, the object generating section 111 adds the variable Y2 to the ID allocation information 133 (S34).
[0121] Similarly, the object generating section 111 extracts ALLOCATE(C2%X2(1)%Y2%Z2) described in the 34th line, and adds the variable Z2 to the ID allocation information 133 (S34). In addition, the object generating section 111 extracts ALLOCATE(C2%X2(1)%Y2%V2(N)) described in the 35th line, and adds the array V2 to the ID allocation information 133 (S34). Hereinafter, description will be given regarding a specific example of the ID allocation information 133 in a case where the processing of S21 is executed with respect to the source code 331 illustrated in
[0122] Specific Example of ID Allocation Information
[0123]
[0124] Specifically,
[0125] Returning to
[0126] Details of Processing of S22
[0127]
[0128] Specific Example of ID Width Information
[0129]
[0130] Specifically, in the ID width information 134 illustrated in
[0131] In a case where the array X2 is extracted through the processing of S41, as indicated by the underlined portion in
[0132] Returning to
[0133] Subsequently, in a case where the variable P is an array having the component (hereinafter, will also be referred to as a derived-type array) (YES in S44), the object generating section 111 executes processing for calculating the width of the variable P (hereinafter, will also be referred to as width calculation processing) (S45). The width calculation processing will be described later. Meanwhile, in a case where the variable P is not the derived-type array (NO in S44), the processing of S45 is not executed.
[0134] In a case where extraction of all of the variables P is not completed (NO in S46), the object generating section 111 executes the processing of S43 to S45 again.
[0135] Specifically, in a case where the variable Y2 is extracted through the processing of S41, the object generating section 111 extracts the coarray C2 which has the variable Y2 as a component, as the variable P (S43). Here, the coarray C2 is not the derived-type array (NO in S44, and NO in S46). Accordingly, the object generating section 111 does not execute the width calculation processing with respect to the coarray C2. In addition, similar to a case where the variable Y2 itself is extracted as the variable P, the object generating section 111 does not execute the width calculation processing with respect to the variable Y2 (S43, NO in S44, and NO in S46).
[0136] Meanwhile, the array X2 which is a variable having the variable Y2 as a component is the derived-type array (S43, and YES in S44). Accordingly, in a case where the array X2 is extracted as the variable P (S43), the object generating section 111 executes the width calculation processing with respect to the variable Y2 (YES in S44, and S45). Hereinafter, the width calculation processing of the variable P will be described.
[0137] Width Calculation Processing of Variable P
[0138]
[0139] The object generating section 111 sets 0 to the variable W1 (S51). In a case where the variable P is present in the ID allocation information 133 (NO in S52), the object generating section 111 sets 1 to the variable W1 (S53). Meanwhile, in a case where the variable P is not present in the ID allocation information 133 (NO in S52), the object generating section 111 does not execute the processing of S53.
[0140] Specifically, in a case where the variable P is the array X2, the array X2 is not present in the ID allocation information 133 (NO in S52). Accordingly, in this case, the object generating section 111 does not perform the processing of S53. Therefore, 0 is set to the variable W1 (S51).
[0141] Next, in a case where the variable P is the derived-type array (YES in S61), as illustrated in
[0142] Subsequently, in a case where the variable C extracted through the processing of S62 is the derived-type array (YES in S64), the object generating section 111 sets a value obtained by multiplying the return value (the variable W2) in the processing of S63 (the width calculation processing of the variable C) and the number of elements of the variable C, as the variable W2 (S65). Meanwhile, in a case where the variable C extracted in S62 is not the derived-type array (NO in S64), the object generating section 111 does not execute the processing of S65.
[0143] Thereafter, the object generating section 111 sets a value obtained by adding the variable W1 and the variable W2, as the variable W1 (S66). In the processing of S62, in a case where extraction of all of the variables C is completed (YES in S67) or in a case where the variable P is not the derived-type array (NO in S61), the object generating section 111 returns the value stored in the variable W1, as the return value, thereby ending the width calculation processing of the variable P (S68).
[0144] Meanwhile, in a case where extraction of all of the variables C is not completed (NO in S67), the processing after S62 is executed again.
[0145] Specifically, the array X2 is the derived-type array. Accordingly, in a case where the variable P extracted through the processing of S43 is the array X2, the object generating section 111 extracts the variable Y2 which is a component of the array X2, as the variable C (YES in S61, and S62). After the processing of S62, the object generating section 111 executes the width calculation processing with respect to the variable C (S63). Hereinafter, description will be given regarding the width calculation processing in a case where the variable C is the variable Y2.
[0146] Width Calculation Processing in Case where Variable C is Variable Y2
[0147] The ID allocation information 133 illustrated in
[0148] Width Calculation Processing in Case where Variable C is Variable Z2
[0149] The ID allocation information 133 illustrated in
[0150] Returning to the width calculation processing of the variable Y2, the object generating section 111 sets 1 which is the return value in the width calculation processing of the variable Z2, with respect to the variable W2 (S63). The variable Z2 is not the derived-type array (NO in S64). Therefore, the object generating section 111 does not execute the processing of S65. Thereafter, the object generating section 111 sets 2 which is the value obtained by adding 1 set to the variable W1 and 1 set to the variable W2, with respect to the variable W1 (S66).
[0151] Here, in addition to the variable Z2, the array V2 is a component of the variable Y2. Accordingly, the object generating section 111 executes the processing after S62 again (NO in S67).
[0152] Specifically, the object generating section 111 extracts the array V2 which is a component of the variable Y2, and executes the width calculation processing of the array V2 (S62 and S63). Hereinafter, description will be given regarding the width calculation processing in a case where the variable C is the array V2.
[0153] Width Calculation Processing in Case where Variable C is Array V2
[0154] The ID allocation information 133 illustrated in
[0155] Returning to the width calculation processing of the variable Y2, the object generating section 111 sets 1 which is the return value in the width calculation processing of the array V2, with respect to the variable W2 (S63). The array V2 is not the derived-type array (NO in S64). Therefore, the object generating section 111 does not execute the processing of S65. Thereafter, the object generating section 111 sets 3 which is the value obtained by adding 2 set to the variable W1 and 1 set to the variable W2, with respect to the variable W1 (S66).
[0156] Here, the variable Z2 and the array V2 which are the components of the variable Y2 are all extracted (YES in S67). Accordingly, the object generating section 111 sets 3 which is the value set to the variable W1, as the return value, thereby ending the width calculation processing of the variable Y2 (S68).
[0157] Returning to
[0158] Meanwhile, in the processing of S46, in a case where it is determined that extraction of all of the variables P is not completed (NO in S46), the object generating section 111 executes the processing after S43 again. In addition, in a case where extraction of all of the first variables is not completed (NO in S47), the object generating section 111 executes the processing after S41 again.
[0159] Specifically, in a case where the first variable extracted through the processing of S41 is the array X2, as indicated by the underlined portion in
[0160] Thereafter, the object generating section 111 individually executes the processing of S22 in a case where the variable Z2 is extracted as the first variable, and the processing of S22 in a case where the array V2 is extracted as the first variable (NO in S47). Here, the variable Z2 and the array V2 are not the derived-type array (NO in S44, and YES in S47). Therefore, the width calculation processing of the variable Z2 and the width calculation processing of the array V2 are not executed. Accordingly, as illustrated in
[0161] Returning to
[0162] Details of Processing of S23
[0163]
[0164] Specific Example of ID Allocation Number Information
[0165]
[0166] Specifically, in the processing of S71, as illustrated in
[0167] Returning to
[0168] ID Allocation Processing of Variable D
[0169]
[0170] The object generating section 111 sets the value obtained by adding 1 to the ID allocation number information 135, as new ID allocation number information 135 (S83).
[0171] Subsequently, as illustrated in
[0172] Thereafter, in a case where a component is present in the variable D (YES in S93), the object generating section 111 extracts a variable E which is a component of the variable D, and executes the ID allocation processing of the extracted variable E (S94 and S95). Moreover, the object generating section 111 sets a value obtained by adding the number of ID allocated through the processing of S95 to the ID allocation number information 135, as the ID allocation number information 135 (S96). In a case where extraction of all of the variables E is completed (YES in S97), the object generating section 111 ends the ID allocation processing of the variable D. Meanwhile, in a case where no component is present in the variable D (NO in S93), the object generating section 111 does not execute the processing S94 to S97. In addition, in a case where extraction of all of the variables E is not completed (NO in S97), the object generating section 111 executes the processing after S94 again.
[0173] Returning to
[0174] Specifically, in the source code 331 illustrated in
[0175] Next, the object generating section 111 extracts the coarray C2 as the variable D, and executes the ID allocation processing with respect to the coarray C2 (NO in S74, S72, and S73).
[0176] Here, the ID allocation information 133 does not include the coarray C2 (NO in S81). In addition, the coarray C2 is not an array (NO in S91). Meanwhile, a component is present in the coarray C2 (YES in S93). Accordingly, the object generating section 111 extracts the array X2 which is a component of the coarray C2, and executes the ID allocation processing with respect to the extracted array X2 (S94 and S95).
[0177] In this case, the ID allocation information 133 does not include the array X2 (NO in S81). Meanwhile, the array X2 is an array (YES in S91). In addition, as illustrated in
[0178] Thereafter, the object generating section 111 extracts the variable Y2 which is a component of the array X2, and executes the ID allocation processing of the extracted variable Y2 (YES in S93, S94, and S95).
[0179] In this case, the ID allocation information 133 includes the variable Y2 (YES in S81). In addition, the ID allocation number information 135 is 0. Accordingly, the object generating section 111 calculates (index of array X21)*3 which is the value obtained by adding 0 of the ID allocation number information 135 and (index of array X21)*3 of the ID allocation expression information 136 (S82). As indicated by the underlined portion in
[0180] Subsequently, as indicated by the underlined portion in
[0181] In this case, the ID allocation information 133 includes the variable Z2 (YES in S81). In addition, the ID allocation number information 135 in the ID allocation processing with respect to the variable Y2 is 1. The ID allocation expression information 136 in the ID allocation processing with respect to the variable Y2 is (index of array X21)*3. Accordingly, the object generating section 111 calculates (index of array X21)*3+1 which is a value obtained by adding 1 of the ID allocation number information 135 and (index of array X21)*3 of the ID allocation expression information 136. As indicated by the underlined portion in
[0182] The variable Z2 is not an array and includes no component (NO in S91, and NO in S93). Accordingly, the object generating section 111 ends the ID allocation processing with respect to the variable Z2 (YES in S97).
[0183] Returning to the ID allocation processing of the variable Y2, the object generating section 111 calculates 2 which is a value obtained by adding 1 which is the number of ID allocated through the ID allocation processing with respect to the variable Z2, and 1 which is the ID allocation number information 135 in the ID allocation processing with respect to the variable Y2. As indicated by the underlined portion in
[0184] Thereafter, the object generating section 111 extracts the array V2 which is a component of the variable Y2, and executes the ID allocation processing with respect to the extracted array V2 (NO in S97, S94, and S95).
[0185] In this case, the ID allocation information 133 includes the array V2 (YES in S81). In addition, the ID allocation number information 135 in the ID allocation processing with respect to the variable Y2 is 2. The ID allocation expression information 136 in the ID allocation processing with respect to the variable Y2 is (index of array X21)*3. Accordingly, the object generating section 111 calculates (index of array X21)*3+2 which is a value obtained by adding 2 of the ID allocation number information 135 and (index of array X21)*3 of the ID allocation expression information 136. As indicated by the underlined portion in
[0186] Here, since the array V2 is an array (YES in S91), the object generating section 111 executes the processing of S92 through the ID allocation processing with respect to the array V2. However, in the successive processing, the object generating section 111 does not use the ID allocation information 133 updated through the processing of S92. Thus, description thereof will be omitted.
[0187] The array V2 includes no component. Therefore, the object generating section 111 ends the ID allocation processing with respect to the array V2 (NO in S93).
[0188] Thereafter, the object generating section 111 ends the ID allocation processing with respect to the variable Y2 and the ID allocation processing with respect to the array X2, thereby ending the processing of S23 (YES in S74).
[0189] Returning to
[0190] Specific Example of Address Information
[0191]
[0192] Specifically, in the address information 131 illustrated in
[0193] In other words, in a case of having access to the first variable of the process P1, for example, the process P2 refers to the ID allocation information 133 described in
[0194] Accordingly, in the shared memory domains allocated to the process P1, the process P2 can have access to the memory domain of which the address is address P15. The process P2 can have access to the second element in the array X2 of the process P1.
[0195] The process P1 and the process P2 are processes generated by executing the same object 333. Accordingly, the alignment sequence of address of first variable in the address information 131 corresponding to each process coincides in each process.
[0196] Returning to
[0197] Specific Example of Address Position Information
[0198]
[0199] Specifically, in the address position information 132 illustrated in
[0200] In other words, the address position information 132 illustrated in
[0201] Accordingly, when having access to a shared memory domain allocated to a different process, the object executing section 112 can have access to the address information 131 corresponding to a different process by referring to the address position information 132. In addition, when the object 333 is executed, the object executing section 112 is not desired to notify a different process of the address information 131 itself.
[0202] Returning to
[0203] Thereafter, the object generating section 111 stores the object 333 generated through the processing S12 to S15 in the information storage domain 330 of the storage device 3 (S16).
[0204] Object Execution Processing
[0205] Next, description will be given regarding processing in which the object 333 according to the first embodiment is executed (hereinafter, will also be referred to as object execution processing).
[0206] As illustrated in
[0207] Thereafter, in a case where it is the object execution time (YES in S101), the object executing section 112 acquires the object 333 from the information storage domain 330 of the storage device 3, thereby starting execution of the object 333 (S102).
[0208] The object executing section 112 prepares the address information 131 (S103). Specifically, for example, the object executing section 112 performs preparation of the address information 131 described in
[0209] Subsequently, the object executing section 112 issues notification of the address of the storage domain (the second storage domain) of the address information 131 so as to be shared with a different process (a process generated by executing the object 333), thereby preparing the address position information 132 (S104).
[0210] Specifically, the object executing section 112 transmits the address of the storage domain of the address information 131 with respect to a different process which starts an operation in a different physical machine. The object executing section 112 receives the address of the storage domain of the address information 131 from the different process which starts an operation in the different physical machine. Thereafter, for example, the object executing section 112 prepares the address position information 132 described in
[0211] Thereafter, the object executing section 112 executes the processing (the successive processing of the object 333) corresponding to the description in the source code 331 (S105).
[0212] The object executing section 112 may be configured to synchronize each of the processes when preparing each of the address information 131 and the address position information 132. In other words, for example, the object executing section 112 may be configured not to prepare the address position information 132 (the processing of S104) until the address information 131 corresponding to the multiple processes generated by executing the object 333 is all prepared.
[0213] In addition, the object executing section 112 may be configured to prepare the address information 131 and the address position information 132 based on each function described in the source code 331. In this case, the object executing section 112 may be configured to synchronize each of the processes based on each function when preparing each of the address information 131 and the address position information 132.
[0214] In this manner, the physical machine 1 has the object generating section 111 which generates the object 333 such that the address information of the first storage domain 102a storing a variable subjected to communication in multiple processes generated in response to execution of the object 333, that is, the first variable to which the storage domain is designated in response to execution of the object 333 is notified so as to be shared in the multiple processes when the object 333 is executed.
[0215] Accordingly, even in a case where a different process to be subjected to access is present in a different physical machine, the physical machine 1 can reduce the desired number of times of communication for access to the variable of the different process. Accordingly, the physical machine 1 can shorten the desired time for execution of the object.
[0216] All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiment of the present invention has been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
[0217] Note 1. An apparatus includes one or more memories; and one or more processors configured to be coupled to the one or more memories, wherein the one or more processors are configured to generate, through compiling a source code, an object program, execute the object program as multiple processes generated by execution of the object program, allocate a first storage domain in the one or more memories for each of the multiple processes, dynamically allocate a variable in the first storage domain for each of the multiple processes, notify multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
[0218] Note 2. The apparatus according to note 1, wherein the first storage domain is a storage domain which can be referred to by each of the multiple processes.
[0219] Note 3. The apparatus according to note 1, wherein the one or more processors generate the object program in which a second storage domain that is a storage domain of the address information is notified so as to be shared in the multiple processes when the object program is executed.
[0220] Note 4. The apparatus according to note 1, wherein the one or more processors generate the object program that refers to the first storage domain indicated by the address information corresponding to the variable to be referred to, in a case where the variable of a different process included in the multiple processes is referred to in response to execution of the object program.
[0221] Note 5. The apparatus according to note 1, wherein the multiple processes are processes which are operated respectively by physical machines different from each other.
[0222] Note 6. The apparatus according to note 1, wherein the one or more processors generate the object program that prepares the address information when the object program is executed.
[0223] Note 7. A non-transitory, computer-readable recording medium having stored therein a program for causing a computer to execute a process, the process including generating, through compiling a source code, an object program, executing the object program as multiple processes generated by execution of the object program, allocating a first storage domain in one or more memories for each of the multiple processes, dynamically allocating a variable in the first storage domain for each of the multiple processes, notifying multiple processes other than own process of address information of a content of the variable for each of the multiple processes.
[0224] Note 8. The non-transitory, computer-readable recording medium which stores a compilation program according to note 7, wherein the first storage domain is a storage domain which can be referred to by each of the multiple processes.
[0225] Note 9. The non-transitory, computer-readable recording medium which stores a compilation program according to note 7, wherein a second storage domain which is a storage domain of the address information is notified so as to be shared in the multiple processes in notification processing.
[0226] Note 10. The non-transitory, computer-readable recording medium which stores a compilation program according to note 7, the processing further including referring to the storage domain indicated by the address information corresponding to the variable to be referred to, in a case where the variable of a different process included in the multiple processes is referred to.
[0227] Note 11. The non-transitory, computer-readable recording medium which stores a compilation program according to note 7, wherein the multiple processes are processes which are operated respectively by physical machines different from each other.
[0228] Note 12. The non-transitory, computer-readable recording medium which stores a compilation program according to note 7, the processing further including preparing the address information before the notification processing of the address information.
[0229] Note 13. A compilation method employed in a computer, the compilation method including generating, through compiling a source code, an object program, executing the object program as multiple processes generated by execution of the object program, allocating a first storage domain in one or more memories for each of the multiple processes, dynamically allocating a variable in the first storage domain for each of the multiple processes, notifying multiple processes other than own process of address information of a content of the variable for each of the multiple processes.