/* Fortran specific stuff */
XBT_PUBLIC(int) MAIN__(void);
+XBT_PUBLIC(int) smpi_process_index(void);
+
SG_END_DECL()
#endif
name = NULL; \
}
-#define SMPI_GLOBAL_VAR_LOCAL_ACCESS(name) name[__rank()]
-
-/* This function stores the rank locally, so that a request in
- SIMIX is not created each time */
-int __attribute__((weak)) __rank(void) {
- static __thread int rank = -1;
-
- if(rank < 0) {
- rank = smpi_global_rank();
- }
- return rank;
-}
+#define SMPI_GLOBAL_VAR_LOCAL_ACCESS(name) name[smpi_process_index()]
#endif
#endif
#include <xbt/misc.h>
+#include <smpi/smpi.h>
#include <f2c.h>
XBT_PUBLIC(int) smpi_process_argc(void);
XBT_PUBLIC(int) smpi_process_getarg(integer* index, char* dst, ftnlen len);
-XBT_PUBLIC(int) smpi_global_rank(void);
XBT_PUBLIC(int) smpi_global_size(void);
#endif
smpi_process_data_t smpi_process_data(void);
smpi_process_data_t smpi_process_remote_data(int index);
int smpi_process_count(void);
-int smpi_process_index(void);
smx_rdv_t smpi_process_mailbox(void);
smx_rdv_t smpi_process_remote_mailbox(int index);
xbt_os_timer_t smpi_process_timer(void);
return 0;
}
-int smpi_global_rank(void) {
- return smpi_process_index();
-}
-
int smpi_global_size(void) {
char* value = getenv("SMPI_GLOBAL_SIZE");
smpi_process_data_t smpi_process_data(void)
{
- return SIMIX_req_process_get_data(SIMIX_process_self());
+ return SIMIX_process_self_get_data();
}
smpi_process_data_t smpi_process_remote_data(int index)
/* With smpiff, the following weak symbols are replaced by those in libf2c */
int __attribute__((weak)) xargc;
char** __attribute__((weak)) xargv;
-int fortran = 1;
int __attribute__((weak)) main(int argc, char** argv) {
xargc = argc;
xargv = argv;
- fortran = 0;
return MAIN__();
}
xbt_cfgelm_double, &default_threshold, 1, 1, NULL,
NULL);
- if(fortran) {
- /* Force thread contexts with fortran code */
- extern void SIMIX_ctx_thread_factory_init(smx_context_factory_t *factory);
- smx_factory_initializer_to_use = SIMIX_ctx_thread_factory_init;
- }
-
#ifdef HAVE_TRACING
TRACE_global_init(&xargc, xargv);
#endif
print $tmp "#define INTEGER_STAR_8\n";
print $tmp "#endif\n";
print $tmp "#include <stdlib.h>\n";
- print $tmp "#include <smpif.h>\n\n";
- print $tmp "int __attribute__((weak)) __rank(void) {\n static __thread int rank = -1;\n\n if(rank < 0) {\n rank = smpi_global_rank();\n }\n return rank;\n}\n\n";
+ print $tmp "#include <smpif.h>\n";
while(<F2C>) {
chomp;
if(/\/\* Common Block Declarations \*\//) {
if(/^} (.*?);/) {
$_ = "}* __attribute__((weak)) $1 = NULL;\n";
} elsif(/^#define\s*(\S*)\s*\(?([^.]*)(\..*?)?\)?$/) {
- $_ = "#define $1 $2\[__rank()\]";
+ $_ = "#define $1 $2\[smpi_process_index()\]";
if(defined $3) {
$_ .= $3;
}