1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "smpi_info.hpp"
9 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
11 /* PMPI User level calls */
13 int PMPI_Info_create( MPI_Info *info){
14 CHECK_NULL(1, MPI_ERR_ARG, info)
15 *info = new simgrid::smpi::Info();
19 int PMPI_Info_set( MPI_Info info, const char *key, const char *value){
21 CHECK_NULL(2, MPI_ERR_INFO_KEY, key)
22 CHECK_NULL(3, MPI_ERR_INFO_VALUE, value)
23 info->set(key, value);
27 int PMPI_Info_free( MPI_Info *info){
28 CHECK_NULL(1, MPI_ERR_ARG, info)
30 (*info)->mark_as_deleted();
31 simgrid::smpi::Info::unref(*info);
36 int PMPI_Info_get(MPI_Info info, const char *key,int valuelen, char *value, int *flag){
40 CHECK_NULL(2, MPI_ERR_INFO_KEY, key)
41 CHECK_NULL(3, MPI_ERR_INFO_VALUE, value)
42 CHECK_NULL(4, MPI_ERR_ARG, flag)
44 return info->get(key, valuelen, value, flag);
47 int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo){
49 CHECK_NULL(2, MPI_ERR_ARG, newinfo)
50 *newinfo = new simgrid::smpi::Info(info);
54 int PMPI_Info_delete(MPI_Info info, const char *key){
56 CHECK_NULL(2, MPI_ERR_INFO_KEY, key)
57 return info->remove(key);
60 int PMPI_Info_get_nkeys( MPI_Info info, int *nkeys){
62 CHECK_NULL(2, MPI_ERR_ARG, nkeys)
63 return info->get_nkeys(nkeys);
66 int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){
68 CHECK_NULL(2, MPI_ERR_INFO_KEY, key)
69 if (n<0 || n> MPI_MAX_INFO_KEY)
71 return info->get_nthkey(n, key);
74 int PMPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *flag){
77 CHECK_NULL(2, MPI_ERR_INFO_KEY, key)
78 CHECK_NULL(2, MPI_ERR_INFO_VALUE, valuelen)
79 return info->get_valuelen(key, valuelen, flag);
82 MPI_Info PMPI_Info_f2c(MPI_Fint info){
85 return simgrid::smpi::Info::f2c(info);
88 MPI_Fint PMPI_Info_c2f(MPI_Info info){
89 if(info==MPI_INFO_NULL)