Skip to content
Snippets Groups Projects
Select Git revision
  • bafe246c68af1fc8ab2492b89f1d91de6f3db659
  • master default protected
2 results

fmpi_ctx.h

Blame
  • fmpi_ctx.h 3.15 KiB
    // SPDX-License-Identifier: 0BSD
    /*!
     * @file
     * @license{
     * BSD Zero Clause License
     *
     * Copyright (c) 2022 by Raphael Bach
     *
     * Permission to use, copy, modify, and/or distribute this software for any
     * purpose with or without fee is hereby granted.
     *
     * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
     * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
     * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
     * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
     * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
     * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
     * PERFORMANCE OF THIS SOFTWARE.
     * }
     */
    /*==============================================================================
        GUARD
    ==============================================================================*/
    #ifndef FMPI_INIT_H_20211218002623
    #define FMPI_INIT_H_20211218002623
    /*==============================================================================
        INCLUDE
    ==============================================================================*/
    // C Standard Library
    #include <stddef.h> // size_t
    // Internal
    #include "../fmpi_task.h"
    #include "fmpi_error.h"
    /*==============================================================================
        STRUCT
    ==============================================================================*/
    /*------------------------------------------------------------------------------
        fmpi_ctx
    ------------------------------------------------------------------------------*/
    /**
     * TODO
     *
     * @example{
     *  TODO
     * }
     */
    typedef struct fmpi_ctx {
        struct fmpi_mpi_ctx * mpi;     //!< TODO
        struct fmpi_futhark_ctx * fut; //!< TODO
        struct fmpi_task tasks[FMPI_TASK_MAX];
        size_t task_cnt;
        double timer_start;            //!< TODO
        double timer_stop;             //!< TODO
        struct fmpi_error_handler err_handler; //!< TODO
    } fmpi_ctx;
    /*==============================================================================
        PUBLIC FUNCTION
    ==============================================================================*/
    /*------------------------------------------------------------------------------
        fmpi_ctx_create()
    ------------------------------------------------------------------------------*/
    /**
     * TODO
     *
     * @param[in] argc : TODO
     * @param[in] argv : TODO
     *
     * @return
     * - @success: TODO
     * - @failure: TODO
     *
     * @warning TODO
     *
     * @example{
     *  TODO
     * }
     */
    struct fmpi_ctx * fmpi_ctx_create(int * argc, char ** argv[]);
    /*------------------------------------------------------------------------------
        fmpi_ctx_destroy()
    ------------------------------------------------------------------------------*/
    /**
     * TODO
     *
     * @param[in] ctx : TODO
     *
     * @return
     * - @success: TODO
     * - @failure: TODO
     *
     * @warning TODO
     *
     * @example{
     *  TODO
     * }
     */
    int fmpi_ctx_destroy(struct fmpi_ctx ** ctx);
    /*==============================================================================
        GUARD
    ==============================================================================*/
    #endif // FMPI_INIT_H_20211218002623