Skip to content
Snippets Groups Projects
Select Git revision
  • f7d74f82e35fd2d1c3f20bd74dc1c776bcb4bc79
  • master default protected
  • sion
  • tc
4 results

nam_ext_interface.c

Blame
  • nam_ext_interface.c 29.14 KiB
    /*
     * nam_ext_interface.c
     *
     *  Created on: Jun 2, 2016
     *      Author: galonska
     */
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/time.h>
    #include <limits.h>
    #include <inttypes.h>
    #include <dirent.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <regex.h>
    #include <mpi.h>
    #include "nam_memory.h"
    #include "nam_util.h"
    #include "nam_interface.h"
    #include "nam_ext_interface.h"
    #include "nam_extoll.h"
    
    #define GET_COMM 11
    #define GET_B_COMM 10
    #define PUT_COMM 3
    #define PUT_B_COMM 2
    
    int init_extended = 0;
    
    
    //ToDo: function to gain challenge as color for mpi_comm_split (according to rank)
    //Benchmark für XOR checkpointing
    
    MPI_Datatype nam_mpi_allocation;
    
    typedef struct nam_mpi_allocation_info
    {
    	int status;
    	int persistant;
    	int nam_index;
    	uint64_t nla;
    	uint64_t challenge;
    	size_t size;
    
    }nam_mpi_allocation_info_t;
    
    typedef struct nam_cp_args
    {
    	size_t offset;
    	void *buf;
    	size_t bytes;
    	int root;
    	int data_avail;
    	nam_ext_allocation_t *ext_alloc;
    } nam_cp_args_t;
    
    static inline
    unsigned long getusec(void)
    {
    	struct timeval tv;
    	gettimeofday(&tv,NULL);
    	return (tv.tv_usec+tv.tv_sec*1000000);
    }
    int dummy_allgather (void *s_buf, int count, MPI_Datatype type, void *r_buf, MPI_Comm comm)
    {
    //MPI_AllGather(&my_rank_global, 1, MPI_INT, ext_alloc->global_ranks, 1, MPI_INT, comm_local);
    
    	int root = 0;
    	int ranks;