A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finish removing simix.h from C files, and avoid the use of Ptr when not needed
[simgrid.git]
/
src
/
smpi
/
smpi_f2c.cpp
diff --git
a/src/smpi/smpi_f2c.cpp
b/src/smpi/smpi_f2c.cpp
index
b7828d6
..
978722d
100644
(file)
--- a/
src/smpi/smpi_f2c.cpp
+++ b/
src/smpi/smpi_f2c.cpp
@@
-1,12
+1,13
@@
-/* Copyright (c) 2007-2015. 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. */
/* 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 <vector>
+#include "src/smpi/private.h"
+#include "src/smpi/smpi_f2c.hpp"
+#include "src/smpi/smpi_process.hpp"
+#include <cstdio>
namespace simgrid{
namespace smpi{
namespace simgrid{
namespace smpi{
@@
-14,13
+15,29
@@
namespace smpi{
xbt_dict_t F2C::f2c_lookup_=nullptr;
int F2C::f2c_id_=0;
xbt_dict_t F2C::f2c_lookup_=nullptr;
int F2C::f2c_id_=0;
+xbt_dict_t F2C::f2c_lookup(){
+ return f2c_lookup_;
+}
+
+void F2C::set_f2c_lookup(xbt_dict_t dict){
+ f2c_lookup_=dict;
+}
+
+void F2C::f2c_id_increment(){
+ f2c_id_++;
+};
+
+int F2C::f2c_id(){
+ return f2c_id_;
+};
+
char* F2C::get_key(char* key, int id) {
char* F2C::get_key(char* key, int id) {
- snprintf(key, KEY_SIZE, "%x",id);
+ s
td::s
nprintf(key, KEY_SIZE, "%x",id);
return key;
}
char* F2C::get_key_id(char* key, int id) {
return key;
}
char* F2C::get_key_id(char* key, int id) {
- s
nprintf(key, KEY_SIZE, "%x_%d",id, smpi_process_
index());
+ s
td::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->
index());
return key;
}
return key;
}
@@
-43,7
+60,7
@@
int F2C::add_f(){
}
char key[KEY_SIZE];
xbt_dict_set(f2c_lookup_, get_key(key, f2c_id_), this, nullptr);
}
char key[KEY_SIZE];
xbt_dict_set(f2c_lookup_, get_key(key, f2c_id_), this, nullptr);
- f2c_id_
++
;
+ f2c_id_
increment()
;
return f2c_id_-1;
}
return f2c_id_-1;
}