From fabf70a9d566725d01d925f83fae02ab82a95547 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 7 May 2017 21:23:14 +0200 Subject: [PATCH] reduce the amount of includes --- src/instr/jedule/jedule_events.cpp | 3 --- src/instr/jedule/jedule_platform.cpp | 5 +--- src/instr/jedule/jedule_sd_binding.cpp | 2 -- .../CommunicationDeterminismChecker.cpp | 2 ++ src/simix/smx_global.cpp | 2 ++ src/smpi/colls/allgather/allgather-rdb.cpp | 5 ++-- .../colls/allgatherv/allgatherv-mpich-rdb.cpp | 9 ++++---- .../allreduce-ompi-ring-segmented.cpp | 1 + src/smpi/colls/alltoall/alltoall-pair.cpp | 1 + src/smpi/colls/alltoall/alltoall-rdb.cpp | 1 + .../bcast/bcast-scatter-LR-allgather.cpp | 4 ++-- .../bcast/bcast-scatter-rdb-allgather.cpp | 7 ++++++ src/smpi/colls/colls_private.h | 9 ++++---- src/smpi/colls/smpi_automatic_selector.cpp | 2 ++ src/smpi/colls/smpi_default_selector.cpp | 1 + src/smpi/private.h | 23 ++----------------- src/smpi/private.hpp | 1 + src/smpi/smpi_bench.cpp | 15 ++---------- src/smpi/smpi_coll.cpp | 11 ++++----- src/smpi/smpi_comm.cpp | 8 ++++++- src/smpi/smpi_comm.hpp | 6 +++-- src/smpi/smpi_datatype.cpp | 19 +++++---------- src/smpi/smpi_datatype.hpp | 9 +++----- src/smpi/smpi_datatype_derived.cpp | 15 ++++-------- src/smpi/smpi_datatype_derived.hpp | 3 ++- src/smpi/smpi_deployment.cpp | 3 +-- src/smpi/smpi_f2c.cpp | 12 +++++----- src/smpi/smpi_f2c.hpp | 3 +-- src/smpi/smpi_f77.cpp | 12 +++++----- src/smpi/smpi_global.cpp | 5 ++-- src/smpi/smpi_group.cpp | 6 ++--- src/smpi/smpi_group.hpp | 1 + src/smpi/smpi_info.cpp | 4 +--- src/smpi/smpi_info.hpp | 1 + src/smpi/smpi_keyvals.cpp | 5 ++-- src/smpi/smpi_keyvals.hpp | 2 +- src/smpi/smpi_memory.cpp | 6 ++--- src/smpi/smpi_op.cpp | 5 ++-- src/smpi/smpi_op.hpp | 3 +-- src/smpi/smpi_pmpi.cpp | 10 ++++++-- src/smpi/smpi_process.cpp | 14 ++++++----- src/smpi/smpi_process.hpp | 1 + src/smpi/smpi_replay.cpp | 8 ++++++- src/smpi/smpi_request.cpp | 6 ++++- src/smpi/smpi_request.hpp | 4 ++-- src/smpi/smpi_shared.cpp | 2 ++ src/smpi/smpi_static_variables.cpp | 3 +-- src/smpi/smpi_status.cpp | 5 ++-- src/smpi/smpi_status.hpp | 2 +- src/smpi/smpi_topo.cpp | 2 ++ src/smpi/smpi_topo.hpp | 6 ++--- src/smpi/smpi_win.cpp | 12 ++++++---- src/smpi/smpi_win.hpp | 4 +++- 53 files changed, 155 insertions(+), 156 deletions(-) diff --git a/src/instr/jedule/jedule_events.cpp b/src/instr/jedule/jedule_events.cpp index b4d48108c5..95a591b042 100644 --- a/src/instr/jedule/jedule_events.cpp +++ b/src/instr/jedule/jedule_events.cpp @@ -4,10 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "simgrid/jedule/jedule_events.hpp" - #include "simgrid/jedule/jedule.hpp" -#include "simgrid/jedule/jedule_platform.hpp" #include "simgrid/s4u/NetZone.hpp" #include "xbt/asserts.h" diff --git a/src/instr/jedule/jedule_platform.cpp b/src/instr/jedule/jedule_platform.cpp index d850392238..1bc42afffe 100644 --- a/src/instr/jedule/jedule_platform.cpp +++ b/src/instr/jedule/jedule_platform.cpp @@ -1,14 +1,11 @@ -/* Copyright (c) 2010-2016. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "simgrid/jedule/jedule.hpp" -#include "simgrid/jedule/jedule_platform.hpp" #include "simgrid/s4u/NetZone.hpp" #include "xbt/asserts.h" -#include "xbt/dynar.h" #include #if SIMGRID_HAVE_JEDULE diff --git a/src/instr/jedule/jedule_sd_binding.cpp b/src/instr/jedule/jedule_sd_binding.cpp index 24c66fd9ca..e22d6a8e6e 100644 --- a/src/instr/jedule/jedule_sd_binding.cpp +++ b/src/instr/jedule/jedule_sd_binding.cpp @@ -3,8 +3,6 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "simgrid/jedule/jedule_sd_binding.h" - #include "simgrid/jedule/jedule.hpp" #include "src/simdag/simdag_private.hpp" diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index f066b6f0df..dde414e196 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -22,6 +22,8 @@ #include "src/mc/mc_state.h" #include "src/mc/remote/Client.hpp" +#include "src/smpi/smpi_request.hpp" + using simgrid::mc::remote; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_comm_determinism, mc, diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index c875ed32fd..4c7bc5391c 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -24,6 +24,8 @@ #include "src/mc/mc_replay.h" #include "simgrid/sg_config.h" +#include "src/smpi/smpi_process.hpp" + #include "src/kernel/activity/SynchroExec.hpp" #include "src/kernel/activity/SynchroComm.hpp" #include "src/kernel/activity/SynchroSleep.hpp" diff --git a/src/smpi/colls/allgather/allgather-rdb.cpp b/src/smpi/colls/allgather/allgather-rdb.cpp index 13ff6f0a47..44dc246a7d 100644 --- a/src/smpi/colls/allgather/allgather-rdb.cpp +++ b/src/smpi/colls/allgather/allgather-rdb.cpp @@ -1,15 +1,14 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" +#include "src/smpi/smpi_status.hpp" namespace simgrid{ namespace smpi{ - int Coll_allgather_rdb::allgather(void *sbuf, int send_count, MPI_Datatype send_type, void *rbuf, diff --git a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp index 08b9cb4c13..fb374b9073 100644 --- a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp @@ -1,12 +1,13 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - /* Short or medium size message and power-of-two no. of processes. Use - * recursive doubling algorithm */ +/* Short or medium size message and power-of-two no. of processes. Use + * recursive doubling algorithm */ + #include "../colls_private.h" +#include "src/smpi/smpi_status.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp index 8500d14e72..f4f2357b79 100644 --- a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp +++ b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp @@ -154,6 +154,7 @@ } \ #include "../colls_private.h" + namespace simgrid{ namespace smpi{ int diff --git a/src/smpi/colls/alltoall/alltoall-pair.cpp b/src/smpi/colls/alltoall/alltoall-pair.cpp index 58a20df8d0..fae85c54f5 100644 --- a/src/smpi/colls/alltoall/alltoall-pair.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair.cpp @@ -5,6 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" +#include "src/smpi/smpi_win.hpp" /***************************************************************************** diff --git a/src/smpi/colls/alltoall/alltoall-rdb.cpp b/src/smpi/colls/alltoall/alltoall-rdb.cpp index 5a6d18feac..0a16b23a38 100644 --- a/src/smpi/colls/alltoall/alltoall-rdb.cpp +++ b/src/smpi/colls/alltoall/alltoall-rdb.cpp @@ -5,6 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" +#include "src/smpi/smpi_status.hpp" /***************************************************************************** diff --git a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp index ca0112d7f7..66ac6bb0b2 100644 --- a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp +++ b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp @@ -1,10 +1,10 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.h" +#include "src/smpi/smpi_status.hpp" /***************************************************************************** diff --git a/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp b/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp index f4a7d4b3bd..1a1fe1a2f6 100644 --- a/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp +++ b/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp @@ -1,4 +1,11 @@ +/* Copyright (c) 2011-2017. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "../colls_private.h" +#include "src/smpi/smpi_status.hpp" + namespace simgrid{ namespace smpi{ diff --git a/src/smpi/colls/colls_private.h b/src/smpi/colls/colls_private.h index 7ae80dc00b..865671c719 100644 --- a/src/smpi/colls/colls_private.h +++ b/src/smpi/colls/colls_private.h @@ -8,10 +8,11 @@ #include #include "smpi/mpi.h" -#include "src/smpi/private.h" -#include "xbt/ex.h" -#include "xbt.h" -#include "../smpi_coll.hpp" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_request.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_colls); diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index f1ac9ebd72..3171b71b6e 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -9,6 +9,8 @@ #include #include "colls_private.h" +#include "src/smpi/smpi_process.hpp" + //attempt to do a quick autotuning version of the collective, diff --git a/src/smpi/colls/smpi_default_selector.cpp b/src/smpi/colls/smpi_default_selector.cpp index d85e7c4056..546c2b7755 100644 --- a/src/smpi/colls/smpi_default_selector.cpp +++ b/src/smpi/colls/smpi_default_selector.cpp @@ -7,6 +7,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "colls_private.h" +#include "src/smpi/smpi_process.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/private.h b/src/smpi/private.h index a01bc88bce..515ceef2e9 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -6,30 +6,11 @@ #ifndef SMPI_PRIVATE_H #define SMPI_PRIVATE_H -#include "simgrid/simix.h" #include "smpi/smpi.h" +#include "simgrid/msg.h" // msg_bar_t #include "src/instr/instr_private.h" -#include "src/internal_config.h" -#include "xbt.h" -#include "xbt/base.h" -#include "xbt/synchro.h" -#include "xbt/xbt_os_time.h" -#include "src/smpi/smpi_process.hpp" -#include "src/smpi/smpi_f2c.hpp" -#include "src/smpi/smpi_keyvals.hpp" -#include "src/smpi/smpi_group.hpp" -#include "src/smpi/smpi_topo.hpp" -#include "src/smpi/smpi_coll.hpp" -#include "src/smpi/smpi_comm.hpp" -#include "src/smpi/smpi_info.hpp" -#include "src/smpi/smpi_op.hpp" -#include "src/smpi/smpi_datatype.hpp" -#include "src/smpi/smpi_datatype_derived.hpp" -#include "src/smpi/smpi_request.hpp" -#include "src/smpi/smpi_status.hpp" -#include "src/smpi/smpi_win.hpp" -SG_BEGIN_DECL() +SG_BEGIN_DECL() #define PERSISTENT 0x1 #define NON_PERSISTENT 0x2 diff --git a/src/smpi/private.hpp b/src/smpi/private.hpp index a5c1aed3b9..42792da047 100644 --- a/src/smpi/private.hpp +++ b/src/smpi/private.hpp @@ -9,6 +9,7 @@ #include "src/instr/instr_smpi.h" #include #include +#include "src/internal_config.h" /** * Get the address of the beginning of the memory page where addr is located. diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index c27028aae7..de0878b487 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -3,29 +3,18 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include - -#include -#include - #include "src/internal_config.h" #include "private.h" #include "private.hpp" -#include -#include "xbt/dict.h" -#include "xbt/sysdep.h" -#include "xbt/ex.h" -#include "surf/surf.h" -#include "simgrid/sg_config.h" #include "simgrid/modelchecker.h" #include "src/mc/mc_replay.h" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_comm.hpp" -#include #ifndef WIN32 #include #endif #include // sqrt -#include #if HAVE_PAPI #include diff --git a/src/smpi/smpi_coll.cpp b/src/smpi/smpi_coll.cpp index 9bee615d83..0bb1df095a 100644 --- a/src/smpi/smpi_coll.cpp +++ b/src/smpi/smpi_coll.cpp @@ -6,12 +6,11 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include -#include - -#include "private.h" -#include "simgrid/sg_config.h" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_request.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI (coll)"); diff --git a/src/smpi/smpi_comm.cpp b/src/smpi/smpi_comm.cpp index a3b9f5f0fe..8bc2bef887 100644 --- a/src/smpi/smpi_comm.cpp +++ b/src/smpi/smpi_comm.cpp @@ -5,8 +5,14 @@ #include "simgrid/s4u/Host.hpp" -#include "private.h" #include "src/simix/smx_private.h" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" +#include "src/smpi/smpi_status.hpp" +#include "src/smpi/smpi_win.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)"); diff --git a/src/smpi/smpi_comm.hpp b/src/smpi/smpi_comm.hpp index 9076cc05b0..842f92cf5d 100644 --- a/src/smpi/smpi_comm.hpp +++ b/src/smpi/smpi_comm.hpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,6 +8,9 @@ #include "private.h" #include +#include "src/smpi/smpi_keyvals.hpp" +#include "src/smpi/smpi_group.hpp" +#include "src/smpi/smpi_topo.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_datatype.cpp b/src/smpi/smpi_datatype.cpp index 9e91d9a482..6525066949 100644 --- a/src/smpi/smpi_datatype.cpp +++ b/src/smpi/smpi_datatype.cpp @@ -1,20 +1,13 @@ -/* smpi_datatype.cpp -- MPI primitives to handle datatypes */ -/* Copyright (c) 2009-2017. The SimGrid Team. - * All rights reserved. */ +/* smpi_datatype.cpp -- MPI primitives to handle datatypes */ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "mc/mc.h" -#include "private.h" #include "simgrid/modelchecker.h" -#include -#include -#include -#include -#include -#include -#include +#include "src/smpi/smpi_datatype_derived.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_process.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_datatype, smpi, "Logging specific to SMPI (datatype)"); @@ -24,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_datatype, smpi, "Logging specific to SMPI ( sizeof(type), /* size */ \ 0, /* lb */ \ sizeof(type), /* ub = lb + size */ \ - DT_FLAG_BASIC /* flags */ \ + DT_FLAG_BASIC /* flags */ \ ); \ const MPI_Datatype name = &mpi_##name; diff --git a/src/smpi/smpi_datatype.hpp b/src/smpi/smpi_datatype.hpp index f2263b0ddd..220a424ca5 100644 --- a/src/smpi/smpi_datatype.hpp +++ b/src/smpi/smpi_datatype.hpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,10 +6,8 @@ #ifndef SMPI_DATATYPE_HPP #define SMPI_DATATYPE_HPP -#include - -#include "private.h" - +#include "src/smpi/smpi_f2c.hpp" +#include "src/smpi/smpi_keyvals.hpp" #define DT_FLAG_DESTROYED 0x0001 /**< user destroyed but some other layers still have a reference */ #define DT_FLAG_COMMITED 0x0002 /**< ready to be used for a send/recv operation */ diff --git a/src/smpi/smpi_datatype_derived.cpp b/src/smpi/smpi_datatype_derived.cpp index 326dee846b..cc008857ef 100644 --- a/src/smpi/smpi_datatype_derived.cpp +++ b/src/smpi/smpi_datatype_derived.cpp @@ -1,18 +1,11 @@ -/* smpi_datatype.cpp -- MPI primitives to handle datatypes */ -/* Copyright (c) 2009-2017. The SimGrid Team. - * All rights reserved. */ +/* smpi_datatype.cpp -- MPI primitives to handle datatypes */ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "mc/mc.h" -#include "private.h" - -#include -#include -#include -#include -#include +#include "src/smpi/smpi_datatype_derived.hpp" +#include "src/smpi/smpi_op.hpp" XBT_LOG_EXTERNAL_CATEGORY(smpi_datatype); diff --git a/src/smpi/smpi_datatype_derived.hpp b/src/smpi/smpi_datatype_derived.hpp index 12e1829fad..b104c5f5c5 100644 --- a/src/smpi/smpi_datatype_derived.hpp +++ b/src/smpi/smpi_datatype_derived.hpp @@ -10,11 +10,12 @@ #include #include "private.h" +#include "src/smpi/smpi_datatype.hpp" namespace simgrid{ namespace smpi{ -class Type_Contiguous: public Datatype{ +class Type_Contiguous: public Datatype { private: int block_count_; MPI_Datatype old_type_; diff --git a/src/smpi/smpi_deployment.cpp b/src/smpi/smpi_deployment.cpp index 2dcf26e51e..45e87cee83 100644 --- a/src/smpi/smpi_deployment.cpp +++ b/src/smpi/smpi_deployment.cpp @@ -4,10 +4,9 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" #include "simgrid/msg.h" /* barrier */ #include "src/smpi/SmpiHost.hpp" -#include "xbt/log.h" +#include "src/smpi/smpi_comm.hpp" namespace simgrid { namespace smpi { diff --git a/src/smpi/smpi_f2c.cpp b/src/smpi/smpi_f2c.cpp index 1126c873d0..27f8fb45e9 100644 --- a/src/smpi/smpi_f2c.cpp +++ b/src/smpi/smpi_f2c.cpp @@ -1,12 +1,12 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" -#include +#include "src/smpi/smpi_f2c.hpp" +#include "src/smpi/smpi_process.hpp" +#include namespace simgrid{ namespace smpi{ @@ -31,12 +31,12 @@ int F2C::f2c_id(){ }; char* F2C::get_key(char* key, int id) { - snprintf(key, KEY_SIZE, "%x",id); + std::snprintf(key, KEY_SIZE, "%x",id); return key; } char* F2C::get_key_id(char* key, int id) { - snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index()); + std::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index()); return key; } diff --git a/src/smpi/smpi_f2c.hpp b/src/smpi/smpi_f2c.hpp index 3f285355b9..bfe726b640 100644 --- a/src/smpi/smpi_f2c.hpp +++ b/src/smpi/smpi_f2c.hpp @@ -9,8 +9,7 @@ #ifndef SMPI_F2C_HPP_INCLUDED #define SMPI_F2C_HPP_INCLUDED -#include "private.h" - +#include "xbt/dict.h" #define KEY_SIZE (sizeof(int) * 2 + 1) diff --git a/src/smpi/smpi_f77.cpp b/src/smpi/smpi_f77.cpp index be97ecdc46..d7ffc140b4 100644 --- a/src/smpi/smpi_f77.cpp +++ b/src/smpi/smpi_f77.cpp @@ -1,13 +1,13 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include -#include "private.h" -#include "xbt.h" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" +#include "src/smpi/smpi_win.hpp" static int running_processes = 0; diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 3770ba29ea..02e00cdd03 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -11,8 +11,6 @@ #include #include "mc/mc.h" -#include "private.h" -#include "private.hpp" #include "simgrid/s4u/Mailbox.hpp" #include "smpi/smpi_shared_malloc.hpp" #include "simgrid/sg_config.h" @@ -26,6 +24,9 @@ #include "surf/surf.h" #include "xbt/replay.hpp" #include +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_info.hpp" #include /* DBL_MAX */ #include diff --git a/src/smpi/smpi_group.cpp b/src/smpi/smpi_group.cpp index bf305775e1..590ba5e88b 100644 --- a/src/smpi/smpi_group.cpp +++ b/src/smpi/smpi_group.cpp @@ -1,10 +1,10 @@ -/* Copyright (c) 2010, 2013-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_group.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_group, smpi, "Logging specific to SMPI (group)"); diff --git a/src/smpi/smpi_group.hpp b/src/smpi/smpi_group.hpp index 461ea7fd73..1e8f4e5fd9 100644 --- a/src/smpi/smpi_group.hpp +++ b/src/smpi/smpi_group.hpp @@ -8,6 +8,7 @@ #define SMPI_GROUP_HPP_INCLUDED #include "private.h" +#include "src/smpi/smpi_f2c.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_info.cpp b/src/smpi/smpi_info.cpp index 9690b78e32..5a9697bd78 100644 --- a/src/smpi/smpi_info.cpp +++ b/src/smpi/smpi_info.cpp @@ -4,9 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" -#include -#include +#include "src/smpi/smpi_info.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_info.hpp b/src/smpi/smpi_info.hpp index 5555fe36a9..25d1034e64 100644 --- a/src/smpi/smpi_info.hpp +++ b/src/smpi/smpi_info.hpp @@ -10,6 +10,7 @@ #include #include "private.h" +#include "src/smpi/smpi_comm.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_keyvals.cpp b/src/smpi/smpi_keyvals.cpp index 3808b65c73..53cf51f8ed 100644 --- a/src/smpi/smpi_keyvals.cpp +++ b/src/smpi/smpi_keyvals.cpp @@ -4,9 +4,8 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" -#include -#include +//#include "private.h" +#include "src/smpi/smpi_keyvals.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_keyvals.hpp b/src/smpi/smpi_keyvals.hpp index c302a55667..46b136981a 100644 --- a/src/smpi/smpi_keyvals.hpp +++ b/src/smpi/smpi_keyvals.hpp @@ -7,9 +7,9 @@ #ifndef SMPI_KEYVALS_HPP_INCLUDED #define SMPI_KEYVALS_HPP_INCLUDED -#include "private.h" #include #include +#include "smpi/smpi.h" typedef struct smpi_delete_fn{ MPI_Comm_delete_attr_function *comm_delete_fn; diff --git a/src/smpi/smpi_memory.cpp b/src/smpi/smpi_memory.cpp index 8091464761..4b29b0cdcd 100644 --- a/src/smpi/smpi_memory.cpp +++ b/src/smpi/smpi_memory.cpp @@ -1,11 +1,11 @@ -/* Copyright (c) 2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include #include +#include #include @@ -21,7 +21,7 @@ #include #include -#include "../xbt/memory_map.hpp" +#include "src/xbt/memory_map.hpp" #include "private.h" #include "private.hpp" diff --git a/src/smpi/smpi_op.cpp b/src/smpi/smpi_op.cpp index 805647bb61..a212837c00 100644 --- a/src/smpi/smpi_op.cpp +++ b/src/smpi/smpi_op.cpp @@ -3,8 +3,9 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "mc/mc.h" -#include "private.h" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_process.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_op, smpi, "Logging specific to SMPI (op)"); diff --git a/src/smpi/smpi_op.hpp b/src/smpi/smpi_op.hpp index a11d3c9636..324227f22a 100644 --- a/src/smpi/smpi_op.hpp +++ b/src/smpi/smpi_op.hpp @@ -7,9 +7,8 @@ #ifndef SMPI_OP_HPP #define SMPI_OP_HPP -#include - #include "private.h" +#include "src/smpi/smpi_info.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 91e1456a71..13ea956bdb 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -5,8 +5,14 @@ #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" - -#include "private.h" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_datatype_derived.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" +#include "src/smpi/smpi_status.hpp" +#include "src/smpi/smpi_win.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, "Logging specific to SMPI (pmpi)"); diff --git a/src/smpi/smpi_process.cpp b/src/smpi/smpi_process.cpp index 194cca9b84..a2f9dd2b59 100644 --- a/src/smpi/smpi_process.cpp +++ b/src/smpi/smpi_process.cpp @@ -1,13 +1,15 @@ +/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "mc/mc.h" -#include "private.h" -#include "simgrid/s4u/Mailbox.hpp" -#include "src/kernel/activity/SynchroComm.hpp" -#include "src/mc/mc_record.h" #include "src/mc/mc_replay.h" #include "src/msg/msg_private.h" #include "src/simix/smx_private.h" -#include "surf/surf.h" -#include "xbt/replay.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_group.hpp" +#include "src/smpi/smpi_comm.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (kernel)"); diff --git a/src/smpi/smpi_process.hpp b/src/smpi/smpi_process.hpp index 4bf8d0e00b..59a4fa1024 100644 --- a/src/smpi/smpi_process.hpp +++ b/src/smpi/smpi_process.hpp @@ -12,6 +12,7 @@ #include "src/instr/instr_smpi.h" #include "private.h" #include "simgrid/s4u/Mailbox.hpp" +#include "xbt/synchro.h" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_replay.cpp b/src/smpi/smpi_replay.cpp index ada1fecf98..daf0c6f500 100644 --- a/src/smpi/smpi_replay.cpp +++ b/src/smpi/smpi_replay.cpp @@ -3,8 +3,14 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_group.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" #include "xbt/replay.hpp" + #include #include diff --git a/src/smpi/smpi_request.cpp b/src/smpi/smpi_request.cpp index 4bc218b2fb..b0a857deb6 100644 --- a/src/smpi/smpi_request.cpp +++ b/src/smpi/smpi_request.cpp @@ -3,11 +3,15 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" #include "mc/mc.h" #include "src/mc/mc_replay.h" #include "src/smpi/SmpiHost.hpp" #include "src/kernel/activity/SynchroComm.hpp" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_op.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" #include diff --git a/src/smpi/smpi_request.hpp b/src/smpi/smpi_request.hpp index 06e28da71d..f9c8446c94 100644 --- a/src/smpi/smpi_request.hpp +++ b/src/smpi/smpi_request.hpp @@ -7,12 +7,12 @@ #ifndef SMPI_REQUEST_HPP_INCLUDED #define SMPI_REQUEST_HPP_INCLUDED -#include "private.h" +#include "src/smpi/smpi_f2c.hpp" namespace simgrid{ namespace smpi{ -class Request : public F2C{ +class Request : public F2C { private : void *buf_; /* in the case of non-contiguous memory the user address should be keep diff --git a/src/smpi/smpi_shared.cpp b/src/smpi/smpi_shared.cpp index 02f5194dfd..b9e85fa779 100644 --- a/src/smpi/smpi_shared.cpp +++ b/src/smpi/smpi_shared.cpp @@ -34,11 +34,13 @@ * ---- */ #include +#include #include "private.h" #include "private.hpp" #include "smpi/smpi_shared_malloc.hpp" #include "xbt/dict.h" +#include "xbt/ex.hpp" #include #include diff --git a/src/smpi/smpi_static_variables.cpp b/src/smpi/smpi_static_variables.cpp index 4353c7f513..0a8b280aa7 100644 --- a/src/smpi/smpi_static_variables.cpp +++ b/src/smpi/smpi_static_variables.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2011-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2011-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ diff --git a/src/smpi/smpi_status.cpp b/src/smpi/smpi_status.cpp index eebea33a73..22c84bbf2f 100644 --- a/src/smpi/smpi_status.cpp +++ b/src/smpi/smpi_status.cpp @@ -1,11 +1,12 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "private.h" #include "src/simix/smx_private.h" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_status.hpp" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_status.hpp b/src/smpi/smpi_status.hpp index 7172194f33..8ac700b924 100644 --- a/src/smpi/smpi_status.hpp +++ b/src/smpi/smpi_status.hpp @@ -7,7 +7,7 @@ #ifndef SMPI_STATUS_HPP #define SMPI_STATUS_HPP -#include "private.h" +#include "smpi/smpi.h" namespace simgrid{ namespace smpi{ diff --git a/src/smpi/smpi_topo.cpp b/src/smpi/smpi_topo.cpp index 44a111bed2..e23a62332b 100644 --- a/src/smpi/smpi_topo.cpp +++ b/src/smpi/smpi_topo.cpp @@ -8,6 +8,8 @@ #include "private.h" #include #include +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_topo.hpp" /* static functions */ static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims); diff --git a/src/smpi/smpi_topo.hpp b/src/smpi/smpi_topo.hpp index f4ce792510..9e419cf1dc 100644 --- a/src/smpi/smpi_topo.hpp +++ b/src/smpi/smpi_topo.hpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,7 +6,8 @@ #ifndef SMPI_TOPO_HPP_INCLUDED #define SMPI_TOPO_HPP_INCLUDED -#include "private.h" +#include "src/smpi/smpi_comm.hpp" +#include "src/smpi/smpi_status.hpp" typedef enum MPIR_Topo_type { MPI_GRAPH=1, diff --git a/src/smpi/smpi_win.cpp b/src/smpi/smpi_win.cpp index e2d6b5f3a8..e20fdb4c66 100644 --- a/src/smpi/smpi_win.cpp +++ b/src/smpi/smpi_win.cpp @@ -1,11 +1,15 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" -#include +#include "src/smpi/smpi_coll.hpp" +#include "src/smpi/smpi_datatype.hpp" +#include "src/smpi/smpi_info.hpp" +#include "src/smpi/smpi_keyvals.hpp" +#include "src/smpi/smpi_process.hpp" +#include "src/smpi/smpi_request.hpp" +#include "src/smpi/smpi_win.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_rma, smpi, "Logging specific to SMPI (RMA operations)"); diff --git a/src/smpi/smpi_win.hpp b/src/smpi/smpi_win.hpp index ddbdae45a9..dd837b6718 100644 --- a/src/smpi/smpi_win.hpp +++ b/src/smpi/smpi_win.hpp @@ -7,7 +7,9 @@ #ifndef SMPI_WIN_HPP_INCLUDED #define SMPI_WIN_HPP_INCLUDED -#include "private.h" +#include "src/smpi/smpi_keyvals.hpp" +#include "xbt/synchro.h" + #include #include -- 2.20.1