Beispiel #1
0
 def test1(self):
     x = create_fortran.GenerateAFortranSourcecodeStringFromASpecificationClass(
     )
     x.specification_class = ForTestingInterface
     x.start()
     outputstring = x.result
     self.assertContainsString(outputstring, "integer :: echo_int")
     self.assertContainsString(outputstring, "integer :: echo_double")
     self.assertContainsString(outputstring, "echo_int(")
     self.assertContainsString(outputstring, "echo_double(")
Beispiel #2
0
 def test2(self):
     x = create_fortran.GenerateAFortranSourcecodeStringFromASpecificationClass(
     )
     x.specification_class = ForTestingInterface
     x.underscore_functions_from_specification_classes = [
         ForTestingInterface
     ]
     x.start()
     outputstring = x.result
     self.assertContainsString(outputstring, "integer :: echo_int_")
     self.assertContainsString(outputstring, "integer :: echo_double_")
     self.assertContainsString(outputstring, "echo_int_(")
     self.assertContainsString(outputstring, "echo_double_(")
Beispiel #3
0
    def build_worker(self):

        path = os.path.abspath(self.get_path_to_results())
        codefile = os.path.join(path, "code-sockets.o")
        interfacefile = os.path.join(path, "interface-sockets.o")
        self.exefile = os.path.join(path, "fortran_worker")

        self.fortran_compile(codefile, codestring)

        uc = create_fortran.GenerateAFortranSourcecodeStringFromASpecificationClass(
        )
        uc.specification_class = ForTestingInterface
        string = uc.result
        self.fortran_compile(interfacefile, string)
        self.fortran_build(self.exefile, [interfacefile, codefile])
Beispiel #4
0
def build_fortran_worker(codestring, path_to_results, interface, needs_mpi = True,
                             extra_fflags=[], extra_ldflags=[]):
    
    path = os.path.abspath(path_to_results)  
    codefile = os.path.join(path,"code.o")
    interfacefile = os.path.join(path,"interface.o")
    exefile = os.path.join(path,"fortran_worker")
    
    fortran_compile(codefile, codestring, extra_args=extra_fflags)
    
    uc = create_fortran.GenerateAFortranSourcecodeStringFromASpecificationClass()
    uc.specification_class = interface
    uc.needs_mpi = needs_mpi
    string =  uc.result
    fortran_compile(interfacefile, string, extra_args=extra_fflags)
    fortran_build(exefile, [interfacefile, codefile], extra_args=extra_ldflags )
    return exefile
Beispiel #5
0
 def build_worker(self):
     path = os.path.abspath(self.get_path_to_results())
     codefile = os.path.join(path,"codef90.o")
     interfacefile = os.path.join(path,"interfacef90.o")
     self.exefile = os.path.join(path,"fortran_worker")
     
     self.f90_compile(codefile, self.get_codestring())
     
     uf = create_fortran.GenerateAFortranSourcecodeStringFromASpecificationClass()
     uf.needs_mpi = True
     uf.specification_class = self.get_interface_class()
     string =  uf.result
     
     #print string
     
     self.f90_compile(interfacefile, string)
     self.f90_build(self.exefile, [interfacefile, codefile] )