Merge branches 'charm' and 'charm-mpi-interop'
authorPhil Miller <mille121@illinois.edu>
Mon, 19 Mar 2012 04:56:44 +0000 (23:56 -0500)
committerPhil Miller <mille121@illinois.edu>
Mon, 19 Mar 2012 04:57:51 +0000 (23:57 -0500)
1  2 
src/arch/mpi/machine.c
src/arch/util/machine-common-core.c
src/ck-core/init.C
src/conv-core/convcore.c
src/conv-core/converse.h

index eaa3022bc2e08ab5cb480d2a447525b4c776aa60,c08f0bb0636cf64d8fdb04286ae2da317de8d16c..6d3f524b353617c3371a7f4005c2815c65099c70
@@@ -1285,14 -1315,13 +1287,15 @@@ static void MachineInitForMPI(int *argc
  #endif
  #endif
  
 -#if CMK_SMP
      if (CmiGetArgFlag(largv, "+comm_thread_only_recv")) {
 +#if CMK_SMP
        Cmi_smp_mode_setting = COMM_THREAD_ONLY_RECV;
 -    }
 +#else
 +      CmiAbort("+comm_thread_only_recv option can only be used with SMP version of Charm++");
  #endif
 +    }
  
+     if(!CharmLibInterOperate) {
  #if CMK_MPI_INIT_THREAD
  #if CMK_SMP
      if (Cmi_smp_mode_setting == COMM_THREAD_SEND_RECV)
  
      myNID = *myNodeID;
  
 -#if CMK_SMP
 -    if (Cmi_smp_mode_setting == COMM_THREAD_ONLY_RECV && _thread_provided != MPI_THREAD_MULTIPLE) {
 -        Cmi_smp_mode_setting = COMM_THREAD_SEND_RECV; 
 -    }
 -#endif
 -
      MPI_Get_version(&ver, &subver);
-     if (myNID == 0) {
+     if(!CharmLibInterOperate) {
+       if (myNID == 0) {
          printf("Charm++> Running on MPI version: %d.%d\n", ver, subver);
          printf("Charm++> level of thread support used: %s (desired: %s)\n", thread_level_tostring(_thread_provided), thread_level_tostring(thread_level));
+       }
      }
  
 +#if CMK_SMP
 +    if (Cmi_smp_mode_setting == COMM_THREAD_ONLY_RECV && _thread_provided != MPI_THREAD_MULTIPLE) {
 +        Cmi_smp_mode_setting = COMM_THREAD_SEND_RECV; 
 +        if (myNID == 0) {
 +          printf("Charm++> +comm_thread_only_recv disabled\n");
 +        }
 +    }
 +#endif
 +
      {
          int debug = CmiGetArgFlag(largv,"++debug");
          int debug_no_pause = CmiGetArgFlag(largv,"++debug-no-pause");
Simple merge
Simple merge
Simple merge
index 7ec8e3df10531282d251ae04e463d4815d5a273b,f6f90f8a9e0254bbaa65ecf78f4e7f648e6edff4..df4b7c16c9507723bd93167d6885b8e2f1eeeab5
@@@ -1878,31 -1901,10 +1880,37 @@@ extern unsigned int CmiILog2(unsigned i
  extern double CmiLog2(double);
  #endif
  
 +#if CMK_SMP && CMK_LEVERAGE_COMMTHREAD
 +#if defined(__cplusplus)
 +#define EXTERN extern "C"
 +#else
 +#define EXTERN extern
 +#endif
 +typedef void (*CmiCommThdFnPtr)(int numParams, void *params);
 +typedef struct CmiNotifyCommThdMsg {
 +    char core[CmiMsgHeaderSizeBytes];
 +    CmiCommThdFnPtr fn;
 +    int numParams;
 +    void *params;
 +    int toKeep; /* whether to free this msg by comm thread when the msg is processed */ 
 +}CmiNotifyCommThdMsg;
 +
 +EXTERN CmiNotifyCommThdMsg *CmiCreateNotifyCommThdMsg(CmiCommThdFnPtr fn, int numParams, void *params, int toKeep);
 +EXTERN void CmiFreeNotifyCommThdMsg(CmiNotifyCommThdMsg *msg);
 +/* Initialize a notification msg */
 +EXTERN void CmiResetNotifyCommThdMsg(CmiNotifyCommThdMsg *msg, CmiCommThdFnPtr fn, int numParams, void *params, int toKeep);
 +/* Enqueue the msg into the local comm thread, and wait for being processed */
 +EXTERN void CmiNotifyCommThd(CmiNotifyCommThdMsg *msg);
 +#endif
 +
 +CpvCExtern(int, _urgentSend);
 +#define CmiEnableUrgentSend(yn)   CpvAccess(_urgentSend)=(yn)
 +
 +
+ /* CharmLibInterOperate should be a global variable as it will be
+  * set only once by MPI ranks respectively.
+  */
+ extern int CharmLibInterOperate;
+ CpvExtern(int,charmLibExitFlag);
  #endif /* CONVERSE_H */