コード例 #1
0
def compile_psrdada_cpp(params):
    make_psrdada_cpp_header(params, outfile=str(FBFUSE_CONSTANTS_FILE))
    with PSRDADA_CPP_BUILD_DIR:
        cmake_cmd = [
            "cmake", "-DENABLE_CUDA=true", "-DCMAKE_BUILD_TYPE=release",
            str(PSRDADA_CPP_BASE_DIR)
        ]
        cmake_proc = Popen(cmake_cmd, stdout=PIPE, stderr=PIPE)
        log.info("Running CMake on PSRDADA_CPP")
        yield process_watcher(cmake_proc, name="cmake fbfuse", timeout=60)

        make_cmd = ["make", "fbfuse", "-j", "16"]
        make_proc = Popen(make_cmd, stdout=PIPE, stderr=PIPE)
        log.info("Making PSRDADA_CPP")
        yield process_watcher(make_proc, name="make fbfuse", timeout=600)

        make_install_cmd = ["make", "install", "fbfuse", "-j", "16"]
        make_install_proc = Popen(make_install_cmd, stdout=PIPE, stderr=PIPE)
        log.info("Installing PSRDADA_CPP")
        yield process_watcher(make_install_proc,
                              name="make install fbfuse",
                              timeout=60)
コード例 #2
0
 def _destroy_db(self, key, timeout=20.0):
     log.debug("Destroying DADA buffer with key={}".format(key))
     if self._exec_mode == FULL:
         cmdline = map(str, ["dada_db", "-k", key, "-d"])
         proc = Popen(cmdline,
                      stdout=PIPE,
                      stderr=PIPE,
                      shell=False,
                      close_fds=True)
         yield process_watcher(proc,
                               name="destroy_db({})".format(key),
                               timeout=timeout)
     else:
         log.warning(("Current execution mode disables "
                      "DADA buffer creation/destruction"))
コード例 #3
0
 def _reset_db(self, key, timeout=5.0):
     log.debug("Resetting DADA buffer with key={}".format(key))
     if self._exec_mode == FULL:
         cmdline = map(str, ["dbreset", "-k", key])
         proc = Popen(cmdline,
                      stdout=PIPE,
                      stderr=PIPE,
                      shell=False,
                      close_fds=True)
         yield process_watcher(proc,
                               name="reset_db({})".format(key),
                               timeout=timeout)
     else:
         log.warning(("Current execution mode disables "
                      "DADA buffer reset"))
コード例 #4
0
 def _make_db(self, key, block_size, nblocks, timeout=120):
     try:
         yield self._destroy_db(key, timeout=20)
     except Exception as error:
         log.debug("Could not clean previous buffer (key={}): {}".format(
             key, str(error)))
     log.debug(("Building DADA buffer: key={}, block_size={}, "
                "nblocks={}").format(key, block_size, nblocks))
     if self._exec_mode == FULL:
         cmdline = map(str, [
             "dada_db", "-k", key, "-b", block_size, "-n", nblocks, "-l",
             "-p"
         ])
         proc = Popen(cmdline,
                      stdout=PIPE,
                      stderr=PIPE,
                      shell=False,
                      close_fds=True)
         yield process_watcher(proc,
                               name="make_db({})".format(key),
                               timeout=timeout)
     else:
         log.warning(("Current execution mode disables "
                      "DADA buffer creation/destruction"))